|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API void MayaFlux::Buffers::download_from_gpu_async | ( | const std::shared_ptr< VKBuffer > & | source, |
| void * | data, | ||
| size_t | size, | ||
| std::shared_ptr< VKBuffer > & | staging | ||
| ) |
Download from a device-local GPU buffer without stalling the graphics queue.
Records a buffer copy into a fenced command buffer, waits on the fence from the calling thread, then memcpys from the mapped staging buffer into data. Unlike download_from_gpu, this does not call queue.waitIdle, making it safe to call from any thread that is not the graphics thread itself.
staging is allocated and cached by the caller to avoid per-call Vulkan object churn. Pass the same staging buffer each frame; it is resized if size exceeds its current capacity.
| source | Device-local source buffer. |
| data | Destination host pointer, at least size bytes. |
| size | Byte count to copy. |
| staging | Persistent host-visible staging buffer. Created via create_staging_buffer(). Resized in-place if too small. |
Definition at line 390 of file StagingUtils.cpp.
References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, create_staging_buffer(), MayaFlux::Registry::BackendRegistry::get_service(), MayaFlux::Registry::BackendRegistry::instance(), and ptr.
Referenced by MayaFlux::Nodes::GpuSync::GeometryReadbackNode::compute_frame().
Here is the call graph for this function:
Here is the caller graph for this function: