MayaFlux 0.3.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 456 of file ShaderFoundry.cpp.

457{
458 auto it = m_shaders.find(shader_id);
459 if (it == m_shaders.end()) {
460 return {};
461 }
462
463 const auto& reflection = it->second.module->get_reflection();
464
465 ShaderReflectionInfo info;
466 info.stage = it->second.stage;
467 info.entry_point = it->second.entry_point;
468 info.workgroup_size = reflection.workgroup_size;
469
470 for (const auto& binding : reflection.bindings) {
471 info.descriptor_bindings.push_back({ .set = binding.set,
472 .binding = binding.binding,
473 .type = binding.type,
474 .name = binding.name });
475 }
476
477 for (const auto& pc : reflection.push_constants) {
478 PushConstantRangeInfo pc_info {};
479 pc_info.offset = pc.offset;
480 pc_info.size = pc.size;
481 info.push_constant_ranges.push_back(pc_info);
482 }
483
484 return info;
485}
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: