Shader: Add initial support for arrays

This commit is contained in:
Jérôme Leclercq
2022-01-01 23:01:31 +01:00
parent 89c7bbf197
commit 1f15328fdd
22 changed files with 781 additions and 57 deletions

View File

@@ -120,6 +120,18 @@ namespace Nz
m_environment = std::move(environment);
}
void LangWriter::Append(const ShaderAst::ArrayType& type)
{
Append("[", type.containedType->type, "; ");
if (type.length.IsResultingValue())
Append(type.length.GetResultingValue());
else
type.length.GetExpression()->Visit(*this);
Append("]");
}
void LangWriter::Append(const ShaderAst::ExpressionType& type)
{
std::visit([&](auto&& arg)