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

◆ processing_function()

void MayaFlux::Buffers::ShaderProcessor::processing_function ( const std::shared_ptr< Buffer > &  buffer)
overridevirtual

The core processing function that must be implemented by derived classes.

Parameters
bufferBuffer to process

This method is where the actual transformation logic is implemented. It should contain the algorithmic details of how the buffer's data is transformed, analyzed, or processed. The implementation can utilize any backend capabilities available to the processor, including:

  • Parallel Processing: Using multi-threading or GPU compute for large datasets
  • Data Transformations: Applying mathematical operations, filters, or effects
  • Feature Extraction: Analyzing data characteristics for further processing

Derived classes must override this method to provide specific processing behavior.

Implements MayaFlux::Buffers::BufferProcessor.

Reimplemented in MayaFlux::Buffers::VolumeFieldProcessor, and MayaFlux::Buffers::VolumeSurfaceProcessor.

Definition at line 36 of file ShaderProcessor.cpp.

37{
38 auto vk_buffer = std::dynamic_pointer_cast<VKBuffer>(buffer);
39 if (!vk_buffer) {
41 "ShaderProcessor can only process VKBuffers");
42 return;
43 }
44
45 if (!m_feeds.empty()) {
46 pump_feeds();
47 }
48
51 if (is_dispatch_pending()) {
52 return;
53 }
54 }
55
58 "on_before_execute() reported failure, skipping shader execution");
59 return;
60 }
61
64 }
65
66 if (!m_initialized) {
69 initialize_pipeline(vk_buffer);
70 note_created_layout(vk_buffer);
71 m_initialized = true;
72 } else if (m_needs_pipeline_rebuild) {
74 initialize_pipeline(vk_buffer);
75 note_created_layout(vk_buffer);
77 }
78
80 initialize_descriptors(vk_buffer);
82 } else {
83 update_descriptors(vk_buffer);
84 }
85
86 execute_shader(vk_buffer);
88}
#define MF_ERROR(comp, ctx,...)
#define MF_RT_DEBUG(comp, ctx,...)
std::shared_ptr< NetworkGeometryBuffer > buffer
virtual void initialize_pipeline(const std::shared_ptr< VKBuffer > &buffer)=0
Portal::Graphics::CommandBufferID m_last_command_buffer
virtual void execute_shader(const std::shared_ptr< VKBuffer > &buffer)=0
uint64_t layout_fingerprint(const std::shared_ptr< VKBuffer > &buffer) const
virtual void on_after_execute(Portal::Graphics::CommandBufferID cmd_id, const std::shared_ptr< VKBuffer > &buffer)
Called after each process callback.
virtual void initialize_descriptors(const std::shared_ptr< VKBuffer > &buffer)=0
virtual void update_descriptors(const std::shared_ptr< VKBuffer > &buffer)
std::optional< uint64_t > m_created_layout
virtual bool on_before_execute(Portal::Graphics::CommandBufferID cmd_id, const std::shared_ptr< VKBuffer > &buffer)
Called before each process callback.
bool m_deferred_submission
False submits synchronously, preserving pre-existing behaviour.
void note_created_layout(const std::shared_ptr< VKBuffer > &buffer)
void pump_feeds(bool early=true)
Pull every feed and write its result.
bool resolve_pending_dispatch(bool block)
Resolve an outstanding asynchronous submission.
bool is_dispatch_pending() const
True while an asynchronous submission is outstanding.
std::unordered_map< std::string, Feed > m_feeds
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References buffer, MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, execute_shader(), initialize_descriptors(), initialize_pipeline(), initialize_shader(), is_dispatch_pending(), layout_fingerprint(), m_created_layout, m_deferred_submission, m_feeds, m_initialized, m_last_command_buffer, m_needs_descriptor_rebuild, m_needs_pipeline_rebuild, MF_ERROR, MF_RT_DEBUG, note_created_layout(), on_after_execute(), on_before_execute(), pump_feeds(), resolve_pending_dispatch(), and update_descriptors().

+ Here is the call graph for this function: