MayaFlux 0.2.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 445 of file ShaderFoundry.cpp.

446{
447 auto it = m_shaders.find(shader_id);
448 if (it == m_shaders.end()) {
449 return {};
450 }
451
452 const auto& reflection = it->second.module->get_reflection();
453
454 ShaderReflectionInfo info;
455 info.stage = it->second.stage;
456 info.entry_point = it->second.entry_point;
457 info.workgroup_size = reflection.workgroup_size;
458
459 for (const auto& binding : reflection.bindings) {
460 info.descriptor_bindings.push_back({ .set = binding.set,
461 .binding = binding.binding,
462 .type = binding.type,
463 .name = binding.name });
464 }
465
466 for (const auto& pc : reflection.push_constants) {
467 PushConstantRangeInfo pc_info {};
468 pc_info.offset = pc.offset;
469 pc_info.size = pc.size;
470 info.push_constant_ranges.push_back(pc_info);
471 }
472
473 return info;
474}
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: