Renderer: Rename enums

ExpressionType => BasicType
ShaderAst::Type => ShaderExpressionType
This commit is contained in:
Jérôme Leclercq
2020-07-16 18:34:58 +02:00
parent c7a8091e68
commit 1d2fb88198
26 changed files with 210 additions and 184 deletions

View File

@@ -8,11 +8,10 @@
#define NAZARA_SHADER_AST_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Renderer/ShaderExpressionType.hpp>
#include <Nazara/Renderer/ShaderNodes.hpp>
#include <optional>
#include <string>
#include <unordered_map>
#include <variant>
#include <vector>
namespace Nz
@@ -28,16 +27,14 @@ namespace Nz
struct Uniform;
struct VariableBase;
using Type = std::variant<ShaderNodes::ExpressionType, std::string>;
ShaderAst() = default;
~ShaderAst() = default;
void AddFunction(std::string name, ShaderNodes::StatementPtr statement, std::vector<FunctionParameter> parameters = {}, ShaderNodes::ExpressionType returnType = ShaderNodes::ExpressionType::Void);
void AddInput(std::string name, Type type, std::optional<std::size_t> locationIndex);
void AddOutput(std::string name, Type type, std::optional<std::size_t> locationIndex);
void AddFunction(std::string name, ShaderNodes::StatementPtr statement, std::vector<FunctionParameter> parameters = {}, ShaderNodes::BasicType returnType = ShaderNodes::BasicType::Void);
void AddInput(std::string name, ShaderExpressionType type, std::optional<std::size_t> locationIndex);
void AddOutput(std::string name, ShaderExpressionType type, std::optional<std::size_t> locationIndex);
void AddStruct(std::string name, std::vector<StructMember> members);
void AddUniform(std::string name, Type type, std::optional<std::size_t> bindingIndex, std::optional<ShaderNodes::MemoryLayout> memoryLayout);
void AddUniform(std::string name, ShaderExpressionType type, std::optional<std::size_t> bindingIndex, std::optional<ShaderNodes::MemoryLayout> memoryLayout);
inline const Function& GetFunction(std::size_t i) const;
inline std::size_t GetFunctionCount() const;
@@ -58,7 +55,7 @@ namespace Nz
struct VariableBase
{
std::string name;
Type type;
ShaderExpressionType type;
};
struct FunctionParameter : VariableBase
@@ -69,7 +66,7 @@ namespace Nz
{
std::string name;
std::vector<FunctionParameter> parameters;
ShaderNodes::ExpressionType returnType;
ShaderNodes::BasicType returnType;
ShaderNodes::StatementPtr statement;
};
@@ -93,7 +90,7 @@ namespace Nz
struct StructMember
{
std::string name;
Type type;
ShaderExpressionType type;
};
private: