Grindstone Game Engine
v0.2.0
An open source game engine and toolkit.
Toggle main menu visibility
Loading...
Searching...
No Matches
BloomPass.hpp
1
#pragma once
2
3
#include <Common/Rendering/RenderGraphBuilder.hpp>
4
#include <EngineCore/Assets/AssetReference.hpp>
5
#include <EngineCore/Assets/PipelineSet/ComputePipelineAsset.hpp>
6
7
namespace
Grindstone::Renderer
{
8
class
BloomPass
{
9
public
:
10
bool
Initialize();
11
Renderer::RenderGraphBuilderResourceRef
AddBloomChain(
12
uint32_t imageIndex,
13
Grindstone::Math::Uint2 size,
14
Grindstone::Renderer::RenderGraphBuilder
& renderGraphBuilder,
15
Renderer::RenderGraphBuilderResourceRef
input
16
);
17
18
static
const
size_t
BLOOM_MIPS = 4u;
19
static
const
size_t
BLOOM_STAGE_COUNT = BLOOM_MIPS * 2u;
20
21
struct
ImageSet
{
22
std::array<Grindstone::GraphicsAPI::DescriptorSet*, BLOOM_STAGE_COUNT> descriptorSets{};
23
std::array<Grindstone::GraphicsAPI::Buffer*, BLOOM_STAGE_COUNT> bloomStageBuffers{};
24
Grindstone::GraphicsAPI::Buffer
* bloomDataBuffer{};
25
Grindstone::Math::Uint2 size;
26
};
27
28
private
:
29
void
CreateDescriptorSets();
30
void
UpdateBloomUBO();
31
void
CreateBloomResources();
32
void
UpdateBloomDescriptorSet();
33
void
CreateUniformBuffers();
34
Grindstone::AssetReference<Grindstone::ComputePipelineAsset>
bloomPipelineSet;
35
Grindstone::GraphicsAPI::DescriptorSetLayout
* descriptorSetLayout =
nullptr
;
36
Grindstone::GraphicsAPI::Sampler
* screenSampler =
nullptr
;
37
38
std::array<ImageSet, 3> imageSets;
39
};
40
}
Grindstone::GraphicsAPI::Buffer
Definition
Buffer.hpp:49
Grindstone::GraphicsAPI::DescriptorSetLayout
Definition
DescriptorSetLayout.hpp:14
Grindstone::GraphicsAPI::Sampler
Definition
Sampler.hpp:49
Grindstone::Renderer::BloomPass
Definition
BloomPass.hpp:8
Grindstone::Renderer::RenderGraphBuilder
Definition
RenderGraphBuilder.hpp:12
Grindstone::Renderer
Definition
AttachmentInfo.hpp:15
Grindstone::AssetReference
Definition
AssetReference.hpp:45
Grindstone::Renderer::BloomPass::ImageSet
Definition
BloomPass.hpp:21
Grindstone::Renderer::RenderGraphBuilderResourceRef
Definition
RenderGraphResourceRef.hpp:51
plugins
Grindstone.Renderer.Deferred
include
Passes
BloomPass.hpp
Generated by
1.17.0