MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Buffers::BufferDownloadProcessor Class Reference

Transfers data from GPU VKBuffer to CPU target buffer. More...

#include <BufferDownloadProcessor.hpp>

+ Inheritance diagram for MayaFlux::Buffers::BufferDownloadProcessor:
+ Collaboration diagram for MayaFlux::Buffers::BufferDownloadProcessor:

Public Member Functions

 BufferDownloadProcessor ()
 
 ~BufferDownloadProcessor () override
 
void processing_function (std::shared_ptr< Buffer > buffer) override
 The core processing function that must be implemented by derived classes.
 
void on_attach (std::shared_ptr< Buffer > buffer) override
 Called when this processor is attached to a buffer.
 
void on_detach (std::shared_ptr< Buffer > buffer) override
 Called when this processor is detached from a buffer.
 
bool is_compatible_with (std::shared_ptr< Buffer > buffer) const override
 Checks if this processor can handle the specified buffer type.
 
void configure_target (const std::shared_ptr< Buffer > &source, std::shared_ptr< Buffer > target)
 Configure target buffer for a specific source.
 
void remove_target (const std::shared_ptr< Buffer > &source)
 Remove target configuration for a source.
 
std::shared_ptr< Bufferget_target (const std::shared_ptr< Buffer > &source) const
 Get configured target for a source.
 
- Public Member Functions inherited from MayaFlux::Buffers::BufferProcessor
virtual ~BufferProcessor ()=default
 Virtual destructor for proper cleanup of derived classes.
 
void process (std::shared_ptr< Buffer > buffer)
 Applies a computational transformation to the data in the provided buffer.
 
virtual void set_processing_token (ProcessingToken token)
 Gets the preferred processing backend for this processor.
 
virtual ProcessingToken get_processing_token () const
 Gets the current processing token for this buffer.
 

Private Member Functions

void ensure_staging_buffer (const std::shared_ptr< VKBuffer > &source)
 
void download_host_visible (const std::shared_ptr< VKBuffer > &source)
 
void download_device_local (const std::shared_ptr< VKBuffer > &source)
 

Private Attributes

std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< Buffer > > m_target_map
 
std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< VKBuffer > > m_staging_buffers
 

Additional Inherited Members

- Protected Member Functions inherited from MayaFlux::Buffers::VKBufferProcessor
void initialize_buffer_service ()
 
void initialize_compute_service ()
 
- Protected Attributes inherited from MayaFlux::Buffers::VKBufferProcessor
Registry::Service::BufferServicem_buffer_service = nullptr
 
Registry::Service::ComputeServicem_compute_service = nullptr
 
- Protected Attributes inherited from MayaFlux::Buffers::BufferProcessor
ProcessingToken m_processing_token { ProcessingToken::AUDIO_BACKEND }
 

Detailed Description

Transfers data from GPU VKBuffer to CPU target buffer.

Inverse of BufferUploadProcessor. Handles staging and transfer from device-local buffers.

Usage: auto download = std::make_shared<BufferDownloadProcessor>(); download->configure_target(gpu_buffer1, cpu_target1); download->configure_target(gpu_buffer2, cpu_target2);

chain->add_processor(download, gpu_buffer1); chain->add_processor(download, gpu_buffer2);

Each process() call downloads latest data to the configured target for that source.

Definition at line 24 of file BufferDownloadProcessor.hpp.


The documentation for this class was generated from the following files: