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 455 of file ShaderFoundry.cpp.

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