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

◆ submit_layer() [3/3]

bool MayaFlux::Buffers::TextureArrayBuffer::submit_layer ( uint32_t  layer,
std::span< const uint8_t >  pixels 
)

Replace the frame of one layer with raw pixels.

Parameters
layerLayer index.
pixelsExactly get_layer_byte_size() bytes.
Returns
True if the frame was stored.

Definition at line 67 of file TextureArrayBuffer.cpp.

68{
69 if (layer >= m_layers || pixels.size() != m_layer_bytes) {
71 "TextureArrayBuffer::submit_layer needs a layer below {} and {} bytes, got layer {} and {} bytes",
72 m_layers, m_layer_bytes, layer, pixels.size());
73 return false;
74 }
75
76 if (m_layer_mode) {
77 if (!m_layer_staging) {
79 }
81 get_texture(), layer, pixels.data(), pixels.size(), m_layer_staging);
82 }
83
85 if (storage.size() != m_layer_bytes * m_layers) {
86 storage.assign(m_layer_bytes * m_layers, 0);
87 }
88
89 std::memcpy(storage.data() + static_cast<size_t>(layer) * m_layer_bytes, pixels.data(), m_layer_bytes);
91 return true;
92}
#define MF_RT_ERROR(comp, ctx,...)
const std::vector< float > * pixels
Definition Decoder.cpp:48
SampleStorage storage
std::shared_ptr< VKBuffer > m_layer_staging
void mark_pixels_dirty()
Mark pixel data as changed Use this if you modify pixel data in-place without calling set_pixel_data(...
std::shared_ptr< Core::VKImage > get_texture() const
Get GPU texture image Suitable for binding to shaders via RenderProcessor::bind_texture()
std::vector< uint8_t > & get_pixel_data_mutable()
bool upload_layer(const std::shared_ptr< Core::VKImage > &image, uint32_t layer, const void *data, size_t size, const std::shared_ptr< Buffers::VKBuffer > &staging=nullptr, bool deferred=false)
Upload pixels into one layer of an array image.
std::shared_ptr< VKBuffer > create_image_staging_buffer(size_t size)
Allocate a persistent host-visible staging buffer sized for repeated streaming uploads to an image of...
@ 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::Buffers::create_image_staging_buffer(), MayaFlux::Buffers::TextureBuffer::get_pixel_data_mutable(), MayaFlux::Buffers::TextureBuffer::get_texture(), MayaFlux::Portal::Graphics::get_texture_manager(), m_layer_bytes, m_layer_mode, m_layer_staging, m_layers, MayaFlux::Buffers::TextureBuffer::mark_pixels_dirty(), MF_RT_ERROR, pixels, storage, and MayaFlux::Portal::Graphics::TextureLoom::upload_layer().

Referenced by submit_layer().

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