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

◆ processing_function()

void MayaFlux::Buffers::DataWriteProcessor::processing_function ( const std::shared_ptr< Buffer > &  buffer)
overrideprotectedvirtual

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.

Definition at line 137 of file DataWriteProcessor.cpp.

138{
139 auto vk = std::dynamic_pointer_cast<VKBuffer>(buffer);
140 if (!vk) {
142 "DataWriteProcessor attached to non-VKBuffer");
143 return;
144 }
145
146 if (m_texture_dirty.test(std::memory_order_acquire)) {
147 m_texture_dirty.clear(std::memory_order_release);
148 if (m_pending_texture) {
149 if (auto rp = vk->get_render_processor()) {
150 rp->bind_texture(m_pending_texture->binding, m_pending_texture->image);
151 }
152 m_pending_texture.reset();
153 }
154 }
155
156 if (m_pixel_dirty.test(std::memory_order_acquire)) {
157 m_pixel_dirty.clear(std::memory_order_release);
160 }
161
162 if (m_gpu_texture) {
163 if (auto rp = vk->get_render_processor()) {
165 rp->bind_texture(m_tex_binding, m_gpu_texture);
167 }
168 }
169 }
170
171 if (!m_data_dirty.test(std::memory_order_acquire)) {
172 return;
173 }
174
175 m_data_dirty.clear(std::memory_order_release);
176 std::swap(m_active, m_data_pending);
177
178 if (m_active.empty()) {
179 return;
180 }
181
183
184 for (size_t i = 1; i < m_active.size(); ++i) {
185 if (i == 1 && m_tex_width > 0 && is_vertex_modality(m_modality)) {
186 upload_texture(vk, m_active[i]);
187 } else {
189 }
190 }
191}
#define MF_RT_ERROR(comp, ctx,...)
void upload_secondary(const std::shared_ptr< VKBuffer > &vk, Kakshya::DataVariant &slot)
std::vector< Kakshya::DataVariant > m_data_pending
static bool is_vertex_modality(Kakshya::DataModality m) noexcept
void upload_texture(const std::shared_ptr< VKBuffer > &vk, Kakshya::DataVariant &slot)
std::shared_ptr< Core::VKImage > m_gpu_texture
std::optional< PendingTexture > m_pending_texture
std::vector< Kakshya::DataVariant > m_active
void upload_primary(const std::shared_ptr< VKBuffer > &vk, std::vector< Kakshya::DataVariant > &slots)
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, is_vertex_modality(), m_active, m_data_dirty, m_data_pending, m_gpu_texture, m_modality, m_pending_texture, m_pixel_active, m_pixel_dirty, m_pixel_pending, m_tex_binding, m_tex_binding_confirmed, m_tex_width, m_texture_dirty, MF_RT_ERROR, upload_primary(), upload_secondary(), and upload_texture().

+ Here is the call graph for this function: