Shader: Add proper support for alias

This commit is contained in:
Jérôme Leclercq
2022-03-09 12:35:00 +01:00
parent ce93b61c91
commit 05cf98477e
31 changed files with 472 additions and 98 deletions

View File

@@ -50,6 +50,7 @@ namespace Nz
struct UnrollAttribute;
struct UuidAttribute;
void Append(const ShaderAst::AliasType& type);
void Append(const ShaderAst::ArrayType& type);
void Append(const ShaderAst::ExpressionType& type);
void Append(const ShaderAst::ExpressionValue<ShaderAst::ExpressionType>& type);
@@ -92,6 +93,7 @@ namespace Nz
void EnterScope();
void LeaveScope(bool skipLine = true);
void RegisterAlias(std::size_t aliasIndex, std::string aliasName);
void RegisterConstant(std::size_t constantIndex, std::string constantName);
void RegisterStruct(std::size_t structIndex, std::string structName);
void RegisterVariable(std::size_t varIndex, std::string varName);
@@ -102,6 +104,7 @@ namespace Nz
void Visit(ShaderAst::AccessIdentifierExpression& node) override;
void Visit(ShaderAst::AccessIndexExpression& node) override;
void Visit(ShaderAst::AliasValueExpression& node) override;
void Visit(ShaderAst::AssignExpression& node) override;
void Visit(ShaderAst::BinaryExpression& node) override;
void Visit(ShaderAst::CastExpression& node) override;