Shader: Fix unit tests
This commit is contained in:
@@ -39,6 +39,8 @@ namespace Nz::ShaderAst
|
|||||||
|
|
||||||
bool HasValue() const;
|
bool HasValue() const;
|
||||||
|
|
||||||
|
void Reset();
|
||||||
|
|
||||||
ExpressionValue& operator=(const ExpressionValue&) = default;
|
ExpressionValue& operator=(const ExpressionValue&) = default;
|
||||||
ExpressionValue& operator=(ExpressionValue&&) noexcept = default;
|
ExpressionValue& operator=(ExpressionValue&&) noexcept = default;
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,12 @@ namespace Nz::ShaderAst
|
|||||||
{
|
{
|
||||||
return !std::holds_alternative<std::monostate>(m_value);
|
return !std::holds_alternative<std::monostate>(m_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void ExpressionValue<T>::Reset()
|
||||||
|
{
|
||||||
|
m_value = {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Shader/DebugOff.hpp>
|
#include <Nazara/Shader/DebugOff.hpp>
|
||||||
|
|||||||
@@ -887,9 +887,11 @@ namespace Nz::ShaderAst
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (node.returnType.HasValue())
|
if (node.returnType.HasValue())
|
||||||
|
{
|
||||||
clone->returnType = ResolveType(node.returnType);
|
clone->returnType = ResolveType(node.returnType);
|
||||||
else
|
if (clone->returnType.HasValue() && IsNoType(clone->returnType.GetResultingValue()))
|
||||||
clone->returnType = ExpressionType{ NoType{} };
|
clone->returnType.Reset(); //< handle void as no return type
|
||||||
|
}
|
||||||
|
|
||||||
if (node.depthWrite.HasValue())
|
if (node.depthWrite.HasValue())
|
||||||
clone->depthWrite = ComputeExprValue(node.depthWrite);
|
clone->depthWrite = ComputeExprValue(node.depthWrite);
|
||||||
|
|||||||
Reference in New Issue
Block a user