Merge branch 'master' into nzsl-modules
This commit is contained in:
@@ -27,10 +27,10 @@ namespace Nz
|
||||
|
||||
|
||||
template<typename, typename = void>
|
||||
struct GetEnumAutoFlag : std::integral_constant<bool, true> {};
|
||||
struct GetEnumAutoFlag : std::bool_constant<true> {};
|
||||
|
||||
template<typename T>
|
||||
struct GetEnumAutoFlag<T, std::void_t<decltype(T::AutoFlag)>> : std::integral_constant<bool, T::AutoFlag> {};
|
||||
struct GetEnumAutoFlag<T, std::void_t<decltype(T::AutoFlag)>> : std::bool_constant<T::AutoFlag> {};
|
||||
|
||||
template<typename E>
|
||||
class Flags
|
||||
|
||||
@@ -36,14 +36,17 @@
|
||||
#include <Nazara/Graphics/Camera.hpp>
|
||||
#include <Nazara/Graphics/Config.hpp>
|
||||
#include <Nazara/Graphics/DepthMaterial.hpp>
|
||||
#include <Nazara/Graphics/DepthPipelinePass.hpp>
|
||||
#include <Nazara/Graphics/DirectionalLight.hpp>
|
||||
#include <Nazara/Graphics/ElementRenderer.hpp>
|
||||
#include <Nazara/Graphics/Enums.hpp>
|
||||
#include <Nazara/Graphics/ForwardFramePipeline.hpp>
|
||||
#include <Nazara/Graphics/ForwardPipelinePass.hpp>
|
||||
#include <Nazara/Graphics/FrameGraph.hpp>
|
||||
#include <Nazara/Graphics/FramePass.hpp>
|
||||
#include <Nazara/Graphics/FramePassAttachment.hpp>
|
||||
#include <Nazara/Graphics/FramePipeline.hpp>
|
||||
#include <Nazara/Graphics/FramePipelinePass.hpp>
|
||||
#include <Nazara/Graphics/GraphicalMesh.hpp>
|
||||
#include <Nazara/Graphics/Graphics.hpp>
|
||||
#include <Nazara/Graphics/GuillotineTextureAtlas.hpp>
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class BakedFrameGraph;
|
||||
class CommandBufferBuilder;
|
||||
class FrameGraph;
|
||||
class RenderFrame;
|
||||
|
||||
enum class FramePassExecution
|
||||
{
|
||||
@@ -29,10 +31,17 @@ namespace Nz
|
||||
UpdateAndExecute
|
||||
};
|
||||
|
||||
struct FramePassEnvironment
|
||||
{
|
||||
BakedFrameGraph& frameGraph;
|
||||
Recti renderRect;
|
||||
RenderFrame& renderFrame;
|
||||
};
|
||||
|
||||
class NAZARA_GRAPHICS_API FramePass
|
||||
{
|
||||
public:
|
||||
using CommandCallback = std::function<void(CommandBufferBuilder& builder, const Recti& renderRect)>;
|
||||
using CommandCallback = std::function<void(CommandBufferBuilder& builder, const FramePassEnvironment& env)>;
|
||||
using ExecutionCallback = std::function<FramePassExecution()>;
|
||||
struct DepthStencilClear;
|
||||
struct Input;
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace Nz
|
||||
case PixelFormat::BGRA8: return GLTextureFormat{ GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, GL_BLUE, GL_GREEN, GL_RED, GL_ALPHA };
|
||||
case PixelFormat::BGRA8_SRGB: return GLTextureFormat{ GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, GL_BLUE, GL_GREEN, GL_RED, GL_ALPHA };
|
||||
case PixelFormat::Depth16: return GLTextureFormat{ GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_RED, GL_ZERO, GL_ZERO, GL_ZERO };
|
||||
case PixelFormat::Depth24: return GLTextureFormat{ GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_RED, GL_ZERO, GL_ZERO, GL_ZERO };
|
||||
case PixelFormat::Depth24Stencil8: return GLTextureFormat{ GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_RED, GL_GREEN, GL_ZERO, GL_ZERO };
|
||||
case PixelFormat::Depth32F: return GLTextureFormat{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, GL_RED, GL_ZERO, GL_ZERO, GL_ZERO };
|
||||
case PixelFormat::Depth32FStencil8: return GLTextureFormat{ GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, GL_RED, GL_GREEN, GL_ZERO, GL_ZERO };
|
||||
|
||||
@@ -17,16 +17,23 @@ namespace Nz::ShaderAst
|
||||
class NAZARA_SHADER_API EliminateUnusedPassVisitor : AstCloner
|
||||
{
|
||||
public:
|
||||
struct Config;
|
||||
|
||||
EliminateUnusedPassVisitor() = default;
|
||||
EliminateUnusedPassVisitor(const EliminateUnusedPassVisitor&) = delete;
|
||||
EliminateUnusedPassVisitor(EliminateUnusedPassVisitor&&) = delete;
|
||||
~EliminateUnusedPassVisitor() = default;
|
||||
|
||||
StatementPtr Process(Statement& statement);
|
||||
StatementPtr Process(Statement& statement, const Config& config = {});
|
||||
|
||||
EliminateUnusedPassVisitor& operator=(const EliminateUnusedPassVisitor&) = delete;
|
||||
EliminateUnusedPassVisitor& operator=(EliminateUnusedPassVisitor&&) = delete;
|
||||
|
||||
struct Config
|
||||
{
|
||||
ShaderStageTypeFlags usedShaderStages = ShaderStageType_All;
|
||||
};
|
||||
|
||||
private:
|
||||
using AstCloner::Clone;
|
||||
StatementPtr Clone(DeclareExternalStatement& node) override;
|
||||
@@ -42,7 +49,7 @@ namespace Nz::ShaderAst
|
||||
Context* m_context;
|
||||
};
|
||||
|
||||
inline StatementPtr EliminateUnusedPass(Statement& ast);
|
||||
inline StatementPtr EliminateUnusedPass(Statement& ast, const EliminateUnusedPassVisitor::Config& config = {});
|
||||
}
|
||||
|
||||
#include <Nazara/Shader/Ast/EliminateUnusedPassVisitor.inl>
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
namespace Nz::ShaderAst
|
||||
{
|
||||
inline StatementPtr EliminateUnusedPass(Statement& ast)
|
||||
inline StatementPtr EliminateUnusedPass(Statement& ast, const EliminateUnusedPassVisitor::Config& config)
|
||||
{
|
||||
EliminateUnusedPassVisitor visitor;
|
||||
return visitor.Process(ast);
|
||||
return visitor.Process(ast, config);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -256,6 +256,7 @@ namespace Nz
|
||||
case PixelFormat::BGRA8_SRGB: return VK_FORMAT_B8G8R8A8_SRGB;
|
||||
case PixelFormat::Depth16: return VK_FORMAT_D16_UNORM;
|
||||
case PixelFormat::Depth16Stencil8: return VK_FORMAT_D16_UNORM_S8_UINT;
|
||||
case PixelFormat::Depth24: return VK_FORMAT_UNDEFINED;
|
||||
case PixelFormat::Depth24Stencil8: return VK_FORMAT_D24_UNORM_S8_UINT;
|
||||
case PixelFormat::Depth32F: return VK_FORMAT_D32_SFLOAT;
|
||||
case PixelFormat::Depth32FStencil8: return VK_FORMAT_D32_SFLOAT_S8_UINT;
|
||||
@@ -265,11 +266,15 @@ namespace Nz
|
||||
case PixelFormat::RGBA8_SRGB: return VK_FORMAT_R8G8B8A8_SRGB;
|
||||
case PixelFormat::RGBA16F: return VK_FORMAT_R16G16B16A16_SFLOAT;
|
||||
case PixelFormat::RGBA32F: return VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||
case PixelFormat::Stencil1: return VK_FORMAT_UNDEFINED;
|
||||
case PixelFormat::Stencil4: return VK_FORMAT_UNDEFINED;
|
||||
case PixelFormat::Stencil8: return VK_FORMAT_S8_UINT;
|
||||
case PixelFormat::Stencil16: return VK_FORMAT_UNDEFINED;
|
||||
default: break;
|
||||
}
|
||||
|
||||
NazaraError("Unhandled PixelFormat 0x" + NumberToString(UnderlyingCast(pixelFormat), 16));
|
||||
return {};
|
||||
return VK_FORMAT_UNDEFINED;
|
||||
}
|
||||
|
||||
VkImageAspectFlags ToVulkan(PixelFormatContent pixelFormatContent)
|
||||
|
||||
Reference in New Issue
Block a user