Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
render_pass_base.hpp
1
4
5
#pragma once
6
7
#include "vulkan_common.hpp"
8
9
#include <atomic>
10
#include <string_view>
11
12
enum class
RenderStage : uint8_t {
13
world,
14
overlay,
16
voxel_gbuffer,
17
};
18
19
class
IRenderPass
{
20
public
:
21
virtual
~IRenderPass
() =
default
;
22
23
[[nodiscard]]
24
virtual
auto
stage()
const
-> RenderStage {
25
return
RenderStage::world;
26
}
27
28
virtual
void
update(uint32_t frame_index,
float
dt) { }
29
31
virtual
void
recordPre
(vk::CommandBuffer cmd, uint32_t frame_index, uint32_t image_index) { }
32
33
virtual
void
record(vk::CommandBuffer cmd, uint32_t frame_index, uint32_t image_index) = 0;
34
35
[[nodiscard]]
36
virtual
auto
name() const -> std::string_view {
37
return
"Pass"
;
38
}
39
40
void
setEnabled(
bool
enabled)
noexcept
{ m_enabled.store(enabled, std::memory_order_relaxed); }
41
42
[[nodiscard]]
43
auto
isEnabled() const noexcept ->
bool
{
44
return
m_enabled.load(std::memory_order_relaxed);
45
}
46
47
private
:
48
std::atomic_bool m_enabled {
true
};
49
};
IRenderPass
Definition
render_pass_base.hpp:19
IRenderPass::recordPre
virtual void recordPre(vk::CommandBuffer cmd, uint32_t frame_index, uint32_t image_index)
Records outside any rendering scope before the main scope opens.
Definition
render_pass_base.hpp:31
engine
src
toast
renderer
render_pass_base.hpp
Generated by
1.17.0