|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
Wrapper for Vulkan compute pipeline with simplified interface. More...
#include <VKComputePipeline.hpp>
Collaboration diagram for MayaFlux::Core::VKComputePipeline:Public Member Functions | |
| VKComputePipeline ()=default | |
| ~VKComputePipeline () | |
| VKComputePipeline (const VKComputePipeline &)=delete | |
| VKComputePipeline & | operator= (const VKComputePipeline &)=delete |
| VKComputePipeline (VKComputePipeline &&) noexcept | |
| VKComputePipeline & | operator= (VKComputePipeline &&) noexcept |
| bool | create (vk::Device device, const ComputePipelineConfig &config) |
| Create compute pipeline from configuration. | |
| void | cleanup (vk::Device device) |
| Cleanup pipeline resources. | |
| vk::Pipeline | get () const |
| Get raw Vulkan pipeline handle. | |
| vk::PipelineLayout | get_layout () const |
| Get pipeline layout handle. | |
| void | bind (vk::CommandBuffer cmd) const |
| Bind pipeline to command buffer. | |
| void | bind_descriptor_sets (vk::CommandBuffer cmd, const std::vector< vk::DescriptorSet > &descriptor_sets, uint32_t first_set=0, const std::vector< uint32_t > &dynamic_offsets={}) const |
| Bind descriptor sets to pipeline. | |
| void | push_constants (vk::CommandBuffer cmd, vk::ShaderStageFlags stage_flags, uint32_t offset, uint32_t size, const void *data) const |
| Update push constants. | |
| void | dispatch (vk::CommandBuffer cmd, uint32_t group_count_x, uint32_t group_count_y, uint32_t group_count_z) const |
| Dispatch compute workgroups. | |
| void | dispatch_1d (vk::CommandBuffer cmd, uint32_t element_count, uint32_t local_size_x) const |
| Dispatch compute workgroups with automatic calculation. | |
| void | dispatch_2d (vk::CommandBuffer cmd, uint32_t width_elements, uint32_t height_elements, uint32_t local_size_x, uint32_t local_size_y) const |
| Dispatch compute workgroups in 2D with automatic calculation. | |
| void | dispatch_3d (vk::CommandBuffer cmd, uint32_t width_elements, uint32_t height_elements, uint32_t depth_elements, uint32_t local_size_x, uint32_t local_size_y, uint32_t local_size_z) const |
| Dispatch compute workgroups in 3D with automatic calculation. | |
| std::optional< std::array< uint32_t, 3 > > | get_workgroup_size () const |
| Get shader workgroup size from reflection. | |
| bool | create_specialized (vk::Device device, const ComputePipelineConfig &config, const std::unordered_map< uint32_t, uint32_t > &specialization_data) |
| Create pipeline with specialization constants. | |
| template<typename T > | |
| void | push_constants_typed (vk::CommandBuffer cmd, const T &data) |
| Push constants with type safety. | |
| void | dispatch_indirect (vk::CommandBuffer cmd, vk::Buffer buffer, vk::DeviceSize offset=0) |
| Dispatch compute shader indirectly from GPU buffer. | |
| bool | is_valid () const |
| Get pipeline statistics (if available) | |
| const ShaderReflection & | get_shader_reflection () const |
| Get shader module reflection data. | |
Static Public Member Functions | |
| static std::array< uint32_t, 3 > | calculate_dispatch_1d (uint32_t element_count, uint32_t workgroup_size) |
| Calculate dispatch size from element count. | |
| static std::array< uint32_t, 3 > | calculate_dispatch_2d (uint32_t width, uint32_t height, uint32_t workgroup_x, uint32_t workgroup_y) |
| Calculate 2D dispatch size. | |
| static std::array< uint32_t, 3 > | calculate_dispatch_3d (uint32_t width, uint32_t height, uint32_t depth, uint32_t workgroup_x, uint32_t workgroup_y, uint32_t workgroup_z) |
| Calculate 3D dispatch size. | |
Private Member Functions | |
| vk::PipelineLayout | create_pipeline_layout (vk::Device device, const ComputePipelineConfig &config) |
| Create pipeline layout from configuration. | |
Static Private Member Functions | |
| static uint32_t | calculate_workgroups (uint32_t element_count, uint32_t workgroup_size) |
| Calculate number of workgroups needed. | |
Private Attributes | |
| vk::Pipeline | m_pipeline = nullptr |
| vk::PipelineLayout | m_layout = nullptr |
| std::shared_ptr< VKShaderModule > | m_shader |
| std::optional< std::array< uint32_t, 3 > > | m_workgroup_size |
Wrapper for Vulkan compute pipeline with simplified interface.
Responsibilities:
Does NOT handle:
Design:
Thread Safety:
Definition at line 85 of file VKComputePipeline.hpp.