Shader: Add function parameters and return handling

This commit is contained in:
Jérôme Leclercq
2021-02-28 17:50:32 +01:00
parent 9a0f201433
commit b320b5b44e
39 changed files with 818 additions and 327 deletions

View File

@@ -142,6 +142,11 @@ namespace Nz
PushStatement(ShaderNodes::NoOp::Build());
}
void ShaderAstCloner::Visit(ShaderNodes::ReturnStatement& node)
{
PushStatement(ShaderNodes::ReturnStatement::Build(CloneExpression(node.returnExpr)));
}
void ShaderAstCloner::Visit(ShaderNodes::Sample2D& node)
{
PushExpression(ShaderNodes::Sample2D::Build(CloneExpression(node.sampler), CloneExpression(node.coordinates)));