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

Method EvalFunctionReferenceClosure

Source/SpireCore/SymbolTable.cpp:49–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 return (ShaderDependenceOrder.Count() == Shaders.Count());
48 }
49 void SymbolTable::EvalFunctionReferenceClosure()
50 {
51 for (auto & func : Functions)
52 {
53 if (!func.Value->IsReferencedFunctionsTransitiveClosureEvaluated)
54 {
55 List<String> funcList;
56 EnumerableHashSet<String> funcSet;
57 for (auto & ref : func.Value->ReferencedFunctions)
58 {
59 funcList.Add(ref);
60 funcSet.Add(ref);
61 }
62 for (int i = 0; i < funcList.Count(); i++)
63 {
64 RefPtr<FunctionSymbol> funcSym;
65 if (Functions.TryGetValue(funcList[i], funcSym))
66 {
67 if (funcSym->IsReferencedFunctionsTransitiveClosureEvaluated)
68 {
69 for (auto rfunc : funcSym->ReferencedFunctions)
70 funcSet.Add(rfunc);
71 }
72 else
73 {
74 for (auto rfunc : funcSym->ReferencedFunctions)
75 {
76 if (funcSet.Add(rfunc))
77 funcList.Add(rfunc);
78 }
79 }
80 }
81 }
82 func.Value->ReferencedFunctions = _Move(funcSet);
83 func.Value->IsReferencedFunctionsTransitiveClosureEvaluated = true;
84 }
85 }
86 }
87
88 List<ImportPath>& PipelineSymbol::GetPaths(String srcWorld, String destWorld)
89 {

Callers 1

CompileMethod · 0.80

Calls 3

AddMethod · 0.45
CountMethod · 0.45
TryGetValueMethod · 0.45

Tested by

no test coverage detected