MayaFlux 1.0.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 585 of file ShaderFoundry.cpp.

586{
587 auto it = m_shaders.find(shader_id);
588 if (it == m_shaders.end()) {
589 return {};
590 }
591
592 const auto& reflection = it->second.module->get_reflection();
593
594 ShaderReflectionInfo info;
595 info.stage = it->second.stage;
596 info.entry_point = it->second.entry_point;
597 info.workgroup_size = reflection.workgroup_size;
598
599 for (const auto& binding : reflection.bindings) {
600 info.descriptor_bindings.push_back({ .set = binding.set,
601 .binding = binding.binding,
602 .type = binding.type,
603 .name = binding.name });
604 }
605
606 for (const auto& pc : reflection.push_constants) {
607 PushConstantRangeInfo pc_info {};
608 pc_info.offset = pc.offset;
609 pc_info.size = pc.size;
610 info.push_constant_ranges.push_back(pc_info);
611 }
612
613 return info;
614}
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: