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

◆ update_pixels_if_dirty()

void MayaFlux::Buffers::TextureProcessor::update_pixels_if_dirty ( )
private

Re-upload pixels to GPU if they changed.

Definition at line 172 of file TextureProcessor.cpp.

173{
174 if (!m_texture_buffer || !m_texture_buffer->m_texture_dirty) {
175 return;
176 }
177
178 if (!m_texture_buffer->has_texture()) {
179 m_texture_buffer->m_gpu_texture = create_gpu_texture();
180 }
181
182 const auto& pixel_data = m_texture_buffer->m_pixel_data;
183 if (pixel_data.empty()) {
184 return;
185 }
186
188 loom.upload_data(
189 m_texture_buffer->get_texture(),
190 pixel_data.data(),
191 pixel_data.size());
192
193 m_texture_buffer->m_texture_dirty = false;
194
196 "TextureProcessor: pixel data updated ({} bytes)", pixel_data.size());
197}
#define MF_DEBUG(comp, ctx,...)
std::shared_ptr< Core::VKImage > create_gpu_texture()
Create VKImage for texture storage.
std::shared_ptr< TextureBuffer > m_texture_buffer
@ 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, create_gpu_texture(), MayaFlux::Portal::Graphics::get_texture_manager(), m_texture_buffer, and MF_DEBUG.

Referenced by processing_function().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: