Blender V5.3
vk_descriptor_pools.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_vector.hh"
12
13#include "vk_descriptor_set.hh"
14
15namespace blender::gpu {
16class VKDevice;
17
32 static constexpr uint32_t POOL_SIZE_STORAGE_BUFFER = 1000;
33 static constexpr uint32_t POOL_SIZE_DESCRIPTOR_SETS = 250;
34 static constexpr uint32_t POOL_SIZE_STORAGE_IMAGE = 250;
35 static constexpr uint32_t POOL_SIZE_COMBINED_IMAGE_SAMPLER = 250;
36 static constexpr uint32_t POOL_SIZE_UNIFORM_BUFFER = 500;
37 static constexpr uint32_t POOL_SIZE_UNIFORM_TEXEL_BUFFER = 100;
38 static constexpr uint32_t POOL_SIZE_INPUT_ATTACHMENT = 100;
39 static constexpr uint32_t POOL_SIZE_ACCELERATION_STRUCTURE = 100;
40
49 Vector<VkDescriptorPool> recycled_pools_;
51 VkDescriptorPool vk_descriptor_pool_ = VK_NULL_HANDLE;
52 Mutex mutex_;
53
54 public:
56
57 void init(const VKDevice &vk_device);
58
65 VkDescriptorSet allocate(const VkDescriptorSetLayout descriptor_set_layout);
66
70 void recycle(VkDescriptorPool vk_descriptor_pool);
71
72 private:
73 void add_new_pool(const VKDevice &device);
74 void discard_active_pool(VKContext &vk_context);
75 void ensure_pool(const VKDevice &device);
76};
77} // namespace blender::gpu
void recycle(VkDescriptorPool vk_descriptor_pool)
VkDescriptorSet allocate(const VkDescriptorSetLayout descriptor_set_layout)
void init(const VKDevice &vk_device)
unsigned int uint32_t
Definition BKE_text.h:81
std::mutex Mutex
Definition BLI_mutex.hh:51