MayaFlux 1.0.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 322 of file DataWriteProcessor.cpp.

323{
324 auto vk = std::dynamic_pointer_cast<VKBuffer>(buffer);
325 if (!vk) {
327 "DataWriteProcessor attached to non-VKBuffer");
328 return;
329 }
330
331 while (auto write = m_writes->pop()) {
332 (*write)(*this, vk);
333 }
334
335 if (m_texture_dirty.test(std::memory_order_acquire)) {
336 m_texture_dirty.clear(std::memory_order_release);
337 if (m_pending_texture) {
338 if (auto rp = vk->get_render_processor()) {
339 rp->bind_texture(m_pending_texture->binding, m_pending_texture->image);
340 }
341 m_pending_texture.reset();
342 }
343 }
344
345 if (m_pixel_dirty.test(std::memory_order_acquire)) {
346 m_pixel_dirty.clear(std::memory_order_release);
349 }
350
351 if (m_gpu_texture) {
352 if (auto rp = vk->get_render_processor()) {
354 rp->bind_texture(m_tex_binding, m_gpu_texture);
356 }
357 }
358 }
359
360 if (!m_data_dirty.test(std::memory_order_acquire)) {
361 return;
362 }
363
364 m_data_dirty.clear(std::memory_order_release);
365 std::swap(m_active, m_data_pending);
366
367 if (m_active.empty()) {
368 return;
369 }
370
372
373 for (size_t i = 1; i < m_active.size(); ++i) {
374 if (i == 1 && m_tex_width > 0 && is_vertex_modality(m_modality)) {
375 upload_texture(vk, m_active[i]);
376 } else {
378 }
379 }
380}
#define MF_RT_ERROR(comp, ctx,...)
std::shared_ptr< NetworkGeometryBuffer > buffer
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::unique_ptr< Memory::LockFreeQueue< WriteFn, k_write_queue_capacity > > m_writes
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 buffer, 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, m_writes, MF_RT_ERROR, upload_primary(), upload_secondary(), and upload_texture().

+ Here is the call graph for this function: