Upload m_data[frame_index] reusing a caller-supplied staging buffer.
291{
292 if (frame_index >=
m_data.size()) {
294 "WindowContainer::image_at(staging, {}) : out of range (capacity={})",
296 return nullptr;
297 }
298
300 const uint32_t head =
m_write_head.load(std::memory_order_acquire);
302 if (!ring_full && frame_index >= head) {
304 "WindowContainer::image_at(staging, {}) : frame index is ahead of write head ({}), data may be stale or uninitialized",
305 frame_index, head);
306 return nullptr;
307 }
308
309 std::shared_ptr<Core::VKImage> img;
311 const auto*
pixels = std::get_if<std::vector<uint8_t>>(&
m_data[frame_index]);
314 "WindowContainer::image_at(staging, {}) — slot is empty", frame_index);
315 return;
316 }
317
321
322 if (!img) {
324 "WindowContainer::image_at(staging, {}) : VKImage allocation failed", frame_index);
325 return;
326 }
327 loom.upload_data(img,
pixels->data(),
pixels->size(), staging);
328 });
329 return img;
330}
#define MF_RT_WARN(comp, ctx,...)
#define MF_RT_ERROR(comp, ctx,...)
const std::vector< float > * pixels
std::shared_ptr< Core::Window > m_window
std::atomic< uint32_t > m_write_head
Memory::Seqlock m_data_lock
ContainerDataStructure m_structure
std::vector< DataVariant > m_data
std::atomic< uint64_t > m_frames_written
uint32_t m_frame_capacity
static TextureLoom & instance()
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
Core::GraphicsSurfaceInfo::SurfaceFormat query_surface_format(const std::shared_ptr< Core::Window > &window)
Query the actual vk::Format in use by the window's live swapchain, translated back to the MayaFlux su...
bool seqlock_read_void(const Seqlock &lock, uint32_t max_attempts, Fn &&fn)
Invoke a void read functor under a Seqlock with a bounded retry count.
static uint64_t get_height(const std::vector< DataDimension > &dimensions)
Extract height from image/video dimensions.
static uint64_t get_width(const std::vector< DataDimension > &dimensions)
Extract width from image/video dimensions.