Shader: Improve attribute source location

This commit is contained in:
SirLynix
2022-03-28 08:52:57 +02:00
committed by Jérôme Leclercq
parent 98237acb6f
commit 8429411755
7 changed files with 158 additions and 152 deletions

View File

@@ -11,7 +11,7 @@
#include <Nazara/Shader/Config.hpp>
#include <Nazara/Shader/Ast/AstExpressionVisitor.hpp>
#include <Nazara/Shader/Ast/AstStatementVisitor.hpp>
#include <Nazara/Shader/Ast/Attribute.hpp>
#include <Nazara/Shader/Ast/ExpressionValue.hpp>
#include <vector>
namespace Nz::ShaderAst

View File

@@ -10,7 +10,7 @@
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Shader/Config.hpp>
#include <Nazara/Shader/ShaderLangSourceLocation.hpp>
#include <Nazara/Shader/Ast/Attribute.hpp>
#include <Nazara/Shader/Ast/ExpressionValue.hpp>
#include <Nazara/Shader/Ast/Module.hpp>
#include <vector>

View File

@@ -9,8 +9,8 @@
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Shader/ShaderLangSourceLocation.hpp>
#include <Nazara/Shader/Ast/Attribute.hpp>
#include <Nazara/Shader/Ast/Enums.hpp>
#include <Nazara/Shader/Ast/ExpressionValue.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <optional>
#include <string>

View File

@@ -4,13 +4,11 @@
#pragma once
#ifndef NAZARA_SHADER_AST_ATTRIBUTE_HPP
#define NAZARA_SHADER_AST_ATTRIBUTE_HPP
#ifndef NAZARA_SHADER_AST_EXPRESSIONVALUE_HPP
#define NAZARA_SHADER_AST_EXPRESSIONVALUE_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Shader/Ast/Enums.hpp>
#include <memory>
#include <optional>
#include <variant>
namespace Nz::ShaderAst
@@ -47,16 +45,8 @@ namespace Nz::ShaderAst
private:
std::variant<std::monostate, T, ExpressionPtr> m_value;
};
struct ExprValue
{
using Param = std::optional<ExpressionPtr>;
AttributeType type;
Param args;
};
}
#include <Nazara/Shader/Ast/Attribute.inl>
#include <Nazara/Shader/Ast/ExpressionValue.inl>
#endif // NAZARA_SHADER_AST_ATTRIBUTE_HPP
#endif // NAZARA_SHADER_AST_EXPRESSIONVALUE_HPP

View File

@@ -2,7 +2,7 @@
// This file is part of the "Nazara Engine - Shader module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Shader/Ast/Attribute.hpp>
#include <Nazara/Shader/Ast/ExpressionValue.hpp>
#include <cassert>
#include <stdexcept>
#include <Nazara/Shader/Debug.hpp>

View File

@@ -13,10 +13,10 @@
#include <Nazara/Math/Vector4.hpp>
#include <Nazara/Shader/Config.hpp>
#include <Nazara/Shader/ShaderLangSourceLocation.hpp>
#include <Nazara/Shader/Ast/Attribute.hpp>
#include <Nazara/Shader/Ast/ConstantValue.hpp>
#include <Nazara/Shader/Ast/Enums.hpp>
#include <Nazara/Shader/Ast/ExpressionType.hpp>
#include <Nazara/Shader/Ast/ExpressionValue.hpp>
#include <array>
#include <memory>
#include <optional>