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

◆ download_data()

void MayaFlux::Portal::Graphics::TextureLoom::download_data ( const std::shared_ptr< Core::VKImage > &  image,
void *  data,
size_t  size,
const std::shared_ptr< Buffers::VKBuffer > &  staging,
bool  deferred = false 
)

Download pixel data from a VKImage, reusing a caller-supplied persistent staging buffer.

When staging is null, falls through to the per-call blocking path. When staging is supplied, submits under a fence (fenced, not waitIdle) so other GPU work proceeds concurrently during the wait. When deferred is true, records commands for deferred submission; the caller is responsible for flushing. Ignored when staging is null.

The staging buffer must be host-visible and at least size bytes. Allocate once with Buffers::create_image_staging_buffer(size).

Parameters
imageSource VKImage. Must be initialised.
dataDestination host pointer, at least size bytes.
sizeByte count to read.
stagingPersistent staging buffer, or nullptr for per-call path.
deferredWhen true and staging is supplied, records for deferred submission rather than immediate fenced execution.

Definition at line 449 of file TextureLoom.cpp.

455{
456 if (!is_initialized() || !image || !data) {
458 "download_data(staging): invalid parameters");
459 return;
460 }
461
462 m_resource_manager->download_image_data(image, data, size, staging, deferred);
463}
#define MF_ERROR(comp, ctx,...)
IO::ImageData image
Definition Decoder.cpp:64
void download_image_data(std::shared_ptr< VKImage > image, void *data, size_t size, const std::shared_ptr< Buffers::VKBuffer > &staging=nullptr, bool deferred=false, vk::ImageLayout restore_layout=vk::ImageLayout::eShaderReadOnlyOptimal, vk::PipelineStageFlags restore_stage=vk::PipelineStageFlagBits::eFragmentShader)
Download image data to a host pointer.
Core::BackendResourceManager * m_resource_manager
bool is_initialized() const
Check if manager is initialized.
@ ImageProcessing
Image processing tasks (filters, transformations)
@ Portal
High-level user-facing API layer.

References MayaFlux::Core::BackendResourceManager::download_image_data(), image, MayaFlux::Journal::ImageProcessing, is_initialized(), m_resource_manager, MF_ERROR, and MayaFlux::Journal::Portal.

+ Here is the call graph for this function: