Toast Engine
Loading...
Searching...
No Matches
depth_prepass.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
9#include "../shader_layout.hpp"
10#include "../vulkan_common.hpp"
11#include "../vulkan_pipeline.hpp"
12
13#include <cstdint>
14#include <string_view>
15#include <vector>
16
17namespace renderer {
18class VulkanCore;
19
21class DepthPrepass {
22public:
23 DepthPrepass(const VulkanCore& core, vk::Format depth_format, vk::Extent2D extent);
24
25 [[nodiscard]]
26 auto isReady() const -> bool {
27 return m_pipeline.isReady();
28 }
29
31 void record(vk::CommandBuffer cmd, uint32_t frame_index);
32
33 [[nodiscard]]
34 auto getDrawnCount() const noexcept -> uint32_t {
35 return m_drawn;
36 }
37
38private:
39 void createResources(const VulkanCore& core);
40
41 const VulkanCore* m_core = nullptr;
42
43 ShaderLayout m_shader_layout;
44 VulkanPipeline m_pipeline;
45
46 std::vector<vk::raii::DescriptorSet> m_descriptor_sets;
47
48 uint32_t m_drawn = 0;
49};
50
51}
void record(vk::CommandBuffer cmd, uint32_t frame_index)
Expects an open rendering scope with a depth attachment and no colour attachments.
Definition depth_prepass.cpp:95
Definition shader_layout.hpp:12
Definition vulkan_core.hpp:48
Definition vulkan_pipeline.hpp:19