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

43 lines
1.3 KiB
C++
Raw Normal View History

2020-06-02 11:46:18 +02:00
#pragma once
#include "MinimalEngine.h"
2021-05-06 17:02:10 +02:00
#include "RenderPass.h"
2020-06-02 11:46:18 +02:00
namespace Seele
{
2021-04-01 16:40:14 +02:00
DECLARE_REF(CameraActor)
2023-10-24 15:01:09 +02:00
class BasePass : public RenderPass
2020-06-02 11:46:18 +02:00
{
public:
2023-10-24 15:01:09 +02:00
BasePass(Gfx::PGraphics graphics, PScene scene);
2021-05-06 17:02:10 +02:00
virtual ~BasePass();
2022-11-17 16:47:42 +01:00
virtual void beginFrame(const Component::Camera& cam) 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;
static void modifyRenderPassMacros(Map<const char*, const char*>& defines);
2020-06-02 11:46:18 +02:00
private:
2021-05-06 17:02:10 +02:00
Gfx::PRenderTargetAttachment colorAttachment;
Gfx::PTexture2D depthBuffer;
2021-09-23 10:10:39 +02:00
2021-04-01 16:40:14 +02:00
Array<Gfx::PDescriptorSet> descriptorSets;
PCameraActor source;
2020-10-03 11:00:10 +02:00
Gfx::PPipelineLayout basePassLayout;
// Set 0: Light environment
2021-05-06 17:02:10 +02:00
static constexpr uint32 INDEX_LIGHT_ENV = 0;
2023-08-28 21:23:13 +02:00
Gfx::PShaderBuffer oLightIndexList;
2021-05-10 23:57:55 +02:00
Gfx::PTexture oLightGrid;
2020-10-03 11:00:10 +02:00
Gfx::PDescriptorLayout lightLayout;
// Set 1: viewParameter
2021-05-06 17:02:10 +02:00
static constexpr uint32 INDEX_VIEW_PARAMS = 1;
2020-10-03 11:00:10 +02:00
Gfx::PDescriptorLayout viewLayout;
Gfx::PUniformBuffer viewParamBuffer;
// Set 2: materials, generated
2021-05-06 17:02:10 +02:00
static constexpr uint32 INDEX_MATERIAL = 2;
2020-10-03 11:00:10 +02:00
// Set 3: primitive scene data
2021-05-06 17:02:10 +02:00
static constexpr uint32 INDEX_SCENE_DATA = 3;
2023-10-24 15:01:09 +02:00
Gfx::PDescriptorLayout sceneLayout;
2020-06-02 11:46:18 +02:00
};
2021-04-01 16:40:14 +02:00
DEFINE_REF(BasePass)
2020-06-02 11:46:18 +02:00
} // namespace Seele