122 [[nodiscard]]
bool is_initialized()
const {
return m_shader_foundry !=
nullptr; }
133 const std::vector<std::vector<DescriptorBindingInfo>>& descriptor_sets = {},
134 size_t push_constant_size = 0);
139 ComputePipelineID create_pipeline_auto(
141 size_t push_constant_size = 0);
143 void destroy_pipeline(ComputePipelineID pipeline_id);
152 void bind_pipeline(CommandBufferID cmd_id, ComputePipelineID pipeline_id);
157 void bind_descriptor_sets(
158 CommandBufferID cmd_id,
159 ComputePipelineID pipeline_id,
160 const std::vector<DescriptorSetID>& descriptor_set_ids);
166 CommandBufferID cmd_id,
167 ComputePipelineID pipeline_id,
179 CommandBufferID cmd_id,
180 ComputePipelineID pipeline_id,
192 void dispatch(CommandBufferID cmd_id, uint32_t x, uint32_t y, uint32_t z);
197 void dispatch_indirect(
198 CommandBufferID cmd_id,
199 vk::Buffer indirect_buffer,
200 vk::DeviceSize
offset = 0);
209 std::vector<DescriptorSetID> allocate_pipeline_descriptors(ComputePipelineID pipeline_id);
215 CommandBufferID cmd_id,
216 ComputePipelineID pipeline_id,
217 const std::vector<DescriptorSetID>& descriptor_set_ids,
218 const void* push_constants_data =
nullptr,
219 size_t push_constant_size = 0);
244 void record_sequence(CommandBufferID cmd_id,
const std::vector<ComputeStage>& stages);
249 void cleanup_pipelines();
256 size_t push_constant_size {};
261 std::atomic<uint64_t> m_next_pipeline_id { 1 };
ComputePress & operator=(const ComputePress &)=delete
static ComputePress & instance()
ComputePress(ComputePress &&) noexcept=delete
std::unordered_map< ComputePipelineID, PipelineState > m_pipelines
ComputePress(const ComputePress &)=delete
static bool s_initialized
std::shared_ptr< Core::VKDescriptorManager > m_descriptor_manager
Compute-specific pipeline and dispatch orchestration.
Portal-level shader compilation and caching.
uint64_t ComputePipelineID
constexpr ComputePipelineID INVALID_COMPUTE_PIPELINE
MAYAFLUX_API ComputePress & get_compute_press()
vk::PipelineLayout layout
std::vector< vk::DescriptorSetLayout > layouts
std::shared_ptr< Core::VKComputePipeline > pipeline
ComputePipelineID pipeline_id
Pipeline to bind for this stage.
std::vector< uint8_t > push_constant_data
Raw push constant bytes for this stage.
IndirectDispatch indirect
When set, the stage dispatches with counts read from this buffer and groups is ignored.
std::array< uint32_t, 3 > groups
Workgroup dispatch counts {x, y, z}.
std::vector< DescriptorSetID > descriptor_set_ids
Descriptor sets to bind.
std::vector< HazardResource > hazard_resources
Resources this stage reads or writes that a subsequent stage in the same sequence depends on.
One pipeline dispatch within a ComputePress::record_sequence call.
Declares a single storage buffer or image binding a compute shader expects.
vk::Buffer buffer
Valid when binding.element_type is anything else.
vk::Image image
Valid when binding.element_type is IMAGE_STORAGE/IMAGE_SAMPLED.
GpuBufferBinding binding
Direction/element_type describing this resource.
One resource this stage's dispatch reads/writes that a later stage in the sequence depends on,...
Optional GPU-resident source of a stage's workgroup counts.