Fixing depth mip generation

This commit is contained in:
Dynamitos
2024-06-17 16:21:41 +02:00
parent 0fd331b3b5
commit 7cdbb19331
5 changed files with 221 additions and 43 deletions
@@ -1,6 +1,7 @@
#pragma once
#include "MinimalEngine.h"
#include "RenderPass.h"
#include "Graphics/Pipeline.h"
#include "Graphics/Query.h"
namespace Seele {
@@ -17,13 +18,28 @@ class DepthCullingPass : public RenderPass {
virtual void createRenderPass() override;
private:
Gfx::OTexture2D depthMipTexture;
constexpr static uint64 BLOCK_SIZE = 32;
struct MipParam {
uint32 srcMipOffset;
uint32 dstMipOffset;
UVector2 srcMipDim;
UVector2 dstMipDim;
};
Array<uint32> mipOffsets;
Array<UVector2> mipDims;
Gfx::OShaderBuffer depthMipBuffer;
Gfx::RenderTargetAttachment depthAttachment;
Gfx::RenderTargetAttachment visibilityAttachment;
Gfx::ODescriptorLayout depthTextureLayout;
Gfx::OPipelineLayout depthPrepassLayout;
Gfx::ODescriptorLayout depthAttachmentLayout;
Gfx::OPipelineLayout depthCullingLayout;
Gfx::OPipelineStatisticsQuery query;
Gfx::OPipelineLayout depthComputeLayout;
Gfx::OComputeShader depthInitialReduceShader;
Gfx::PComputePipeline depthInitialReduce;
Gfx::OComputeShader depthMipGenShader;
Gfx::PComputePipeline depthMipGen;
Gfx::PShaderBuffer cullingBuffer;
};
DEFINE_REF(DepthCullingPass)