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

◆ get_shader_reflection()

ShaderReflectionInfo MayaFlux::Portal::Graphics::ShaderFoundry::get_shader_reflection ( ShaderID  shader_id)

Get reflection info for compiled shader.

Parameters
shader_idID of compiled shader
Returns
Reflection information

Extracted during compilation if enabled in config. Includes descriptor bindings, push constant ranges, workgroup size, etc.

Definition at line 539 of file ShaderFoundry.cpp.

540{
541 auto it = m_shaders.find(shader_id);
542 if (it == m_shaders.end()) {
543 return {};
544 }
545
546 const auto& reflection = it->second.module->get_reflection();
547
548 ShaderReflectionInfo info;
549 info.stage = it->second.stage;
550 info.entry_point = it->second.entry_point;
551 info.workgroup_size = reflection.workgroup_size;
552
553 for (const auto& binding : reflection.bindings) {
554 info.descriptor_bindings.push_back({ .set = binding.set,
555 .binding = binding.binding,
556 .type = binding.type,
557 .name = binding.name });
558 }
559
560 for (const auto& pc : reflection.push_constants) {
561 PushConstantRangeInfo pc_info {};
562 pc_info.offset = pc.offset;
563 pc_info.size = pc.size;
564 info.push_constant_ranges.push_back(pc_info);
565 }
566
567 return info;
568}
std::unordered_map< ShaderID, ShaderState > m_shaders

References MayaFlux::Portal::Graphics::ShaderReflectionInfo::descriptor_bindings, MayaFlux::Portal::Graphics::ShaderReflectionInfo::entry_point, m_shaders, MayaFlux::Portal::Graphics::PushConstantRangeInfo::offset, MayaFlux::Portal::Graphics::ShaderReflectionInfo::push_constant_ranges, MayaFlux::Portal::Graphics::ShaderReflectionInfo::stage, and MayaFlux::Portal::Graphics::ShaderReflectionInfo::workgroup_size.

Referenced by MayaFlux::Portal::Graphics::ComputePress::create_pipeline_auto().

+ Here is the caller graph for this function: