Add RenderPipelineLayout
This commit is contained in:
@@ -60,6 +60,7 @@ namespace Nz
|
||||
Max = Vertex
|
||||
};
|
||||
|
||||
template<>
|
||||
struct EnumAsFlags<ShaderStageType>
|
||||
{
|
||||
static constexpr ShaderStageType max = ShaderStageType::Max;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <Nazara/Renderer/Config.hpp>
|
||||
#include <Nazara/Renderer/Enums.hpp>
|
||||
#include <Nazara/Renderer/RenderPipeline.hpp>
|
||||
#include <Nazara/Renderer/RenderPipelineLayout.hpp>
|
||||
#include <Nazara/Utility/AbstractBuffer.hpp>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
@@ -28,6 +29,7 @@ namespace Nz
|
||||
|
||||
virtual std::unique_ptr<AbstractBuffer> InstantiateBuffer(Buffer* parent, BufferType type) = 0;
|
||||
virtual std::unique_ptr<RenderPipeline> InstantiateRenderPipeline(RenderPipelineInfo pipelineInfo) = 0;
|
||||
virtual std::shared_ptr<RenderPipelineLayout> InstantiateRenderPipelineLayout(RenderPipelineLayoutInfo pipelineLayoutInfo) = 0;
|
||||
virtual std::shared_ptr<ShaderStageImpl> InstantiateShaderStage(ShaderStageType type, ShaderLanguage lang, const void* source, std::size_t sourceSize) = 0;
|
||||
std::shared_ptr<ShaderStageImpl> InstantiateShaderStage(ShaderStageType type, ShaderLanguage lang, const std::filesystem::path& sourcePath);
|
||||
};
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#define NAZARA_RENDERPIPELINE_HPP
|
||||
|
||||
#include <Nazara/Utility/Enums.hpp>
|
||||
#include <Nazara/Renderer/RenderPipelineLayout.hpp>
|
||||
#include <Nazara/Renderer/RenderStates.hpp>
|
||||
//#include <Nazara/Renderer/Shader.hpp>
|
||||
|
||||
@@ -15,7 +16,15 @@ namespace Nz
|
||||
{
|
||||
struct RenderPipelineInfo : RenderStates
|
||||
{
|
||||
/*ShaderConstRef shader;*/
|
||||
struct VertexBufferData
|
||||
{
|
||||
std::size_t binding;
|
||||
VertexDeclarationConstRef declaration;
|
||||
};
|
||||
|
||||
std::shared_ptr<RenderPipelineLayout> pipelineLayout;
|
||||
std::vector<std::shared_ptr<ShaderStageImpl>> shaderStages;
|
||||
std::vector<VertexBufferData> vertexBuffers;
|
||||
};
|
||||
|
||||
class NAZARA_RENDERER_API RenderPipeline
|
||||
|
||||
40
include/Nazara/Renderer/RenderPipelineLayout.hpp
Normal file
40
include/Nazara/Renderer/RenderPipelineLayout.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Renderer module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_RENDERPIPELINELAYOUT_HPP
|
||||
#define NAZARA_RENDERPIPELINELAYOUT_HPP
|
||||
|
||||
#include <Nazara/Renderer/Config.hpp>
|
||||
#include <Nazara/Renderer/Enums.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
struct RenderPipelineLayoutInfo
|
||||
{
|
||||
struct Binding
|
||||
{
|
||||
std::string name; //< FIXME: wtf is this?
|
||||
ShaderBindingType type;
|
||||
ShaderStageTypeFlags shaderStageFlags;
|
||||
unsigned int index;
|
||||
};
|
||||
|
||||
std::vector<Binding> bindings;
|
||||
};
|
||||
|
||||
class NAZARA_RENDERER_API RenderPipelineLayout
|
||||
{
|
||||
public:
|
||||
RenderPipelineLayout() = default;
|
||||
virtual ~RenderPipelineLayout();
|
||||
};
|
||||
}
|
||||
|
||||
#include <Nazara/Renderer/RenderPipelineLayout.inl>
|
||||
|
||||
#endif // NAZARA_RENDERPIPELINELAYOUT_HPP
|
||||
13
include/Nazara/Renderer/RenderPipelineLayout.inl
Normal file
13
include/Nazara/Renderer/RenderPipelineLayout.inl
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright (C) 2020 Jérôme Leclercq
|
||||
// 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/RenderPipelineLayout.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Renderer/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
}
|
||||
|
||||
#include <Nazara/Renderer/DebugOff.hpp>
|
||||
@@ -37,15 +37,6 @@ namespace Nz
|
||||
UInt32 writeMask = 0xFFFFFFFF;
|
||||
} stencilBack, stencilFront;
|
||||
|
||||
struct VertexBufferData
|
||||
{
|
||||
std::size_t binding;
|
||||
VertexDeclarationConstRef declaration;
|
||||
};
|
||||
|
||||
std::vector<std::shared_ptr<ShaderStageImpl>> shaderStages;
|
||||
std::vector<VertexBufferData> vertexBuffers;
|
||||
|
||||
bool blending = false;
|
||||
bool colorWrite = true;
|
||||
bool depthBuffer = false;
|
||||
|
||||
Reference in New Issue
Block a user