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

◆ gpu_buffer_handle() [2/2]

MAYAFLUX_API Portal::Graphics::GpuBufferHandle MayaFlux::Buffers::gpu_buffer_handle ( const VKBufferResources::GenerationSlot &  slot,
size_t  size_bytes 
)

View a raw back_buffers slot without reading it back.

Parameters
slotSlot, typically from VKBuffer::get_buffer_resources().back_buffers or a named state accessor such as NetworkGeometryBuffer::read_state_slot().
size_bytesByte size of the slot's contents. A slot does not carry its size, so the owning buffer's own accessor supplies it.
Returns
Non-owning handle carrying the slot's Vulkan buffer and host mapping, or an empty handle when the slot's buffer is null.

Definition at line 399 of file StagingUtils.cpp.

402{
403 if (!slot.buffer) {
404 return {};
405 }
406
407 return {
408 .buffer = slot.buffer,
409 .mapped_ptr = slot.mapped_ptr,
410 .size_bytes = size_bytes,
411 };
412}

References MayaFlux::Buffers::VKBufferResources::GenerationSlot::buffer, MayaFlux::Portal::Graphics::GpuBufferHandle::buffer, and MayaFlux::Buffers::VKBufferResources::GenerationSlot::mapped_ptr.