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

◆ processing_function()

void MayaFlux::Buffers::BufferUploadProcessor::processing_function ( 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.

Definition at line 23 of file BufferUploadProcessor.cpp.

24{
25 auto vk_buffer = std::dynamic_pointer_cast<VKBuffer>(buffer);
26 if (!vk_buffer) {
28 "BufferUploadProcessor requires VKBuffer");
29 return;
30 }
31
32 if (!vk_buffer->is_initialized()) {
34 "VKBuffer not initialized - register with BufferManager first");
35 return;
36 }
37
38 auto source_it = m_source_map.find(buffer);
39 if (source_it == m_source_map.end() || !source_it->second) {
41 "BufferUploadProcessor has no source configured for this buffer");
42 return;
43 }
44
45 auto source = source_it->second;
46 auto source_data = std::dynamic_pointer_cast<VKBuffer>(source)->get_data();
47 if (source_data.empty()) {
49 "Source buffer has no data to upload");
50 return;
51 }
52
53 if (vk_buffer->is_host_visible()) {
54 upload_host_visible(vk_buffer, source_data[0]);
55 } else {
56 upload_device_local(vk_buffer, source_data[0]);
57 }
58}
#define MF_RT_WARN(comp, ctx,...)
#define MF_RT_ERROR(comp, ctx,...)
std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< Buffer > > m_source_map
void upload_device_local(const std::shared_ptr< VKBuffer > &target, const Kakshya::DataVariant &data)
void upload_host_visible(const std::shared_ptr< VKBuffer > &target, const Kakshya::DataVariant &data)
Upload data to a host-visible buffer.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, m_source_map, MF_RT_ERROR, MF_RT_WARN, upload_device_local(), and MayaFlux::Buffers::upload_host_visible().

+ Here is the call graph for this function: