Renderer/ShaderAst: Add serialization
This commit is contained in:
@@ -7,8 +7,9 @@
|
||||
|
||||
namespace Nz::ShaderNodes
|
||||
{
|
||||
inline Node::Node(NodeType type) :
|
||||
m_type(type)
|
||||
inline Node::Node(NodeType type, bool isStatement) :
|
||||
m_type(type),
|
||||
m_isStatement(isStatement)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -17,6 +18,11 @@ namespace Nz::ShaderNodes
|
||||
return m_type;
|
||||
}
|
||||
|
||||
inline bool Node::IsStatement() const
|
||||
{
|
||||
return m_isStatement;
|
||||
}
|
||||
|
||||
inline unsigned int Node::GetComponentCount(ExpressionType type)
|
||||
{
|
||||
switch (type)
|
||||
@@ -55,6 +61,19 @@ namespace Nz::ShaderNodes
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline Expression::Expression(NodeType type) :
|
||||
Node(type, false)
|
||||
{
|
||||
}
|
||||
|
||||
inline Statement::Statement(NodeType type) :
|
||||
Node(type, true)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline ExpressionStatement::ExpressionStatement() :
|
||||
Statement(NodeType::ExpressionStatement)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user