Shader: Handle matrix cast properly

This commit is contained in:
Jérôme Leclercq
2022-01-23 19:58:04 +01:00
parent 249aebac05
commit 64efd81bf8
7 changed files with 305 additions and 11 deletions

View File

@@ -235,6 +235,20 @@ namespace Nz::ShaderLang
return matrixType;
}
else if (identifier == "mat2")
{
Consume();
ShaderAst::MatrixType matrixType;
matrixType.columnCount = 2;
matrixType.rowCount = 2;
Expect(Advance(), TokenType::LessThan); //< '<'
matrixType.type = ParsePrimitiveType();
Expect(Advance(), TokenType::GreaterThan); //< '>'
return matrixType;
}
else if (identifier == "sampler2D")
{
Consume();