Shader/ShaderLang: Add support for Unary operators

This commit is contained in:
Lynix
2021-05-16 23:07:25 +02:00
parent 1f05e950e8
commit 525f24af2e
30 changed files with 566 additions and 208 deletions

View File

@@ -922,6 +922,26 @@ namespace Nz
Append(varName);
}
void GlslWriter::Visit(ShaderAst::UnaryExpression& node)
{
switch (node.op)
{
case ShaderAst::UnaryType::LogicalNot:
Append("!");
break;
case ShaderAst::UnaryType::Minus:
Append("-");
break;
case ShaderAst::UnaryType::Plus:
Append("+");
break;
}
Visit(node.expression);
}
bool GlslWriter::HasExplicitBinding(ShaderAst::StatementPtr& shader)
{
/*for (const auto& uniform : shader.GetUniforms())