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

◆ claim_cpu()

void MayaFlux::Kakshya::TextureContainer::claim_cpu ( uint32_t  layer)
private

Give a GPU-held layer fresh CPU storage before a full overwrite.

Definition at line 191 of file TextureContainer.cpp.

192{
193 if (layer >= m_cpu_stale.size() || !m_cpu_stale[layer].load(std::memory_order_acquire))
194 return;
195
196 const size_t element_count = static_cast<size_t>(m_width) * m_height * m_channels;
197
198 Memory::SeqlockWriteGuard g(m_slot_locks[layer]);
199 m_data[layer] = make_empty_storage(m_format, element_count);
200 m_cpu_stale[layer].store(false, std::memory_order_release);
201}
std::vector< std::atomic< bool > > m_cpu_stale
Per layer: the GPU image in m_layer_image_cache holds the content, m_data does not.
DataVariant make_empty_storage(ImageFormat format, size_t element_count)
Allocate a zeroed DataVariant of the alternative backing a format.

References m_channels, m_cpu_stale, m_data, m_format, m_height, m_slot_locks, m_width, and MayaFlux::Kakshya::make_empty_storage().

Referenced by set_pixels(), set_pixels(), and set_pixels().

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