Files
Seele/src/Engine/Graphics/RenderPass/LightCullingPass.h
T

70 lines
2.5 KiB
C++
Raw Normal View History

2021-05-06 17:02:10 +02:00
#pragma once
2024-06-15 21:47:20 +02:00
#include "Graphics/Query.h"
2023-11-15 17:42:57 +01:00
#include "Graphics/Shader.h"
2024-06-09 12:20:04 +02:00
#include "RenderPass.h"
2021-10-01 19:55:04 +02:00
#include "Scene/Scene.h"
2021-05-06 17:02:10 +02:00
2024-06-09 12:20:04 +02:00
namespace Seele {
2021-05-06 17:02:10 +02:00
DECLARE_REF(CameraActor)
2021-05-10 23:57:55 +02:00
DECLARE_REF(Scene)
DECLARE_REF(Viewport)
2024-06-09 12:20:04 +02:00
class LightCullingPass : public RenderPass {
public:
2023-10-26 18:37:29 +02:00
LightCullingPass(Gfx::PGraphics graphics, PScene scene);
2023-11-05 10:36:01 +01:00
LightCullingPass(LightCullingPass&&) = default;
LightCullingPass& operator=(LightCullingPass&&) = default;
2021-05-06 17:02:10 +02:00
virtual ~LightCullingPass();
2025-04-11 23:13:19 +02:00
virtual void beginFrame(const Component::Camera& cam, const Component::Transform& transform) override;
2022-04-15 23:45:44 +02:00
virtual void render() override;
virtual void endFrame() override;
2021-05-06 17:02:10 +02:00
virtual void publishOutputs() override;
virtual void createRenderPass() override;
2024-06-09 12:20:04 +02:00
private:
2021-05-10 23:57:55 +02:00
void setupFrustums();
2022-02-24 22:38:26 +01:00
static constexpr uint32 BLOCK_SIZE = 32;
2021-05-10 23:57:55 +02:00
static constexpr uint32 INDEX_LIGHT_ENV = 1;
2023-11-05 10:36:01 +01:00
Gfx::OShaderBuffer frustumBuffer;
2025-03-07 21:48:27 +01:00
const char* FRUSTUMBUFFER_NAME = "frustums";
2023-11-11 13:56:12 +01:00
Gfx::ODescriptorLayout dispatchParamsLayout;
Gfx::PDescriptorSet dispatchParamsSet;
2023-11-05 10:36:01 +01:00
Gfx::OComputeShader frustumShader;
2023-11-09 22:15:51 +01:00
Gfx::PComputePipeline frustumPipeline;
2024-04-19 18:23:36 +02:00
Gfx::OPipelineLayout frustumLayout;
2025-05-06 19:36:43 +02:00
Gfx::PDescriptorSet viewParamsSet;
2024-06-09 12:20:04 +02:00
2023-11-05 10:36:01 +01:00
PLightEnvironment lightEnv;
Gfx::PTextureView depthAttachment;
2025-03-07 21:48:27 +01:00
constexpr static const char* DEPTHATTACHMENT_NAME = "depth";
2023-11-05 10:36:01 +01:00
Gfx::OShaderBuffer oLightIndexCounter;
2025-03-07 21:48:27 +01:00
constexpr static const char* OLIGHTINDEXCOUNTER_NAME = "oLightIndexCounter";
2023-11-05 10:36:01 +01:00
Gfx::OShaderBuffer tLightIndexCounter;
2025-03-07 21:48:27 +01:00
constexpr static const char* TLIGHTINDEXCOUNTER_NAME = "tLightIndexCounter";
2023-11-05 10:36:01 +01:00
Gfx::OShaderBuffer oLightIndexList;
2025-03-07 21:48:27 +01:00
constexpr static const char* OLIGHTINDEXLIST_NAME = "oLightIndexList";
2023-11-05 10:36:01 +01:00
Gfx::OShaderBuffer tLightIndexList;
2025-03-07 21:48:27 +01:00
constexpr static const char* TLIGHTINDEXLIST_NAME = "tLightIndexList";
2023-11-05 10:36:01 +01:00
Gfx::OTexture2D oLightGrid;
2025-03-07 21:48:27 +01:00
constexpr static const char* OLIGHTGRID_NAME = "oLightGrid";
2023-11-05 10:36:01 +01:00
Gfx::OTexture2D tLightGrid;
2025-03-07 21:48:27 +01:00
constexpr static const char* TLIGHTGRID_NAME = "tLightGrid";
2021-05-10 23:57:55 +02:00
Gfx::PDescriptorSet cullingDescriptorSet;
2023-11-05 10:36:01 +01:00
Gfx::ODescriptorLayout cullingDescriptorLayout;
2024-04-19 18:23:36 +02:00
Gfx::OPipelineLayout cullingLayout;
2024-05-29 10:40:35 +02:00
Gfx::OPipelineLayout cullingEnableLayout;
Gfx::OComputeShader cullingShader;
Gfx::OComputeShader cullingEnabledShader;
Gfx::PComputePipeline cullingPipeline;
Gfx::PComputePipeline cullingEnabledPipeline;
2024-06-15 21:47:20 +02:00
Gfx::OPipelineStatisticsQuery query;
2024-09-03 11:03:23 +02:00
Gfx::PTimestampQuery timestamps;
2025-03-09 22:42:05 +01:00
UVector4 numThreadGroups;
UVector4 numThreads;
2025-01-08 19:15:12 +01:00
PScene scene;
2021-05-06 17:02:10 +02:00
};
2021-05-10 23:57:55 +02:00
DEFINE_REF(LightCullingPass)
2021-05-06 17:02:10 +02:00
} // namespace Seele