Shader/AstCompare: Fix missing ConditionalStatement compare
This commit is contained in:
parent
84db6981bc
commit
acf1b30355
|
|
@ -15,12 +15,12 @@ namespace Nz::ShaderAst
|
||||||
|
|
||||||
switch (lhs.GetType())
|
switch (lhs.GetType())
|
||||||
{
|
{
|
||||||
case NodeType::None: break;
|
case NodeType::None: break;
|
||||||
|
|
||||||
#define NAZARA_SHADERAST_EXPRESSION(Node) case NodeType::Node: return Compare(static_cast<const Node&>(lhs), static_cast<const Node&>(lhs));
|
#define NAZARA_SHADERAST_EXPRESSION(Node) case NodeType::Node: return Compare(static_cast<const Node&>(lhs), static_cast<const Node&>(lhs));
|
||||||
#include <Nazara/Shader/Ast/AstNodeList.hpp>
|
#include <Nazara/Shader/Ast/AstNodeList.hpp>
|
||||||
|
|
||||||
default: throw std::runtime_error("unexpected node type");
|
default: throw std::runtime_error("unexpected node type");
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -33,12 +33,12 @@ namespace Nz::ShaderAst
|
||||||
|
|
||||||
switch (lhs.GetType())
|
switch (lhs.GetType())
|
||||||
{
|
{
|
||||||
case NodeType::None: break;
|
case NodeType::None: break;
|
||||||
|
|
||||||
#define NAZARA_SHADERAST_STATEMENT(Node) case NodeType::Node: return Compare(static_cast<const Node&>(lhs), static_cast<const Node&>(lhs));
|
#define NAZARA_SHADERAST_STATEMENT(Node) case NodeType::Node: return Compare(static_cast<const Node&>(lhs), static_cast<const Node&>(lhs));
|
||||||
#include <Nazara/Shader/Ast/AstNodeList.hpp>
|
#include <Nazara/Shader/Ast/AstNodeList.hpp>
|
||||||
|
|
||||||
default: throw std::runtime_error("unexpected node type");
|
default: throw std::runtime_error("unexpected node type");
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -358,6 +358,17 @@ namespace Nz::ShaderAst
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool Compare(const ConditionalStatement& lhs, const ConditionalStatement& rhs)
|
||||||
|
{
|
||||||
|
if (!Compare(lhs.condition, rhs.condition))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Compare(lhs.statement, rhs.statement))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool Compare(const DeclareConstStatement& lhs, const DeclareConstStatement& rhs)
|
inline bool Compare(const DeclareConstStatement& lhs, const DeclareConstStatement& rhs)
|
||||||
{
|
{
|
||||||
if (!Compare(lhs.name, rhs.name))
|
if (!Compare(lhs.name, rhs.name))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue