|
MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
|
Encapsulates all Vulkan resource lifecycle behind Portal facades. More...
#include <GpuResourceManager.hpp>
Collaboration diagram for MayaFlux::Yantra::GpuResourceManager:Classes | |
| struct | PipelineUnit |
| struct | SharedBuffers |
Public Member Functions | |
| void | bind_descriptor (const std::string &key, size_t index, const GpuBufferBinding &spec) |
| void | bind_image_sampled (const std::string &key, size_t index, const std::shared_ptr< Core::VKImage > &image, vk::Sampler sampler, const GpuBufferBinding &spec) |
| Bind a combined image+sampler descriptor at the given slot index. | |
| void | bind_image_storage (const std::string &key, size_t index, const std::shared_ptr< Core::VKImage > &image, const GpuBufferBinding &spec) |
| Bind a storage image descriptor at the given slot index. | |
| void | bind_shared_descriptor (const std::string &key, uint32_t set, size_t binding_index, const GpuBufferBinding &spec) |
| size_t | buffer_allocated_bytes (const std::string &key, size_t index) const |
| void | cleanup () |
| Destroy every key currently held. | |
| void | dispatch (const std::string &key, const std::array< uint32_t, 3 > &groups, const std::vector< GpuBufferBinding > &bindings, const uint8_t *push_constant_data, size_t push_constant_size) |
| Portal::Graphics::FenceID | dispatch_async (const std::string &key, const std::array< uint32_t, 3 > &groups, const std::vector< GpuBufferBinding > &bindings, const uint8_t *push_constant_data, size_t push_constant_size) |
| Submit a compute dispatch without blocking. | |
| void | dispatch_batched (const std::string &key, const std::array< uint32_t, 3 > &groups, const std::vector< GpuBufferBinding > &bindings, size_t push_constant_size, const ExecutionContext &ctx) |
| void | dispatch_batched_indirect (const std::string &key, uint32_t indirect_set, size_t indirect_binding, const std::array< uint32_t, 3 > &groups, const std::vector< GpuBufferBinding > &bindings, size_t push_constant_size, const ExecutionContext &ctx) |
| void | dispatch_sequence (const std::vector< std::string > &keys, const std::vector< std::array< uint32_t, 3 > > &groups_per_key, const std::vector< std::vector< uint8_t > > &push_constants_per_key, const std::vector< std::vector< Portal::Graphics::HazardResource > > &hazards_per_key) |
| Record a dispatch for each requested key into one command buffer via ComputePress::record_sequence, submitted once. | |
| void | download (const std::string &key, size_t index, float *dest, size_t byte_size) |
| void | download_shared (uint32_t set, size_t binding_index, void *dest, size_t byte_size) |
| void | ensure_buffer (const std::string &key, size_t index, size_t required_bytes, Portal::Graphics::BufferUsageHint usage_hint=Portal::Graphics::BufferUsageHint::COMPUTE_STORAGE) |
| void | ensure_shared_buffer (uint32_t set, size_t binding_index, size_t element_count, GpuBufferBinding::ElementType element_type, Portal::Graphics::BufferUsageHint usage_hint=Portal::Graphics::BufferUsageHint::COMPUTE_STORAGE) |
| GpuResourceManager () | |
| GpuResourceManager (const GpuResourceManager &)=delete | |
| GpuResourceManager (GpuResourceManager &&)=delete | |
| bool | initialise (const std::string &key, const GpuComputeConfig &config, const std::vector< GpuBufferBinding > &bindings) |
| Create (or confirm existing) pipeline for the given key. | |
| bool | is_ready (const std::string &key) const |
| Portal::Graphics::HazardResource | make_shared_buffer_hazard (const GpuBufferBinding &spec) const |
| GpuResourceManager & | operator= (const GpuResourceManager &)=delete |
| GpuResourceManager & | operator= (GpuResourceManager &&)=delete |
| void | release (const std::string &key) |
| Destroy the pipeline, shader, descriptor sets, and buffers for a single key, without affecting any other key. | |
| void | transition_image (const std::shared_ptr< Core::VKImage > &image, vk::ImageLayout old_layout, vk::ImageLayout new_layout) |
| Transition a VKImage layout via an immediate command submission. | |
| void | upload (const std::string &key, size_t index, const float *data, size_t byte_size) |
| void | upload_raw (const std::string &key, size_t index, const uint8_t *data, size_t byte_size) |
| void | upload_shared_raw (uint32_t set, size_t binding_index, const uint8_t *data, size_t byte_size) |
| ~GpuResourceManager () | |
Private Member Functions | |
| const PipelineUnit * | find_unit (const std::string &key) const |
| PipelineUnit & | unit_for (const std::string &key) |
Private Attributes | |
| std::unique_ptr< SharedBuffers > | m_shared |
| std::unordered_map< std::string, std::unique_ptr< PipelineUnit > > | m_units |
Encapsulates all Vulkan resource lifecycle behind Portal facades.
Manages a keyed set of pipelines, each with its own storage buffers, pipeline, shader, and descriptor sets. There is no distinct single- pipeline mode: a caller using exactly one shader simply uses one key throughout. PIMPL hides vk:: types from the header entirely.
Definition at line 22 of file GpuResourceManager.hpp.