Move FieldOffsets class to Shader module and remove Utility dependency
This commit is contained in:
parent
998bcde2e2
commit
68d2dfcae6
|
|
@ -2,7 +2,7 @@
|
|||
#include <Nazara/OpenGLRenderer.hpp>
|
||||
#include <Nazara/OpenGLRenderer/Wrapper.hpp>
|
||||
#include <Nazara/Renderer.hpp>
|
||||
#include <Nazara/Utility/FieldOffsets.hpp>
|
||||
#include <Nazara/Shader/FieldOffsets.hpp>
|
||||
#include <iostream>
|
||||
#include <numeric>
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,20 @@ namespace Nz
|
|||
|
||||
constexpr std::size_t ErrorTypeCount = static_cast<std::size_t>(ErrorType::Max) + 1;
|
||||
|
||||
enum class ImageType
|
||||
{
|
||||
E1D,
|
||||
E1D_Array,
|
||||
E2D,
|
||||
E2D_Array,
|
||||
E3D,
|
||||
Cubemap,
|
||||
|
||||
Max = Cubemap
|
||||
};
|
||||
|
||||
constexpr std::size_t ImageTypeCount = static_cast<std::size_t>(ImageType::Max) + 1;
|
||||
|
||||
enum class HashType
|
||||
{
|
||||
CRC32,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/OpenGLRenderer/Wrapper/Context.hpp>
|
||||
#include <Nazara/Renderer/Enums.hpp>
|
||||
#include <Nazara/Shader/Enums.hpp>
|
||||
#include <Nazara/Utility/Enums.hpp>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include <Nazara/Core/MovablePtr.hpp>
|
||||
#include <Nazara/Renderer/Enums.hpp>
|
||||
#include <Nazara/Renderer/ShaderBinding.hpp>
|
||||
#include <Nazara/Utility/Enums.hpp>
|
||||
#include <Nazara/Shader/Enums.hpp>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@
|
|||
#define NAZARA_GLOBAL_SHADER_HPP
|
||||
|
||||
#include <Nazara/Shader/Config.hpp>
|
||||
#include <Nazara/Shader/Enums.hpp>
|
||||
#include <Nazara/Shader/FieldOffsets.hpp>
|
||||
#include <Nazara/Shader/FilesystemModuleResolver.hpp>
|
||||
#include <Nazara/Shader/GlslWriter.hpp>
|
||||
#include <Nazara/Shader/LangWriter.hpp>
|
||||
|
|
|
|||
|
|
@ -8,10 +8,11 @@
|
|||
#define NAZARA_SHADER_AST_EXPRESSIONTYPE_HPP
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Core/Enums.hpp>
|
||||
#include <Nazara/Shader/Enums.hpp>
|
||||
#include <Nazara/Shader/ShaderLangSourceLocation.hpp>
|
||||
#include <Nazara/Shader/Ast/Enums.hpp>
|
||||
#include <Nazara/Shader/Ast/ExpressionValue.hpp>
|
||||
#include <Nazara/Utility/Enums.hpp>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
|
||||
// This file is part of the "Nazara Engine - Shader module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_SHADER_ENUMS_HPP
|
||||
#define NAZARA_SHADER_ENUMS_HPP
|
||||
|
||||
#include <Nazara/Core/Flags.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
enum class ShaderStageType
|
||||
{
|
||||
Fragment,
|
||||
Vertex,
|
||||
|
||||
Max = Vertex
|
||||
};
|
||||
|
||||
constexpr std::size_t ShaderStageTypeCount = static_cast<std::size_t>(ShaderStageType::Max) + 1;
|
||||
|
||||
template<>
|
||||
struct EnumAsFlags<ShaderStageType>
|
||||
{
|
||||
static constexpr ShaderStageType max = ShaderStageType::Max;
|
||||
};
|
||||
|
||||
using ShaderStageTypeFlags = Flags<ShaderStageType>;
|
||||
|
||||
constexpr ShaderStageTypeFlags ShaderStageType_All = ShaderStageType::Fragment | ShaderStageType::Vertex;
|
||||
|
||||
enum class StructFieldType
|
||||
{
|
||||
Bool1,
|
||||
Bool2,
|
||||
Bool3,
|
||||
Bool4,
|
||||
Float1,
|
||||
Float2,
|
||||
Float3,
|
||||
Float4,
|
||||
Double1,
|
||||
Double2,
|
||||
Double3,
|
||||
Double4,
|
||||
Int1,
|
||||
Int2,
|
||||
Int3,
|
||||
Int4,
|
||||
UInt1,
|
||||
UInt2,
|
||||
UInt3,
|
||||
UInt4,
|
||||
|
||||
Max = UInt4
|
||||
};
|
||||
|
||||
enum class StructLayout
|
||||
{
|
||||
Packed,
|
||||
Std140,
|
||||
|
||||
Max = Std140
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // NAZARA_SHADER_ENUMS_HPP
|
||||
|
|
@ -1,18 +1,20 @@
|
|||
// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
|
||||
// This file is part of the "Nazara Engine - Utility module"
|
||||
// This file is part of the "Nazara Engine - Shader module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_UTILITY_FIELDOFFSETS_HPP
|
||||
#define NAZARA_UTILITY_FIELDOFFSETS_HPP
|
||||
#ifndef NAZARA_SHADER_FIELDOFFSETS_HPP
|
||||
#define NAZARA_SHADER_FIELDOFFSETS_HPP
|
||||
|
||||
#include <Nazara/Utility/Config.hpp>
|
||||
#include <Nazara/Utility/Enums.hpp>
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Shader/Config.hpp>
|
||||
#include <Nazara/Shader/Enums.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_UTILITY_API FieldOffsets
|
||||
class NAZARA_SHADER_API FieldOffsets
|
||||
{
|
||||
public:
|
||||
inline FieldOffsets(StructLayout layout);
|
||||
|
|
@ -47,6 +49,6 @@ namespace Nz
|
|||
};
|
||||
}
|
||||
|
||||
#include <Nazara/Utility/FieldOffsets.inl>
|
||||
#include <Nazara/Shader/FieldOffsets.inl>
|
||||
|
||||
#endif // NAZARA_UTILITY_FIELDOFFSETS_HPP
|
||||
#endif // NAZARA_SHADER_FIELDOFFSETS_HPP
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
|
||||
// This file is part of the "Nazara Engine - Utility module"
|
||||
// This file is part of the "Nazara Engine - Shader module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Utility/FieldOffsets.hpp>
|
||||
#include <Nazara/Shader/FieldOffsets.hpp>
|
||||
#include <Nazara/Core/Algorithm.hpp>
|
||||
#include <cassert>
|
||||
#include <memory>
|
||||
#include <Nazara/Utility/Debug.hpp>
|
||||
#include <Nazara/Shader/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
|
|
@ -171,4 +171,4 @@ namespace Nz
|
|||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Utility/DebugOff.hpp>
|
||||
#include <Nazara/Shader/DebugOff.hpp>
|
||||
|
|
@ -39,7 +39,6 @@
|
|||
#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>
|
||||
|
|
|
|||
|
|
@ -166,20 +166,6 @@ namespace Nz
|
|||
Max = CounterClockwise
|
||||
};
|
||||
|
||||
enum class ImageType
|
||||
{
|
||||
E1D,
|
||||
E1D_Array,
|
||||
E2D,
|
||||
E2D_Array,
|
||||
E3D,
|
||||
Cubemap,
|
||||
|
||||
Max = Cubemap
|
||||
};
|
||||
|
||||
constexpr std::size_t ImageTypeCount = static_cast<std::size_t>(ImageType::Max) + 1;
|
||||
|
||||
enum class IndexType
|
||||
{
|
||||
U8,
|
||||
|
|
@ -351,60 +337,6 @@ namespace Nz
|
|||
Max = Repeat
|
||||
};
|
||||
|
||||
enum class ShaderStageType
|
||||
{
|
||||
Fragment,
|
||||
Vertex,
|
||||
|
||||
Max = Vertex
|
||||
};
|
||||
|
||||
constexpr std::size_t ShaderStageTypeCount = static_cast<std::size_t>(ShaderStageType::Max) + 1;
|
||||
|
||||
template<>
|
||||
struct EnumAsFlags<ShaderStageType>
|
||||
{
|
||||
static constexpr ShaderStageType max = ShaderStageType::Max;
|
||||
};
|
||||
|
||||
using ShaderStageTypeFlags = Flags<ShaderStageType>;
|
||||
|
||||
constexpr ShaderStageTypeFlags ShaderStageType_All = ShaderStageType::Fragment | ShaderStageType::Vertex;
|
||||
|
||||
enum class StructFieldType
|
||||
{
|
||||
Bool1,
|
||||
Bool2,
|
||||
Bool3,
|
||||
Bool4,
|
||||
Float1,
|
||||
Float2,
|
||||
Float3,
|
||||
Float4,
|
||||
Double1,
|
||||
Double2,
|
||||
Double3,
|
||||
Double4,
|
||||
Int1,
|
||||
Int2,
|
||||
Int3,
|
||||
Int4,
|
||||
UInt1,
|
||||
UInt2,
|
||||
UInt3,
|
||||
UInt4,
|
||||
|
||||
Max = UInt4
|
||||
};
|
||||
|
||||
enum class StructLayout
|
||||
{
|
||||
Packed,
|
||||
Std140,
|
||||
|
||||
Max = Std140
|
||||
};
|
||||
|
||||
enum class StencilOperation
|
||||
{
|
||||
Decrement,
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Renderer/Enums.hpp>
|
||||
#include <Nazara/Shader/Enums.hpp>
|
||||
#include <Nazara/Utility/Enums.hpp>
|
||||
#include <Nazara/VulkanRenderer/Wrapper/Loader.hpp>
|
||||
#include <optional>
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
#include <Nazara/Graphics/PredefinedShaderStructs.hpp>
|
||||
#include <Nazara/Graphics/UberShader.hpp>
|
||||
#include <Nazara/Renderer/Renderer.hpp>
|
||||
#include <Nazara/Shader/FieldOffsets.hpp>
|
||||
#include <Nazara/Shader/ShaderLangParser.hpp>
|
||||
#include <Nazara/Utility/BufferMapper.hpp>
|
||||
#include <Nazara/Utility/FieldOffsets.hpp>
|
||||
#include <Nazara/Utility/MaterialData.hpp>
|
||||
#include <cassert>
|
||||
#include <Nazara/Graphics/Debug.hpp>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Graphics/DepthMaterial.hpp>
|
||||
#include <Nazara/Shader/FieldOffsets.hpp>
|
||||
#include <Nazara/Shader/ShaderLangParser.hpp>
|
||||
#include <Nazara/Utility/FieldOffsets.hpp>
|
||||
#include <Nazara/Graphics/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
#include <Nazara/Core/ErrorFlags.hpp>
|
||||
#include <Nazara/Graphics/PredefinedShaderStructs.hpp>
|
||||
#include <Nazara/Renderer/Renderer.hpp>
|
||||
#include <Nazara/Shader/FieldOffsets.hpp>
|
||||
#include <Nazara/Shader/ShaderLangParser.hpp>
|
||||
#include <Nazara/Utility/BufferMapper.hpp>
|
||||
#include <Nazara/Utility/FieldOffsets.hpp>
|
||||
#include <Nazara/Utility/MaterialData.hpp>
|
||||
#include <cassert>
|
||||
#include <filesystem>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Graphics/PredefinedShaderStructs.hpp>
|
||||
#include <Nazara/Utility/FieldOffsets.hpp>
|
||||
#include <Nazara/Shader/FieldOffsets.hpp>
|
||||
#include <Nazara/Graphics/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
|
||||
// This file is part of the "Nazara Engine - Utility module"
|
||||
// This file is part of the "Nazara Engine - Shader module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Utility/FieldOffsets.hpp>
|
||||
#include <Nazara/Shader/FieldOffsets.hpp>
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <Nazara/Utility/Debug.hpp>
|
||||
#include <Nazara/Shader/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
#include <Nazara/Core/Bitset.hpp>
|
||||
#include <Nazara/Core/CallOnExit.hpp>
|
||||
#include <Nazara/Math/Algorithm.hpp>
|
||||
#include <Nazara/Shader/Enums.hpp>
|
||||
#include <Nazara/Shader/ShaderBuilder.hpp>
|
||||
#include <Nazara/Shader/Ast/AstCloner.hpp>
|
||||
#include <Nazara/Shader/Ast/AstConstantPropagationVisitor.hpp>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include <Nazara/Core/Algorithm.hpp>
|
||||
#include <Nazara/Core/CallOnExit.hpp>
|
||||
#include <Nazara/Math/Algorithm.hpp>
|
||||
#include <Nazara/Shader/Enums.hpp>
|
||||
#include <Nazara/Shader/ShaderBuilder.hpp>
|
||||
#include <Nazara/Shader/Ast/AstCloner.hpp>
|
||||
#include <Nazara/Shader/Ast/AstRecursiveVisitor.hpp>
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Shader/SpirvConstantCache.hpp>
|
||||
#include <Nazara/Shader/FieldOffsets.hpp>
|
||||
#include <Nazara/Shader/SpirvSection.hpp>
|
||||
#include <Nazara/Shader/Ast/Nodes.hpp>
|
||||
#include <Nazara/Utility/FieldOffsets.hpp>
|
||||
#include <tsl/ordered_map.h>
|
||||
#include <cassert>
|
||||
#include <stdexcept>
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@ local modules = {
|
|||
Deps = {"NazaraPlatform", "NazaraShader"}
|
||||
},
|
||||
Shader = {
|
||||
Deps = {"NazaraUtility"},
|
||||
Packages = {"efsw", "fmt"},
|
||||
Deps = {"NazaraCore"},
|
||||
Custom = function()
|
||||
-- Set precise floating-points models to ensure shader optimization leads to correct results
|
||||
set_fpmodels("precise")
|
||||
|
|
|
|||
Loading…
Reference in New Issue