Blender
V5.3
source
blender
gpu
vulkan
vk_descriptor_set_layouts.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2024 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
17
18
#pragma once
19
20
#include "
BLI_map.hh
"
21
#include "
BLI_mutex.hh
"
22
#include "
BLI_utility_mixins.hh
"
23
#include "
BLI_vector.hh
"
24
25
#include "
vk_common.hh
"
26
27
namespace
blender
{
28
29
namespace
gpu
{
30
31
class
VKDevice
;
32
38
struct
VKDescriptorSetLayoutInfo
{
39
using
Bindings
=
Vector<VkDescriptorType>
;
40
41
Bindings
bindings
;
42
VkShaderStageFlags
vk_shader_stage_flags
;
43
44
bool
operator==
(
const
VKDescriptorSetLayoutInfo
&other)
const
45
{
46
return
vk_shader_stage_flags
== other.
vk_shader_stage_flags
&&
bindings
== other.
bindings
;
47
};
48
};
49
50
};
// namespace gpu
51
57
template
<>
struct
DefaultHash
<
gpu
::
VKDescriptorSetLayoutInfo
> {
58
uint64_t
operator()
(
const
gpu::VKDescriptorSetLayoutInfo
&key)
const
59
{
60
uint64_t
hash
=
uint64_t
(key.
vk_shader_stage_flags
);
61
for
(VkDescriptorType vk_descriptor_type : key.
bindings
) {
62
hash
=
hash
* 33 ^
uint64_t
(vk_descriptor_type);
63
}
64
return
hash
;
65
}
66
};
67
68
namespace
gpu {
69
73
class
VKDescriptorSetLayouts
:
NonCopyable
{
74
friend
class
VKDevice
;
75
76
private
:
80
Map<VKDescriptorSetLayoutInfo, VkDescriptorSetLayout>
vk_descriptor_set_layouts_;
81
85
VkDescriptorSetLayoutCreateInfo vk_descriptor_set_layout_create_info_;
86
Vector<VkDescriptorSetLayoutBinding>
vk_descriptor_set_layout_bindings_;
87
Mutex
mutex_;
88
89
public
:
90
VKDescriptorSetLayouts
();
91
virtual
~VKDescriptorSetLayouts
();
92
99
VkDescriptorSetLayout
get_or_create
(
const
VKDescriptorSetLayoutInfo
&info,
100
bool
&r_created,
101
bool
&r_needed);
102
108
void
deinit
();
109
113
int64_t
size
()
const
114
{
115
return
vk_descriptor_set_layouts_.size();
116
}
117
118
private
:
119
void
update_layout_bindings(
const
VKDescriptorSetLayoutInfo
&info);
120
};
121
122
}
// namespace gpu
123
}
// namespace blender
BLI_map.hh
BLI_mutex.hh
BLI_utility_mixins.hh
BLI_vector.hh
blender::Map
Definition
BLI_map.hh:129
blender::blender::NonCopyable::NonCopyable
NonCopyable(const NonCopyable &other)=delete
blender::gpu::VKDescriptorSetLayouts::VKDescriptorSetLayouts
VKDescriptorSetLayouts()
Definition
vk_descriptor_set_layouts.cc:14
blender::gpu::VKDescriptorSetLayouts::VKDevice
friend class VKDevice
Definition
vk_descriptor_set_layouts.hh:74
blender::gpu::VKDescriptorSetLayouts::deinit
void deinit()
Definition
vk_descriptor_set_layouts.cc:84
blender::gpu::VKDescriptorSetLayouts::size
int64_t size() const
Definition
vk_descriptor_set_layouts.hh:113
blender::gpu::VKDescriptorSetLayouts::get_or_create
VkDescriptorSetLayout get_or_create(const VKDescriptorSetLayoutInfo &info, bool &r_created, bool &r_needed)
Definition
vk_descriptor_set_layouts.cc:26
blender::gpu::VKDevice
Definition
vk_device.hh:180
blender::gpu
Definition
blf_internal_types.hh:35
blender
BMesh Iterators.
Definition
ANIM_action.hh:30
blender::uint64_t
unsigned __int64 uint64_t
Definition
BKE_text.h:91
blender::int64_t
__int64 int64_t
Definition
BKE_text.h:90
blender::Mutex
std::mutex Mutex
Definition
BLI_mutex.hh:51
hash
#define hash
Definition
noise_c.cc:156
blender::DefaultHash< gpu::VKDescriptorSetLayoutInfo >::operator()
uint64_t operator()(const gpu::VKDescriptorSetLayoutInfo &key) const
Definition
vk_descriptor_set_layouts.hh:58
blender::DefaultHash
Definition
BLI_hash.hh:85
blender::gpu::VKDescriptorSetLayoutInfo
Definition
vk_descriptor_set_layouts.hh:38
blender::gpu::VKDescriptorSetLayoutInfo::Bindings
Vector< VkDescriptorType > Bindings
Definition
vk_descriptor_set_layouts.hh:39
blender::gpu::VKDescriptorSetLayoutInfo::bindings
Bindings bindings
Definition
vk_descriptor_set_layouts.hh:41
blender::gpu::VKDescriptorSetLayoutInfo::operator==
bool operator==(const VKDescriptorSetLayoutInfo &other) const
Definition
vk_descriptor_set_layouts.hh:44
blender::gpu::VKDescriptorSetLayoutInfo::vk_shader_stage_flags
VkShaderStageFlags vk_shader_stage_flags
Definition
vk_descriptor_set_layouts.hh:42
lexit::Vector
Definition
vector.hh:68
vk_common.hh
Generated on
for Blender by
doxygen
1.18.0