MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
StagingUtils.cpp File Reference
+ Include dependency graph for StagingUtils.cpp:

Go to the source code of this file.

Namespaces

namespace  MayaFlux
 Main namespace for the Maya Flux audio engine.
 
namespace  MayaFlux::Buffers
 

Functions

bool MayaFlux::Buffers::clear_gpu_buffer (const std::shared_ptr< VKBuffer > &target)
 Zero a registered GPU buffer in place (auto-detects host-visible vs device-local)
 
std::shared_ptr< VKBuffer > MayaFlux::Buffers::create_image_staging_buffer (size_t size)
 Allocate a persistent host-visible staging buffer sized for repeated streaming uploads to an image of size bytes.
 
std::shared_ptr< VKBuffer > MayaFlux::Buffers::create_staging_buffer (size_t size)
 Create staging buffer for transfers.
 
std::span< const float > MayaFlux::Buffers::download_and_normalise (const std::shared_ptr< Core::VKImage > &image, std::vector< uint8_t > &raw_staging, std::vector< float > &work, const std::shared_ptr< VKBuffer > &gpu_staging)
 Download a VKImage to CPU and return a normalised float span.
 
void MayaFlux::Buffers::download_audio_from_gpu (const std::shared_ptr< VKBuffer > &gpu_buffer, const std::shared_ptr< AudioBuffer > &audio_buffer, const std::shared_ptr< VKBuffer > &staging=nullptr)
 Download GPU buffer to AudioBuffer (expects double precision)
 
void MayaFlux::Buffers::download_back_buffer (const VKBufferResources::GenerationSlot &slot, void *data, size_t size, std::shared_ptr< VKBuffer > &staging)
 Download a raw back_buffers slot to host memory.
 
TransferHandle MayaFlux::Buffers::download_back_buffer_async (const VKBufferResources::GenerationSlot &slot, size_t size, std::shared_ptr< VKBuffer > &staging, size_t staging_offset=0)
 Record a slot-to-staging copy without waiting for completion.
 
std::optional< Kakshya::MeshData > MayaFlux::Buffers::download_compute_mesh (const std::shared_ptr< ComputeMeshBuffer > &buffer)
 Download a ComputeMeshBuffer's current live geometry to CPU.
 
void MayaFlux::Buffers::download_device_local (const std::shared_ptr< VKBuffer > &source, const std::shared_ptr< VKBuffer > &target, const std::shared_ptr< VKBuffer > &staging_buffer)
 Download data from a device-local buffer using a staging buffer.
 
void MayaFlux::Buffers::download_from_gpu (const std::shared_ptr< VKBuffer > &source, void *data, size_t size, const std::shared_ptr< VKBuffer > &staging=nullptr)
 Download from GPU buffer to raw data (auto-detects host-visible vs device-local)
 
void MayaFlux::Buffers::download_from_gpu_async (const std::shared_ptr< VKBuffer > &source, void *data, size_t size, std::shared_ptr< VKBuffer > &staging)
 Download from a device-local GPU buffer without stalling the graphics queue.
 
void MayaFlux::Buffers::download_host_visible (const std::shared_ptr< VKBuffer > &source, const std::shared_ptr< VKBuffer > &target)
 Download data from a host-visible buffer.
 
void MayaFlux::Buffers::ensure_gpu_capacity (const std::shared_ptr< VKBuffer > &target, const std::shared_ptr< VKBuffer > &staging, size_t required, float growth_factor=k_buffer_growth_factor)
 Grow a GPU buffer (and its paired staging buffer) to fit required bytes.
 
VKBufferResources::GenerationSlot MayaFlux::Buffers::generation_slot (const Portal::Graphics::GpuBufferHandle &handle)
 Express a buffer handle as the slot the back_buffers transfer helpers take.
 
Portal::Graphics::GpuBufferHandle MayaFlux::Buffers::gpu_buffer_handle (const std::shared_ptr< VKBuffer > &buffer)
 View a buffer's primary GPU storage without reading it back.
 
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.
 
bool MayaFlux::Buffers::is_device_local (const std::shared_ptr< VKBuffer > &buffer)
 Check if buffer is device-local (staging needed)
 
bool MayaFlux::Buffers::is_transfer_source (const std::shared_ptr< VKBuffer > &buffer)
 Whether a buffer's memory can be the source of a transfer.
 
void MayaFlux::Buffers::resolve_back_buffer_read (TransferHandle &handle, const VKBufferResources::GenerationSlot &slot, void *data, size_t size, std::shared_ptr< VKBuffer > &staging, size_t staging_offset=0)
 Wait for a recorded download, then copy it out of staging.
 
void MayaFlux::Buffers::resolve_transfer (TransferHandle &handle)
 Wait for a transfer and release its resources.
 
std::optional< Kakshya::VertexLayout > MayaFlux::Buffers::resolve_vertex_layout (const std::shared_ptr< VKBuffer > &source)
 Resolve the vertex extent of a buffer's primary storage for reading.
 
std::optional< Kakshya::MeshData > MayaFlux::Buffers::triangle_soup_mesh (std::span< const uint8_t > vertex_bytes)
 Wrap non-indexed triangle vertices as MeshData.
 
void MayaFlux::Buffers::upload_audio_to_gpu (const std::shared_ptr< AudioBuffer > &audio_buffer, const std::shared_ptr< VKBuffer > &gpu_buffer, const std::shared_ptr< VKBuffer > &staging=nullptr)
 Upload AudioBuffer to GPU (always double precision)
 
void MayaFlux::Buffers::upload_back_buffer (const VKBufferResources::GenerationSlot &slot, const void *data, size_t size, std::shared_ptr< VKBuffer > &staging)
 Upload host memory into a raw back_buffers slot.
 
TransferHandle MayaFlux::Buffers::upload_back_buffer_async (const VKBufferResources::GenerationSlot &slot, const void *data, size_t size, std::shared_ptr< VKBuffer > &staging)
 Upload to a back_buffers slot without waiting for completion.
 
void MayaFlux::Buffers::upload_device_local (const std::shared_ptr< VKBuffer > &target, const std::shared_ptr< VKBuffer > &staging_buffer, const Kakshya::DataVariant &data, size_t dst_offset=0)
 Upload data to a device-local buffer using a staging buffer.
 
void MayaFlux::Buffers::upload_host_visible (const std::shared_ptr< VKBuffer > &target, const Kakshya::DataVariant &data, size_t dst_offset=0)
 Upload data to a host-visible buffer.
 
void MayaFlux::Buffers::upload_intervals (const void *base, std::span< const std::pair< size_t, size_t > > intervals, const std::shared_ptr< VKBuffer > &target, std::shared_ptr< VKBuffer > &staging)
 Upload several byte ranges of one source to the same offsets in target.
 
void MayaFlux::Buffers::upload_resizing (const void *data, size_t size, const std::shared_ptr< VKBuffer > &target, const std::shared_ptr< VKBuffer > &staging, float growth_factor=1.5F)
 Upload size bytes to target, growing both buffers first if needed.
 
void MayaFlux::Buffers::upload_to_gpu (const void *data, size_t size, const std::shared_ptr< VKBuffer > &target, const std::shared_ptr< VKBuffer > &staging=nullptr, size_t dst_offset=0)
 Upload raw data to GPU buffer (auto-detects host-visible vs device-local)