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

◆ initialize_pipeline()

void MayaFlux::Buffers::ShaderProcessor::initialize_pipeline ( const std::shared_ptr< Buffer > &  buffer)
protectedvirtual

Reimplemented in MayaFlux::Buffers::RenderProcessor.

Definition at line 411 of file ShaderProcessor.cpp.

412{
415 "Cannot create pipeline without shader");
416 return;
417 }
418
419 auto& compute_press = Portal::Graphics::get_compute_press();
420
421 std::map<uint32_t, std::vector<std::pair<std::string, ShaderBinding>>> bindings_by_set;
422 for (const auto& [name, binding] : m_config.bindings) {
423 bindings_by_set[binding.set].emplace_back(name, binding);
424 }
425
426 std::vector<std::vector<Portal::Graphics::DescriptorBindingConfig>> descriptor_sets;
427 for (const auto& [set_index, set_bindings] : bindings_by_set) {
428 std::vector<Portal::Graphics::DescriptorBindingConfig> set_config;
429 for (const auto& [name, binding] : set_bindings) {
430 set_config.emplace_back(binding.set, binding.binding, binding.type);
431 }
432 descriptor_sets.push_back(set_config);
433 }
434
435 m_pipeline_id = compute_press.create_pipeline(
437 descriptor_sets,
439
442 "Failed to create compute pipeline");
443 return;
444 }
445
447
449 "Compute pipeline created (ID: {}, {} descriptor sets, {} bytes push constants)",
450 m_pipeline_id, descriptor_sets.size(), m_config.push_constant_size);
451}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
Portal::Graphics::ShaderID m_shader_id
Portal::Graphics::ComputePipelineID m_pipeline_id
virtual void on_pipeline_created(Portal::Graphics::ComputePipelineID pipeline_id)
Called after pipeline is created.
void set_config(const ShaderProcessorConfig &config)
Update entire configuration.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.
constexpr ShaderID INVALID_SHADER
constexpr ComputePipelineID INVALID_COMPUTE_PIPELINE
MAYAFLUX_API ComputePress & get_compute_press()

References MayaFlux::Buffers::ShaderProcessorConfig::bindings, MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Portal::Graphics::get_compute_press(), MayaFlux::Portal::Graphics::INVALID_COMPUTE_PIPELINE, MayaFlux::Portal::Graphics::INVALID_SHADER, m_config, m_pipeline_id, m_shader_id, MF_ERROR, MF_INFO, on_pipeline_created(), MayaFlux::Buffers::ShaderProcessorConfig::push_constant_size, and set_config().

Referenced by processing_function().

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