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

◆ create_compute_pipeline()

std::shared_ptr< VKComputePipeline > MayaFlux::Core::BackendPipelineManager::create_compute_pipeline ( const std::shared_ptr< VKShaderModule > &  shader,
const std::vector< vk::DescriptorSetLayout > &  layouts,
uint32_t  push_constant_size 
)

Create a compute pipeline.

Parameters
shaderShader module to use for the compute pipeline
layoutsVector of descriptor set layouts used by the pipeline
push_constant_sizeSize of push constant range in bytes
Returns
Shared pointer to the created VKComputePipeline

Definition at line 85 of file BackendPipelineManager.cpp.

89{
90 auto pipeline = std::make_shared<VKComputePipeline>();
91 ComputePipelineConfig config;
92 config.shader = shader;
93 config.set_layouts = layouts;
94 if (push_constant_size > 0) {
95 config.add_push_constant(vk::ShaderStageFlagBits::eCompute, push_constant_size);
96 }
97
98 if (!pipeline->create(m_context.get_device(), config)) {
100 "Failed to create compute pipeline");
101 return nullptr;
102 }
103
104 track_compute_pipeline(pipeline);
105 return pipeline;
106}
#define MF_ERROR(comp, ctx,...)
void track_compute_pipeline(const std::shared_ptr< VKComputePipeline > &pipeline)
vk::Device get_device() const
Get logical device.
Definition VKContext.hpp:49
@ GraphicsBackend
Graphics/visual rendering backend (Vulkan, OpenGL)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Core::ComputePipelineConfig::add_push_constant(), MayaFlux::Journal::Core, MayaFlux::Core::VKContext::get_device(), MayaFlux::Journal::GraphicsBackend, m_context, MF_ERROR, MayaFlux::Core::ComputePipelineConfig::set_layouts, MayaFlux::Core::ComputePipelineConfig::shader, and track_compute_pipeline().

Referenced by setup_backend_service().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: