Blender
V4.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
18
#pragma once
19
20
#include <mutex>
21
22
#include "
BLI_map.hh
"
23
#include "
BLI_utility_mixins.hh
"
24
#include "
BLI_vector.hh
"
25
26
#include "
vk_common.hh
"
27
28
namespace
blender::gpu
{
34
struct
VKDescriptorSetLayoutInfo
{
35
using
Bindings
=
Vector<VkDescriptorType>
;
36
37
Bindings
bindings
;
38
VkShaderStageFlags
vk_shader_stage_flags
;
39
40
bool
operator==
(
const
VKDescriptorSetLayoutInfo
&other)
const
41
{
42
return
vk_shader_stage_flags
== other.vk_shader_stage_flags &&
bindings
== other.bindings;
43
};
44
};
45
46
};
// namespace blender::gpu
47
48
namespace
blender
{
54
template
<>
struct
DefaultHash
<gpu::VKDescriptorSetLayoutInfo> {
55
uint64_t
operator()
(
const
gpu::VKDescriptorSetLayoutInfo
&key)
const
56
{
57
uint64_t
hash
=
uint64_t
(key.
vk_shader_stage_flags
);
58
for
(VkDescriptorType vk_descriptor_type : key.
bindings
) {
59
hash
=
hash
* 33 ^
uint64_t
(vk_descriptor_type);
60
}
61
return
hash
;
62
}
63
};
64
}
// namespace blender
65
66
namespace
blender::gpu
{
70
class
VKDescriptorSetLayouts
:
NonCopyable
{
71
friend
class
VKDevice
;
72
73
private
:
77
Map<VKDescriptorSetLayoutInfo, VkDescriptorSetLayout>
vk_descriptor_set_layouts_;
78
82
VkDescriptorSetLayoutCreateInfo vk_descriptor_set_layout_create_info_;
83
Vector<VkDescriptorSetLayoutBinding>
vk_descriptor_set_layout_bindings_;
84
std::mutex mutex_;
85
86
public
:
87
VKDescriptorSetLayouts
();
88
virtual
~VKDescriptorSetLayouts
();
89
96
VkDescriptorSetLayout
get_or_create
(
const
VKDescriptorSetLayoutInfo
&info,
97
bool
&r_created,
98
[[deprecated]]
bool
&r_needed);
99
105
void
deinit
();
106
110
int64_t
size
()
const
111
{
112
return
vk_descriptor_set_layouts_.
size
();
113
}
114
115
private
:
116
void
update_layout_bindings(
const
VKDescriptorSetLayoutInfo
&info);
117
};
118
119
}
// namespace blender::gpu
BLI_map.hh
BLI_utility_mixins.hh
BLI_vector.hh
blender::Map
Definition
BLI_map.hh:129
blender::Map::size
int64_t size() const
Definition
BLI_map.hh:927
blender::NonCopyable
Definition
BLI_utility_mixins.hh:16
blender::Vector< VkDescriptorType >
blender::gpu::VKDescriptorSetLayouts
Definition
vk_descriptor_set_layouts.hh:70
blender::gpu::VKDescriptorSetLayouts::~VKDescriptorSetLayouts
virtual ~VKDescriptorSetLayouts()
Definition
vk_descriptor_set_layouts.cc:21
blender::gpu::VKDescriptorSetLayouts::VKDescriptorSetLayouts
VKDescriptorSetLayouts()
Definition
vk_descriptor_set_layouts.cc:14
blender::gpu::VKDescriptorSetLayouts::deinit
void deinit()
Definition
vk_descriptor_set_layouts.cc:83
blender::gpu::VKDescriptorSetLayouts::size
int64_t size() const
Definition
vk_descriptor_set_layouts.hh:110
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:125
blender::gpu
Definition
blf_internal_types.hh:23
blender
Definition
ANIM_action.hh:36
hash
#define hash
Definition
noise.c:154
int64_t
__int64 int64_t
Definition
stdint.h:89
uint64_t
unsigned __int64 uint64_t
Definition
stdint.h:90
blender::DefaultHash< gpu::VKDescriptorSetLayoutInfo >::operator()
uint64_t operator()(const gpu::VKDescriptorSetLayoutInfo &key) const
Definition
vk_descriptor_set_layouts.hh:55
blender::DefaultHash
Definition
BLI_hash.hh:83
blender::gpu::VKDescriptorSetLayoutInfo
Definition
vk_descriptor_set_layouts.hh:34
blender::gpu::VKDescriptorSetLayoutInfo::bindings
Bindings bindings
Definition
vk_descriptor_set_layouts.hh:37
blender::gpu::VKDescriptorSetLayoutInfo::operator==
bool operator==(const VKDescriptorSetLayoutInfo &other) const
Definition
vk_descriptor_set_layouts.hh:40
blender::gpu::VKDescriptorSetLayoutInfo::vk_shader_stage_flags
VkShaderStageFlags vk_shader_stage_flags
Definition
vk_descriptor_set_layouts.hh:38
vk_common.hh
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0