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

◆ download_bound() [2/2]

bool MayaFlux::Buffers::ShaderProcessor::download_bound ( const std::string &  descriptor_name,
void *  data,
size_t  size,
const std::shared_ptr< VKBuffer > &  staging = nullptr 
) const

Download the buffer currently bound to a named descriptor.

Parameters
descriptor_nameLogical name previously bound via bind_buffer.
dataDestination pointer, at least the bound buffer's size in bytes.
sizeByte count to copy.
stagingOptional staging buffer, forwarded to download_from_gpu.
Returns
True if the name resolved to a bound buffer and the download ran.

Definition at line 191 of file ShaderProcessor.cpp.

196{
197 auto buffer = get_bound_buffer(descriptor_name);
198 if (!buffer) {
200 "download_bound: no buffer bound to descriptor '{}'", descriptor_name);
201 return false;
202 }
203
204 download_from_gpu(buffer, data, size, staging);
205 return true;
206}
#define MF_ERROR(comp, ctx,...)
std::shared_ptr< VKBuffer > get_bound_buffer(const std::string &descriptor_name) const
Get bound buffer for a descriptor name.
void download_from_gpu(const std::shared_ptr< VKBuffer > &source, void *data, size_t size, const std::shared_ptr< VKBuffer > &staging)
Download from GPU buffer to raw data (auto-detects host-visible vs device-local)
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Buffers::download_from_gpu(), get_bound_buffer(), and MF_ERROR.

+ Here is the call graph for this function: