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

BufferProcessor that uploads multiple texture nodes to GPU. More...

#include <TextureBindingsProcessor.hpp>

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

Classes

struct  TextureBinding
 

Public Member Functions

void bind_texture_node (const std::string &name, const std::shared_ptr< Nodes::GpuSync::TextureNode > &node, const std::shared_ptr< VKBuffer > &texture)
 Bind a texture node to a GPU texture buffer.
 
void unbind_texture_node (const std::string &name)
 Remove a texture binding.
 
bool has_binding (const std::string &name) const
 Check if a binding exists.
 
std::vector< std::string > get_binding_names () const
 Get all binding names.
 
size_t get_binding_count () const
 Get number of active bindings.
 
void processing_function (std::shared_ptr< Buffer > buffer) override
 The core processing function that must be implemented by derived classes.
 
- 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 on_attach (std::shared_ptr< Buffer >)
 Called when this processor is attached to a buffer.
 
virtual void on_detach (std::shared_ptr< Buffer >)
 Called when this processor is detached from a 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.
 
virtual bool is_compatible_with (std::shared_ptr< Buffer >) const
 Checks if this processor can handle the specified buffer type.
 

Private Attributes

std::unordered_map< std::string, TextureBindingm_bindings
 

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

BufferProcessor that uploads multiple texture nodes to GPU.

Manages bindings between TextureNode instances and GPU texture buffers. Each frame, reads pixel data from nodes and uploads to corresponding GPU textures.

Behavior:

  • If ATTACHED buffer is host-visible: uploads all textures to their targets + attached buffer
  • If ATTACHED buffer is device-local: uploads all textures via staging buffers

Usage: auto texture_buffer = std::make_shared<VKBuffer>(...); auto processor = std::make_shared<TextureBindingsProcessor>();

processor->bind_texture_node("spectrum", spectrum_node, spectrum_texture); processor->bind_texture_node("waveform", waveform_node, waveform_texture);

texture_buffer->set_default_processor(processor); texture_buffer->process_default(); // Uploads all bound textures

Definition at line 32 of file TextureBindingsProcessor.hpp.


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