MCPcopy Create free account
hub / github.com/csyonghe/Spire / GenerateShaderMetaData

Method GenerateShaderMetaData

Source/SpireCore/GLSLCodeGen.cpp:665–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663 }
664
665 virtual void GenerateShaderMetaData(ShaderMetaData & result, ILProgram* program, ILShader* shader, DiagnosticSink* err) override
666 {
667 EnumerableDictionary<ILModuleParameterInstance*, List<ILModuleParameterInstance*>> samplerTextures;
668 for (auto & w : shader->Worlds)
669 {
670 if (w.Value->Code)
671 AnalyzeSamplerUsage(samplerTextures, program, w.Value->Code.Ptr(), err);
672 }
673 if (!useVulkanBinding)
674 {
675 for (auto & shader : program->Shaders)
676 for (auto & pset : shader->ModuleParamSets)
677 for (auto & p : pset.Value->Parameters)
678 if (p.Value->Type->IsSamplerState())
679 p.Value->BindingPoints.Clear();
680 for (auto & sampler : samplerTextures)
681 {
682 sampler.Key->BindingPoints.Clear();
683 for (auto & tex : sampler.Value)
684 sampler.Key->BindingPoints.AddRange(tex->BindingPoints);
685 }
686 }
687 CLikeCodeGen::GenerateShaderMetaData(result, program, shader, err);
688 }
689
690 StageSource GenerateSingleWorldShader(ILProgram * program, ILShader * shader, ILStage * stage) override
691 {

Callers

nothing calls this directly

Calls 5

AnalyzeSamplerUsageFunction · 0.85
IsSamplerStateMethod · 0.80
AddRangeMethod · 0.80
PtrMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected