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

◆ processing_function()

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

Process all texture uploads.

Parameters
bufferThe staging buffer (VKBuffer) this processor is attached to

Uploads all bound textures that have dirty flags set. Delegates actual upload to TextureLoom which handles staging internally.

Implements MayaFlux::Buffers::BufferProcessor.

Definition at line 88 of file NodeTextureProcessor.cpp.

89{
90 if (m_bindings.empty()) {
91 return;
92 }
93
94 auto staging_buffer = std::dynamic_pointer_cast<VKBuffer>(buffer);
95 if (!staging_buffer) {
97 "NodeTextureProcessor requires VKBuffer for staging");
98 return;
99 }
100
102
103 for (auto& [name, binding] : m_bindings) {
104 if (!binding.node->needs_gpu_update()) {
106 "Texture '{}' unchanged, skipping upload", name);
107 continue;
108 }
109
110 auto pixels = binding.node->get_pixel_buffer();
111
112 if (pixels.empty()) {
114 "Texture node '{}' has empty pixel buffer, skipping upload", name);
115 continue;
116 }
117
118 loom.upload_data(
119 binding.gpu_texture,
120 pixels.data(),
121 pixels.size_bytes());
122
123 binding.node->clear_gpu_update_flag();
124
126 "Uploaded texture '{}' ({} bytes)", name, pixels.size_bytes());
127 }
128}
#define MF_RT_WARN(comp, ctx,...)
#define MF_RT_ERROR(comp, ctx,...)
#define MF_TRACE(comp, ctx,...)
std::unordered_map< std::string, TextureBinding > m_bindings
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.
MAYAFLUX_API TextureLoom & get_texture_manager()
Get the global texture manager instance.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Portal::Graphics::get_texture_manager(), m_bindings, MF_RT_ERROR, MF_RT_WARN, and MF_TRACE.

+ Here is the call graph for this function: