Shader: Fix unit tests

This commit is contained in:
Jérôme Leclercq
2022-03-09 07:26:51 +01:00
parent be9bdc4705
commit 3c290c1d0e
3 changed files with 12 additions and 2 deletions

View File

@@ -887,9 +887,11 @@ namespace Nz::ShaderAst
}
if (node.returnType.HasValue())
{
clone->returnType = ResolveType(node.returnType);
else
clone->returnType = ExpressionType{ NoType{} };
if (clone->returnType.HasValue() && IsNoType(clone->returnType.GetResultingValue()))
clone->returnType.Reset(); //< handle void as no return type
}
if (node.depthWrite.HasValue())
clone->depthWrite = ComputeExprValue(node.depthWrite);