MayaFlux 0.4.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 459 of file ShaderFoundry.cpp.

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