Rename a few classes
This commit is contained in:
@@ -53,17 +53,20 @@
|
||||
#include <Nazara/Renderer/RenderWindowImpl.hpp>
|
||||
#include <Nazara/Renderer/RenderWindowParameters.hpp>
|
||||
#include <Nazara/Renderer/ShaderAst.hpp>
|
||||
#include <Nazara/Renderer/ShaderAstRecursiveVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderAstSerializer.hpp>
|
||||
#include <Nazara/Renderer/ShaderAstValidator.hpp>
|
||||
#include <Nazara/Renderer/ShaderAstVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderBinding.hpp>
|
||||
#include <Nazara/Renderer/ShaderBuilder.hpp>
|
||||
#include <Nazara/Renderer/ShaderEnums.hpp>
|
||||
#include <Nazara/Renderer/ShaderExpressionType.hpp>
|
||||
#include <Nazara/Renderer/ShaderNodes.hpp>
|
||||
#include <Nazara/Renderer/ShaderSerializer.hpp>
|
||||
#include <Nazara/Renderer/ShaderStageImpl.hpp>
|
||||
#include <Nazara/Renderer/ShaderValidator.hpp>
|
||||
#include <Nazara/Renderer/ShaderVariables.hpp>
|
||||
#include <Nazara/Renderer/ShaderVarVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderWriter.hpp>
|
||||
#include <Nazara/Renderer/SpirvWriter.hpp>
|
||||
#include <Nazara/Renderer/Texture.hpp>
|
||||
#include <Nazara/Renderer/TextureSampler.hpp>
|
||||
#include <Nazara/Renderer/UploadPool.hpp>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <Nazara/Renderer/Config.hpp>
|
||||
#include <Nazara/Renderer/ShaderAst.hpp>
|
||||
#include <Nazara/Renderer/ShaderVarVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderAstVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderWriter.hpp>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_RENDERER_API GlslWriter : public ShaderWriter, public ShaderVarVisitor, public ShaderVisitor
|
||||
class NAZARA_RENDERER_API GlslWriter : public ShaderWriter, public ShaderVarVisitor, public ShaderAstVisitor
|
||||
{
|
||||
public:
|
||||
struct Environment;
|
||||
@@ -60,7 +60,7 @@ namespace Nz
|
||||
void LeaveScope();
|
||||
|
||||
using ShaderVarVisitor::Visit;
|
||||
using ShaderVisitor::Visit;
|
||||
using ShaderAstVisitor::Visit;
|
||||
void Visit(const ShaderNodes::ExpressionPtr& expr, bool encloseIfRequired = false);
|
||||
void Visit(const ShaderNodes::AccessMember& node) override;
|
||||
void Visit(const ShaderNodes::AssignOp& node) override;
|
||||
|
||||
@@ -9,17 +9,17 @@
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Renderer/Config.hpp>
|
||||
#include <Nazara/Renderer/ShaderVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderAstVisitor.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_RENDERER_API ShaderRecursiveVisitor : public ShaderVisitor
|
||||
class NAZARA_RENDERER_API ShaderAstRecursiveVisitor : public ShaderAstVisitor
|
||||
{
|
||||
public:
|
||||
ShaderRecursiveVisitor() = default;
|
||||
~ShaderRecursiveVisitor() = default;
|
||||
ShaderAstRecursiveVisitor() = default;
|
||||
~ShaderAstRecursiveVisitor() = default;
|
||||
|
||||
using ShaderVisitor::Visit;
|
||||
using ShaderAstVisitor::Visit;
|
||||
|
||||
void Visit(const ShaderNodes::AccessMember& node) override;
|
||||
void Visit(const ShaderNodes::AssignOp& node) override;
|
||||
@@ -37,6 +37,6 @@ namespace Nz
|
||||
};
|
||||
}
|
||||
|
||||
#include <Nazara/Renderer/ShaderRecursiveVisitor.inl>
|
||||
#include <Nazara/Renderer/ShaderAstRecursiveVisitor.inl>
|
||||
|
||||
#endif
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file is part of the "Nazara Engine - Renderer module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Renderer/ShaderRecursiveVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderAstRecursiveVisitor.hpp>
|
||||
#include <Nazara/Renderer/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
@@ -17,13 +17,13 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_RENDERER_API ShaderSerializerBase
|
||||
class NAZARA_RENDERER_API ShaderAstSerializerBase
|
||||
{
|
||||
public:
|
||||
ShaderSerializerBase() = default;
|
||||
ShaderSerializerBase(const ShaderSerializerBase&) = delete;
|
||||
ShaderSerializerBase(ShaderSerializerBase&&) = delete;
|
||||
~ShaderSerializerBase() = default;
|
||||
ShaderAstSerializerBase() = default;
|
||||
ShaderAstSerializerBase(const ShaderAstSerializerBase&) = delete;
|
||||
ShaderAstSerializerBase(ShaderAstSerializerBase&&) = delete;
|
||||
~ShaderAstSerializerBase() = default;
|
||||
|
||||
void Serialize(ShaderNodes::AccessMember& node);
|
||||
void Serialize(ShaderNodes::AssignOp& node);
|
||||
@@ -69,11 +69,11 @@ namespace Nz
|
||||
template<typename T> void Variable(std::shared_ptr<T>& var);
|
||||
};
|
||||
|
||||
class NAZARA_RENDERER_API ShaderSerializer final : public ShaderSerializerBase
|
||||
class NAZARA_RENDERER_API ShaderAstSerializer final : public ShaderAstSerializerBase
|
||||
{
|
||||
public:
|
||||
inline ShaderSerializer(ByteStream& stream);
|
||||
~ShaderSerializer() = default;
|
||||
inline ShaderAstSerializer(ByteStream& stream);
|
||||
~ShaderAstSerializer() = default;
|
||||
|
||||
void Serialize(const ShaderAst& shader);
|
||||
|
||||
@@ -96,11 +96,11 @@ namespace Nz
|
||||
ByteStream& m_stream;
|
||||
};
|
||||
|
||||
class NAZARA_RENDERER_API ShaderUnserializer final : public ShaderSerializerBase
|
||||
class NAZARA_RENDERER_API ShaderAstUnserializer final : public ShaderAstSerializerBase
|
||||
{
|
||||
public:
|
||||
ShaderUnserializer(ByteStream& stream);
|
||||
~ShaderUnserializer() = default;
|
||||
ShaderAstUnserializer(ByteStream& stream);
|
||||
~ShaderAstUnserializer() = default;
|
||||
|
||||
ShaderAst Unserialize();
|
||||
|
||||
@@ -126,6 +126,6 @@ namespace Nz
|
||||
NAZARA_RENDERER_API ShaderAst UnserializeShader(ByteStream& stream);
|
||||
}
|
||||
|
||||
#include <Nazara/Renderer/ShaderSerializer.inl>
|
||||
#include <Nazara/Renderer/ShaderAstSerializer.inl>
|
||||
|
||||
#endif
|
||||
@@ -2,13 +2,13 @@
|
||||
// This file is part of the "Nazara Engine - Renderer module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Renderer/ShaderSerializer.hpp>
|
||||
#include <Nazara/Renderer/ShaderAstSerializer.hpp>
|
||||
#include <Nazara/Renderer/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
template<typename T>
|
||||
void ShaderSerializerBase::Container(T& container)
|
||||
void ShaderAstSerializerBase::Container(T& container)
|
||||
{
|
||||
bool isWriting = IsWriting();
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Nz
|
||||
|
||||
|
||||
template<typename T>
|
||||
void ShaderSerializerBase::Enum(T& enumVal)
|
||||
void ShaderAstSerializerBase::Enum(T& enumVal)
|
||||
{
|
||||
bool isWriting = IsWriting();
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Nz
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void ShaderSerializerBase::OptEnum(std::optional<T>& optVal)
|
||||
void ShaderAstSerializerBase::OptEnum(std::optional<T>& optVal)
|
||||
{
|
||||
bool isWriting = IsWriting();
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Nz
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void ShaderSerializerBase::OptVal(std::optional<T>& optVal)
|
||||
void ShaderAstSerializerBase::OptVal(std::optional<T>& optVal)
|
||||
{
|
||||
bool isWriting = IsWriting();
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Nz
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void ShaderSerializerBase::Node(std::shared_ptr<T>& node)
|
||||
void ShaderAstSerializerBase::Node(std::shared_ptr<T>& node)
|
||||
{
|
||||
bool isWriting = IsWriting();
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Nz
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void ShaderSerializerBase::Variable(std::shared_ptr<T>& var)
|
||||
void ShaderAstSerializerBase::Variable(std::shared_ptr<T>& var)
|
||||
{
|
||||
bool isWriting = IsWriting();
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Nz
|
||||
var = std::static_pointer_cast<T>(value);
|
||||
}
|
||||
|
||||
inline void ShaderSerializerBase::Value(std::size_t& val)
|
||||
inline void ShaderAstSerializerBase::Value(std::size_t& val)
|
||||
{
|
||||
bool isWriting = IsWriting();
|
||||
|
||||
@@ -113,12 +113,12 @@ namespace Nz
|
||||
val = static_cast<std::size_t>(value);
|
||||
}
|
||||
|
||||
inline ShaderSerializer::ShaderSerializer(ByteStream& stream) :
|
||||
inline ShaderAstSerializer::ShaderAstSerializer(ByteStream& stream) :
|
||||
m_stream(stream)
|
||||
{
|
||||
}
|
||||
|
||||
inline ShaderUnserializer::ShaderUnserializer(ByteStream& stream) :
|
||||
inline ShaderAstUnserializer::ShaderAstUnserializer(ByteStream& stream) :
|
||||
m_stream(stream)
|
||||
{
|
||||
}
|
||||
@@ -12,18 +12,18 @@
|
||||
#include <Nazara/Core/ByteStream.hpp>
|
||||
#include <Nazara/Renderer/Config.hpp>
|
||||
#include <Nazara/Renderer/ShaderAst.hpp>
|
||||
#include <Nazara/Renderer/ShaderRecursiveVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderAstRecursiveVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderVarVisitor.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_RENDERER_API ShaderValidator : public ShaderRecursiveVisitor, public ShaderVarVisitor
|
||||
class NAZARA_RENDERER_API ShaderAstValidator : public ShaderAstRecursiveVisitor, public ShaderVarVisitor
|
||||
{
|
||||
public:
|
||||
inline ShaderValidator(const ShaderAst& shader);
|
||||
ShaderValidator(const ShaderValidator&) = delete;
|
||||
ShaderValidator(ShaderValidator&&) = delete;
|
||||
~ShaderValidator() = default;
|
||||
inline ShaderAstValidator(const ShaderAst& shader);
|
||||
ShaderAstValidator(const ShaderAstValidator&) = delete;
|
||||
ShaderAstValidator(ShaderAstValidator&&) = delete;
|
||||
~ShaderAstValidator() = default;
|
||||
|
||||
bool Validate(std::string* error = nullptr);
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Nz
|
||||
void TypeMustMatch(const ShaderNodes::ExpressionPtr& left, const ShaderNodes::ExpressionPtr& right);
|
||||
void TypeMustMatch(const ShaderExpressionType& left, const ShaderExpressionType& right);
|
||||
|
||||
using ShaderRecursiveVisitor::Visit;
|
||||
using ShaderAstRecursiveVisitor::Visit;
|
||||
void Visit(const ShaderNodes::AccessMember& node) override;
|
||||
void Visit(const ShaderNodes::AssignOp& node) override;
|
||||
void Visit(const ShaderNodes::BinaryOp& node) override;
|
||||
@@ -65,6 +65,6 @@ namespace Nz
|
||||
NAZARA_RENDERER_API bool ValidateShader(const ShaderAst& shader, std::string* error = nullptr);
|
||||
}
|
||||
|
||||
#include <Nazara/Renderer/ShaderValidator.inl>
|
||||
#include <Nazara/Renderer/ShaderAstValidator.inl>
|
||||
|
||||
#endif
|
||||
@@ -2,12 +2,12 @@
|
||||
// This file is part of the "Nazara Engine - Renderer module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Renderer/ShaderValidator.hpp>
|
||||
#include <Nazara/Renderer/ShaderAstValidator.hpp>
|
||||
#include <Nazara/Renderer/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
ShaderValidator::ShaderValidator(const ShaderAst& shader) :
|
||||
ShaderAstValidator::ShaderAstValidator(const ShaderAst& shader) :
|
||||
m_shader(shader)
|
||||
{
|
||||
}
|
||||
@@ -15,13 +15,13 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_RENDERER_API ShaderVisitor
|
||||
class NAZARA_RENDERER_API ShaderAstVisitor
|
||||
{
|
||||
public:
|
||||
ShaderVisitor() = default;
|
||||
ShaderVisitor(const ShaderVisitor&) = delete;
|
||||
ShaderVisitor(ShaderVisitor&&) = delete;
|
||||
virtual ~ShaderVisitor();
|
||||
ShaderAstVisitor() = default;
|
||||
ShaderAstVisitor(const ShaderAstVisitor&) = delete;
|
||||
ShaderAstVisitor(ShaderAstVisitor&&) = delete;
|
||||
virtual ~ShaderAstVisitor();
|
||||
|
||||
void EnableCondition(const std::string& name, bool cond);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class ShaderVisitor;
|
||||
class ShaderAstVisitor;
|
||||
|
||||
namespace ShaderNodes
|
||||
{
|
||||
@@ -37,7 +37,7 @@ namespace Nz
|
||||
inline NodeType GetType() const;
|
||||
inline bool IsStatement() const;
|
||||
|
||||
virtual void Visit(ShaderVisitor& visitor) = 0;
|
||||
virtual void Visit(ShaderAstVisitor& visitor) = 0;
|
||||
|
||||
static inline unsigned int GetComponentCount(BasicType type);
|
||||
static inline BasicType GetComponentType(BasicType type);
|
||||
@@ -77,7 +77,7 @@ namespace Nz
|
||||
{
|
||||
inline ExpressionStatement();
|
||||
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
ExpressionPtr expression;
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Nz
|
||||
{
|
||||
inline ConditionalStatement();
|
||||
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
std::string conditionName;
|
||||
StatementPtr statement;
|
||||
@@ -102,7 +102,7 @@ namespace Nz
|
||||
{
|
||||
inline StatementBlock();
|
||||
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
std::vector<StatementPtr> statements;
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace Nz
|
||||
{
|
||||
inline DeclareVariable();
|
||||
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
LocalVariablePtr variable;
|
||||
ExpressionPtr expression;
|
||||
@@ -127,7 +127,7 @@ namespace Nz
|
||||
|
||||
ExpressionCategory GetExpressionCategory() const override;
|
||||
ShaderExpressionType GetExpressionType() const override;
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
VariablePtr var;
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace Nz
|
||||
|
||||
ExpressionCategory GetExpressionCategory() const override;
|
||||
ShaderExpressionType GetExpressionType() const override;
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
std::size_t memberIndex;
|
||||
ExpressionPtr structExpr;
|
||||
@@ -156,7 +156,7 @@ namespace Nz
|
||||
inline AssignOp();
|
||||
|
||||
ShaderExpressionType GetExpressionType() const override;
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
AssignType op;
|
||||
ExpressionPtr left;
|
||||
@@ -170,7 +170,7 @@ namespace Nz
|
||||
inline BinaryOp();
|
||||
|
||||
ShaderExpressionType GetExpressionType() const override;
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
BinaryType op;
|
||||
ExpressionPtr left;
|
||||
@@ -185,7 +185,7 @@ namespace Nz
|
||||
|
||||
inline Branch();
|
||||
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
std::vector<ConditionalStatement> condStatements;
|
||||
StatementPtr elseStatement;
|
||||
@@ -204,7 +204,7 @@ namespace Nz
|
||||
inline Cast();
|
||||
|
||||
ShaderExpressionType GetExpressionType() const override;
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
BasicType exprType;
|
||||
std::array<ExpressionPtr, 4> expressions;
|
||||
@@ -218,7 +218,7 @@ namespace Nz
|
||||
inline Constant();
|
||||
|
||||
ShaderExpressionType GetExpressionType() const override;
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
using Variant = std::variant<
|
||||
bool,
|
||||
@@ -239,7 +239,7 @@ namespace Nz
|
||||
|
||||
ExpressionCategory GetExpressionCategory() const override;
|
||||
ShaderExpressionType GetExpressionType() const override;
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
std::array<SwizzleComponent, 4> components;
|
||||
std::size_t componentCount;
|
||||
@@ -255,7 +255,7 @@ namespace Nz
|
||||
inline Sample2D();
|
||||
|
||||
ShaderExpressionType GetExpressionType() const override;
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
ExpressionPtr sampler;
|
||||
ExpressionPtr coordinates;
|
||||
@@ -270,7 +270,7 @@ namespace Nz
|
||||
inline IntrinsicCall();
|
||||
|
||||
ShaderExpressionType GetExpressionType() const override;
|
||||
void Visit(ShaderVisitor& visitor) override;
|
||||
void Visit(ShaderAstVisitor& visitor) override;
|
||||
|
||||
IntrinsicType intrinsic;
|
||||
std::vector<ExpressionPtr> parameters;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <Nazara/Renderer/Config.hpp>
|
||||
#include <Nazara/Renderer/ShaderAst.hpp>
|
||||
#include <Nazara/Renderer/ShaderVarVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderAstVisitor.hpp>
|
||||
#include <Nazara/Renderer/ShaderWriter.hpp>
|
||||
#include <Nazara/Utility/FieldOffsets.hpp>
|
||||
#include <string>
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_RENDERER_API SpirvWriter : public ShaderVisitor
|
||||
class NAZARA_RENDERER_API SpirvWriter : public ShaderAstVisitor
|
||||
{
|
||||
public:
|
||||
struct Environment;
|
||||
@@ -84,7 +84,7 @@ namespace Nz
|
||||
|
||||
UInt32 RegisterType(ShaderExpressionType type);
|
||||
|
||||
using ShaderVisitor::Visit;
|
||||
using ShaderAstVisitor::Visit;
|
||||
void Visit(const ShaderNodes::AccessMember& node) override;
|
||||
void Visit(const ShaderNodes::AssignOp& node) override;
|
||||
void Visit(const ShaderNodes::Branch& node) override;
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <Nazara/Utility/Config.hpp>
|
||||
#include <Nazara/Utility/CubemapParams.hpp>
|
||||
#include <Nazara/Utility/Enums.hpp>
|
||||
#include <Nazara/Utility/FieldOffsets.hpp>
|
||||
#include <Nazara/Utility/Font.hpp>
|
||||
#include <Nazara/Utility/FontData.hpp>
|
||||
#include <Nazara/Utility/FontGlyph.hpp>
|
||||
|
||||
Reference in New Issue
Block a user