Shader: Add support for while loops

This commit is contained in:
Jérôme Leclercq
2021-12-16 23:10:58 +01:00
parent 07199301df
commit 0f9060c45b
22 changed files with 154 additions and 14 deletions

View File

@@ -930,6 +930,17 @@ namespace Nz
node.expression->Visit(*this);
}
void LangWriter::Visit(ShaderAst::WhileStatement& node)
{
Append("while (");
node.condition->Visit(*this);
AppendLine(")");
EnterScope();
node.body->Visit(*this);
LeaveScope();
}
void LangWriter::AppendHeader()
{
// Nothing yet