Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
debris_pass.hpp
Go to the documentation of this file.
1
6
7
#pragma once
8
9
#include "../render_pass_base.hpp"
10
#include "
../scene_descriptor_set.hpp
"
11
#include "../shader_layout.hpp"
12
#include "../vulkan_pipeline.hpp"
13
14
#include <array>
15
#include <memory>
16
#include <string_view>
17
#include <vector>
18
19
namespace
physics {
20
class
DebrisSimulation
;
21
}
22
23
namespace
renderer {
24
class
VulkanCore
;
25
26
class
DebrisPass :
public
IRenderPass
{
27
public
:
28
DebrisPass(
29
const
VulkanCore
& core, vk::Format depth_format, vk::Extent2D extent, std::shared_ptr<physics::DebrisSimulation> simulation
30
);
31
32
[[nodiscard]]
33
auto
stage()
const
-> RenderStage
override
{
34
return
RenderStage::voxel_gbuffer;
35
}
36
37
[[nodiscard]]
38
auto
prepare(vk::CommandBuffer cmd, uint32_t frame_index) -> bool;
39
40
void
record(vk::CommandBuffer cmd, uint32_t frame_index, uint32_t image_index)
override
;
41
42
[[nodiscard]]
43
auto
name()
const
-> std::string_view
override
{
44
return
"Debris"
;
45
}
46
47
private
:
48
struct
PushConstants {
49
float
extrapolation = 0.0f;
50
float
frame_delta = 0.0f;
51
float
voxel_size = 0.0f;
52
uint32_t list_capacity = 0;
53
};
54
55
const
VulkanCore
* m_core =
nullptr
;
56
std::shared_ptr<physics::DebrisSimulation> m_simulation;
57
58
ShaderLayout
m_layout;
59
VulkanPipeline
m_pipeline;
60
SceneDescriptorSets
m_scene_sets;
61
std::vector<vk::raii::DescriptorSet> m_sets;
62
std::vector<std::array<vk::Buffer, 2>> m_bound;
63
vk::Buffer m_args =
nullptr
;
64
PushConstants m_push;
65
};
66
67
}
IRenderPass
Definition
render_pass_base.hpp:19
physics::DebrisSimulation
Definition
debris_simulation.hpp:27
renderer::SceneDescriptorSets
Definition
scene_descriptor_set.hpp:22
renderer::ShaderLayout
Definition
shader_layout.hpp:12
renderer::VulkanCore
Definition
vulkan_core.hpp:48
renderer::VulkanPipeline
Definition
vulkan_pipeline.hpp:19
scene_descriptor_set.hpp
engine
src
toast
renderer
passes
debris_pass.hpp
Generated by
1.17.0