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

Default processor for FormaBuffer. More...

#include <FormaProcessor.hpp>

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

Classes

struct  PendingTexture
 

Public Member Functions

 FormaProcessor (Portal::Graphics::PrimitiveTopology topology)
 
bool has_pending () const noexcept
 
void set_bytes (std::vector< uint8_t > bytes)
 Supply new vertex bytes for the next graphics tick.
 
void set_texture (std::shared_ptr< Core::VKImage > image, std::string binding)
 Supply a texture to bind on the next graphics tick.
 
 ~FormaProcessor () override=default
 
- Public Member Functions inherited from MayaFlux::Buffers::BufferProcessor
virtual ProcessingToken get_processing_token () const
 Gets the current processing token for this buffer.
 
virtual bool is_compatible_with (const std::shared_ptr< Buffer > &) const
 Checks if this processor can handle the specified buffer type.
 
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.
 

Protected Member Functions

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.
 
- 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 ()
 

Private Member Functions

uint32_t vertex_count (size_t byte_count) const noexcept
 

Private Attributes

std::vector< uint8_t > m_active
 
std::atomic_flag m_geometry_dirty
 
std::vector< uint8_t > m_pending_geometry
 
std::optional< PendingTexturem_pending_texture
 
std::shared_ptr< VKBufferm_staging
 
uint32_t m_stride { 0 }
 
std::atomic_flag m_texture_dirty
 
Portal::Graphics::PrimitiveTopology m_topology
 

Additional Inherited Members

- 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

Default processor for FormaBuffer.

Owns the CPU-to-GPU upload cycle for Forma geometry. Accepts raw interleaved vertex bytes via set_bytes(), stores them behind an atomic dirty flag, and uploads to the device-local buffer each graphics tick via a persistent staging buffer. Updates vertex_count in the buffer's VertexLayout after every upload so RenderProcessor draws the correct number of vertices.

Mirrors DataWriteProcessor in structure. The topology is fixed at construction to derive the correct per-vertex stride for the vertex_count calculation.

Definition at line 23 of file FormaProcessor.hpp.


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