|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API TransferHandle MayaFlux::Buffers::download_back_buffer_async | ( | const VKBufferResources::GenerationSlot & | slot, |
| size_t | size, | ||
| std::shared_ptr< VKBuffer > & | staging, | ||
| size_t | staging_offset = 0 |
||
| ) |
Record a slot-to-staging copy without waiting for completion.
| slot | Source slot, typically from VKBuffer::get_back_buffer(). |
| size | Byte count to copy. |
| staging | Staging buffer, already large enough for staging_offset + size. Not grown here: reallocating mid-batch would orphan copies already recorded against the old allocation. Size it with create_staging_buffer before the batch. |
| staging_offset | Byte offset within staging the copy lands at, so several reads share one staging buffer and their transfers overlap instead of serialising one round trip each. |
Mirrors upload_back_buffer_async with the direction reversed, and with one asymmetry: an upload's memcpy precedes the fence, a download's follows it, so the host copy lives in resolve_back_buffer_read rather than here. download_back_buffer is the two called back to back.
Note the naming clash with download_from_gpu_async, which is a different family: that one operates on a whole VKBuffer, waits internally, and means only that it avoids queue.waitIdle.
Definition at line 298 of file StagingUtils.cpp.
References MayaFlux::Buffers::VKBufferResources::GenerationSlot::buffer, MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, create_staging_buffer(), MayaFlux::Registry::BackendRegistry::get_service(), MayaFlux::Registry::BackendRegistry::instance(), MayaFlux::Buffers::VKBufferResources::GenerationSlot::mapped_ptr, and size.
Referenced by download_back_buffer(), MayaFlux::Buffers::VolumeGridBuffer::read_fields(), and MayaFlux::Buffers::DataReadProcessor::submit_read().
Here is the call graph for this function:
Here is the caller graph for this function: