|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
Transfers data from CPU source buffer to GPU VKBuffer. More...
#include <BufferUploadProcessor.hpp>
Inheritance diagram for MayaFlux::Buffers::BufferUploadProcessor:
Collaboration diagram for MayaFlux::Buffers::BufferUploadProcessor:Public Member Functions | |
| BufferUploadProcessor () | |
| void | configure_source (const std::shared_ptr< Buffer > &target, std::shared_ptr< Buffer > source) |
| Configure source buffer for a specific target. | |
| std::shared_ptr< Buffer > | get_source (const std::shared_ptr< Buffer > &target) const |
| Get configured source for a target. | |
| bool | is_compatible_with (const std::shared_ptr< Buffer > &buffer) const override |
| Checks if this processor can handle the specified buffer type. | |
| void | on_attach (const std::shared_ptr< Buffer > &buffer) override |
| Called when this processor is attached to a buffer. | |
| void | on_detach (const std::shared_ptr< Buffer > &buffer) override |
| Called when this processor is detached from a buffer. | |
| void | processing_function (const std::shared_ptr< Buffer > &buffer) override |
| The core processing function that must be implemented by derived classes. | |
| void | remove_source (const std::shared_ptr< Buffer > &target) |
| Remove source configuration for a target. | |
| ~BufferUploadProcessor () override | |
Public Member Functions inherited from MayaFlux::Buffers::BufferProcessor | |
| virtual ProcessingToken | get_processing_token () const |
| Gets the current processing token for this buffer. | |
| void | process (const 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 | ~BufferProcessor ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
Private Member Functions | |
| void | ensure_staging_buffer (const std::shared_ptr< VKBuffer > &target) |
| void | upload_device_local (const std::shared_ptr< VKBuffer > &target, const Kakshya::DataVariant &data) |
Private Attributes | |
| std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< Buffer > > | m_source_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 | ensure_initialized (const std::shared_ptr< VKBuffer > &buffer) |
| void | initialize_buffer_service () |
| void | initialize_compute_service () |
Protected Attributes inherited from MayaFlux::Buffers::VKBufferProcessor | |
| Registry::Service::BufferService * | m_buffer_service = nullptr |
| Registry::Service::ComputeService * | m_compute_service = nullptr |
Protected Attributes inherited from MayaFlux::Buffers::BufferProcessor | |
| ProcessingToken | m_processing_token { ProcessingToken::AUDIO_BACKEND } |
Transfers data from CPU source buffer to GPU VKBuffer.
This processor can be attached to multiple VKBuffers and configured with different source buffers for each target. The mapping is maintained internally, adhering to the n-to-n processor-buffer relationship.
Usage: auto upload = std::make_shared<BufferUploadProcessor>(); upload->configure_source(gpu_buffer1, cpu_source1); upload->configure_source(gpu_buffer2, cpu_source2);
chain->add_processor(upload, gpu_buffer1); chain->add_processor(upload, gpu_buffer2);
Each process() call uploads data from the configured source for that specific buffer.
Definition at line 25 of file BufferUploadProcessor.hpp.