Blender V5.3
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
27namespace blender {
28
29namespace gpu {
30
31class VKDevice;
32
49
50}; // namespace gpu
51
59 {
61 for (VkDescriptorType vk_descriptor_type : key.bindings) {
62 hash = hash * 33 ^ uint64_t(vk_descriptor_type);
63 }
64 return hash;
65 }
66};
67
68namespace gpu {
69
74 friend class VKDevice;
75
76 private:
81
85 VkDescriptorSetLayoutCreateInfo vk_descriptor_set_layout_create_info_;
86 Vector<VkDescriptorSetLayoutBinding> vk_descriptor_set_layout_bindings_;
87 Mutex mutex_;
88
89 public:
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
NonCopyable(const NonCopyable &other)=delete
VkDescriptorSetLayout get_or_create(const VKDescriptorSetLayoutInfo &info, bool &r_created, bool &r_needed)
BMesh Iterators.
unsigned __int64 uint64_t
Definition BKE_text.h:91
__int64 int64_t
Definition BKE_text.h:90
std::mutex Mutex
Definition BLI_mutex.hh:51
#define hash
Definition noise_c.cc:156
uint64_t operator()(const gpu::VKDescriptorSetLayoutInfo &key) const
bool operator==(const VKDescriptorSetLayoutInfo &other) const