MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ upload_resizing()

MAYAFLUX_API void MayaFlux::Buffers::upload_resizing ( const void *  data,
size_t  size,
const std::shared_ptr< VKBuffer > &  target,
const std::shared_ptr< VKBuffer > &  staging,
float  growth_factor = 1.5F 
)

Upload size bytes to target, growing both buffers first if needed.

Parameters
dataSource pointer.
sizeByte count to upload.
targetDestination GPU buffer.
stagingPaired staging buffer, or nullptr for host-visible targets.
growth_factorForwarded to ensure_gpu_capacity.

Combines ensure_gpu_capacity() and upload_to_gpu() into a single call. The upload is clamped to the post-resize capacity, which is always >= size after ensure_gpu_capacity returns.

Definition at line 326 of file StagingUtils.cpp.

332{
333 ensure_gpu_capacity(target, staging, size, growth_factor);
334 upload_to_gpu(data, size, target, staging);
335}
Range size
void ensure_gpu_capacity(const std::shared_ptr< VKBuffer > &target, const std::shared_ptr< VKBuffer > &staging, size_t required, float growth_factor)
Grow a GPU buffer (and its paired staging buffer) to fit required bytes.
void upload_to_gpu(const void *data, size_t size, const std::shared_ptr< VKBuffer > &target, const std::shared_ptr< VKBuffer > &staging)
Upload raw data to GPU buffer (auto-detects host-visible vs device-local)

References ensure_gpu_capacity(), size, and upload_to_gpu().

Referenced by MayaFlux::Buffers::GeometryBindingsProcessor::processing_function(), MayaFlux::Buffers::GeometryWriteProcessor::processing_function(), MayaFlux::Buffers::NetworkGeometryProcessor::processing_function(), MayaFlux::Buffers::GeometryBindingsProcessor::upload_index_data(), MayaFlux::Buffers::MeshProcessor::upload_indices(), MayaFlux::Buffers::MeshNetworkProcessor::upload_ssbos(), and MayaFlux::Buffers::MeshProcessor::upload_vertices().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: