|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API void MayaFlux::Buffers::ensure_gpu_capacity | ( | const std::shared_ptr< VKBuffer > & | target, |
| const std::shared_ptr< VKBuffer > & | staging, | ||
| size_t | required, | ||
| float | growth_factor = k_buffer_growth_factor |
||
| ) |
Grow a GPU buffer (and its paired staging buffer) to fit required bytes.
| target | Device-local or host-visible GPU buffer to resize. |
| staging | Paired staging buffer, or nullptr if the target is host-visible. |
| required | Bytes needed for the next upload. |
| growth_factor | Multiplier applied when a resize is triggered (default 1.5). |
No-op when target already has sufficient capacity. When a resize is necessary both buffers are grown to required * growth_factor so subsequent small increments do not trigger further allocations. Existing GPU data is not preserved (preserve_data = false) because the caller is about to overwrite it.
Definition at line 272 of file StagingUtils.cpp.
Referenced by upload_resizing().
Here is the caller graph for this function: