Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
scene_descriptor_set.hpp
Go to the documentation of this file.
1
6
7
#pragma once
8
9
#include "
shader_reflection.hpp
"
10
#include "vulkan_common.hpp"
11
12
#include <cstdint>
13
#include <optional>
14
#include <string>
15
#include <string_view>
16
#include <utility>
17
#include <vector>
18
19
namespace
renderer {
20
class
VulkanCore
;
21
22
class
SceneDescriptorSets
{
23
public
:
24
void
create(
const
VulkanCore
& core,
const
ShaderReflection
& reflection, vk::DescriptorSetLayout layout, std::string_view owner);
25
27
void
updateTlas
(uint32_t frame_index);
28
29
[[nodiscard]]
30
auto
get(uint32_t frame_index)
const
-> vk::DescriptorSet {
31
return
frame_index < m_sets.size() ? *m_sets[frame_index] : vk::DescriptorSet {};
32
}
33
34
[[nodiscard]]
35
auto
empty()
const
noexcept
->
bool
{
36
return
m_sets.empty();
37
}
38
39
private
:
40
const
VulkanCore
* m_core =
nullptr
;
41
std::string m_owner;
42
43
std::vector<vk::raii::DescriptorSet> m_sets;
44
45
std::optional<uint32_t> m_scene_binding;
46
48
std::vector<std::pair<vk::AccelerationStructureKHR, uint64_t>> m_bound_tlas;
49
};
50
51
}
renderer::SceneDescriptorSets
Definition
scene_descriptor_set.hpp:22
renderer::SceneDescriptorSets::updateTlas
void updateTlas(uint32_t frame_index)
Call before the bind.
Definition
scene_descriptor_set.cpp:174
renderer::VulkanCore
Definition
vulkan_core.hpp:48
shader_reflection.hpp
renderer::ShaderReflection
Definition
shader_reflection.hpp:87
engine
src
toast
renderer
scene_descriptor_set.hpp
Generated by
1.17.0