Shader/EliminateUnusedPassVisitor: Fix function call
This commit is contained in:
parent
fbae413620
commit
0fe7f6b899
|
|
@ -61,14 +61,24 @@ namespace Nz::ShaderAst
|
||||||
|
|
||||||
void Visit(CallFunctionExpression& node) override
|
void Visit(CallFunctionExpression& node) override
|
||||||
{
|
{
|
||||||
const auto& targetFuncType = GetExpressionType(node);
|
const auto& targetFuncType = GetExpressionType(*node.targetFunction);
|
||||||
assert(std::holds_alternative<FunctionType>(targetFuncType));
|
assert(std::holds_alternative<FunctionType>(targetFuncType));
|
||||||
|
|
||||||
const auto& funcType = std::get<FunctionType>(targetFuncType);
|
const auto& funcType = std::get<FunctionType>(targetFuncType);
|
||||||
|
|
||||||
assert(currentFunctionIndex);
|
assert(currentFunctionIndex);
|
||||||
UsageSet& usageSet = Retrieve(functionUsages, *currentFunctionIndex);
|
if (currentVariableDeclIndex)
|
||||||
usageSet.usedFunctions.UnboundedSet(funcType.funcIndex);
|
{
|
||||||
|
UsageSet& usageSet = Retrieve(variableUsages, *currentVariableDeclIndex);
|
||||||
|
usageSet.usedFunctions.UnboundedSet(funcType.funcIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UsageSet& usageSet = Retrieve(functionUsages, *currentFunctionIndex);
|
||||||
|
usageSet.usedFunctions.UnboundedSet(funcType.funcIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
AstRecursiveVisitor::Visit(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Visit(DeclareExternalStatement& node) override
|
void Visit(DeclareExternalStatement& node) override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue