Toast Engine
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"
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
19namespace physics {
21}
22
23namespace renderer {
24class VulkanCore;
25
26class DebrisPass : public IRenderPass {
27public:
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
47private:
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}
Definition render_pass_base.hpp:19
Definition debris_simulation.hpp:27
Definition scene_descriptor_set.hpp:22
Definition shader_layout.hpp:12
Definition vulkan_core.hpp:48
Definition vulkan_pipeline.hpp:19