Blender V4.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
9#pragma once
10
11#include "BLI_vector.hh"
12
13#include "vk_descriptor_set.hh"
14
15namespace blender::gpu {
16class VKDevice;
17
35 static constexpr uint32_t POOL_SIZE_STORAGE_BUFFER = 1000;
36 static constexpr uint32_t POOL_SIZE_DESCRIPTOR_SETS = 1000;
37 static constexpr uint32_t POOL_SIZE_STORAGE_IMAGE = 1000;
38 static constexpr uint32_t POOL_SIZE_COMBINED_IMAGE_SAMPLER = 1000;
39 static constexpr uint32_t POOL_SIZE_UNIFORM_BUFFER = 1000;
40 static constexpr uint32_t POOL_SIZE_UNIFORM_TEXEL_BUFFER = 1000;
41
43 int64_t active_pool_index_ = 0;
44
45 public:
48
49 void init(const VKDevice &vk_device);
50
51 VkDescriptorSet allocate(const VkDescriptorSetLayout descriptor_set_layout);
52
56 void reset();
57
58 private:
59 VkDescriptorPool active_pool_get();
60 void activate_next_pool();
61 void activate_last_pool();
62 bool is_last_pool_active();
63 void add_new_pool(const VKDevice &device);
64};
65} // namespace blender::gpu
void init()
VkDescriptorSet allocate(const VkDescriptorSetLayout descriptor_set_layout)
unsigned int uint32_t
Definition stdint.h:80
__int64 int64_t
Definition stdint.h:89