Reworking VertexData

This commit is contained in:
Dynamitos
2023-10-24 15:01:09 +02:00
parent a47f17481b
commit 28e5c9ff01
61 changed files with 1157 additions and 1144 deletions
+9 -35
View File
@@ -1,40 +1,14 @@
#pragma once
#include "MinimalEngine.h"
#include "MeshProcessor.h"
#include "RenderPass.h"
namespace Seele
{
class DepthPrepassMeshProcessor : public MeshProcessor
class DepthPrepass : public RenderPass
{
public:
DepthPrepassMeshProcessor(Gfx::PGraphics graphics);
virtual ~DepthPrepassMeshProcessor();
virtual void processMeshBatch(
const MeshBatch& batch,
Gfx::PViewport target,
Gfx::PRenderPass renderPass,
Gfx::PPipelineLayout pipelineLayout,
Gfx::PDescriptorLayout primitiveLayout,
Array<Gfx::PDescriptorSet> descriptorSets,
int32 staticMeshId = -1) override;
private:
};
DEFINE_REF(DepthPrepassMeshProcessor)
struct DepthPrepassData
{
Array<MeshBatch> staticDrawList;
Gfx::PShaderBuffer sceneDataBuffer;
};
class DepthPrepass : public RenderPass<DepthPrepassData>
{
public:
DepthPrepass(Gfx::PGraphics graphics);
DepthPrepass(DepthPrepass&& other) = default;
DepthPrepass(Gfx::PGraphics graphics, PScene scene);
~DepthPrepass();
DepthPrepass& operator=(DepthPrepass& other) = default;
virtual void beginFrame(const Component::Camera& cam) override;
virtual void render() override;
virtual void endFrame() override;
@@ -44,9 +18,9 @@ public:
private:
Gfx::PRenderTargetAttachment depthAttachment;
Gfx::PTexture2D depthBuffer;
UPDepthPrepassMeshProcessor processor;
Array<Gfx::PDescriptorSet> descriptorSets;
Gfx::PPipelineLayout depthPrepassLayout;
// Set 0: viewParameter
static constexpr uint32 INDEX_VIEW_PARAMS = 0;
@@ -54,11 +28,11 @@ private:
Gfx::PUniformBuffer viewParamBuffer;
// Set 1: materials, generated
static constexpr uint32 INDEX_MATERIAL = 1;
// Set 2: primitive scene data
static constexpr uint32 INDEX_SCENE_DATA = 2;
Gfx::PDescriptorLayout primitiveLayout;
Gfx::PUniformBuffer primitiveUniformBuffer;
friend class DepthPrepassMeshProcessor;
// Set 2: vertices, from VertexData
static constexpr uint32 INDEX_VERTEX_DATA = 2;
// Set 3: mesh data, either index buffer or meshlet data
static constexpr uint32 INDEX_SCENE_DATA = 3;
Gfx::PDescriptorLayout sceneDataLayout;
};
DEFINE_REF(DepthPrepass)
} // namespace Seele