Update ShaderNode

This commit is contained in:
Jérôme Leclercq
2021-04-14 18:00:06 +02:00
parent 4bca87b1cb
commit a90937eb4f
52 changed files with 439 additions and 441 deletions

View File

@@ -172,12 +172,12 @@ namespace Nz::ShaderBuilder
return intrinsicExpression;
}
inline std::unique_ptr<ShaderAst::ReturnStatement> Impl::Return::operator()(ShaderAst::ExpressionPtr expr) const
inline std::unique_ptr<ShaderAst::MultiStatement> Impl::Multi::operator()(std::vector<ShaderAst::StatementPtr> statements) const
{
auto returnNode = std::make_unique<ShaderAst::ReturnStatement>();
returnNode->returnExpr = std::move(expr);
auto multiStatement = std::make_unique<ShaderAst::MultiStatement>();
multiStatement->statements = std::move(statements);
return returnNode;
return multiStatement;
}
template<typename T>
@@ -186,6 +186,14 @@ namespace Nz::ShaderBuilder
return std::make_unique<T>();
}
inline std::unique_ptr<ShaderAst::ReturnStatement> Impl::Return::operator()(ShaderAst::ExpressionPtr expr) const
{
auto returnNode = std::make_unique<ShaderAst::ReturnStatement>();
returnNode->returnExpr = std::move(expr);
return returnNode;
}
inline std::unique_ptr<ShaderAst::SwizzleExpression> Impl::Swizzle::operator()(ShaderAst::ExpressionPtr expression, std::vector<ShaderAst::SwizzleComponent> swizzleComponents) const
{
auto swizzleNode = std::make_unique<ShaderAst::SwizzleExpression>();