Blender V4.5
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
35 static constexpr uint32_t POOL_SIZE_STORAGE_BUFFER = 1000;
36 static constexpr uint32_t POOL_SIZE_DESCRIPTOR_SETS = 250;
37 static constexpr uint32_t POOL_SIZE_STORAGE_IMAGE = 250;
38 static constexpr uint32_t POOL_SIZE_COMBINED_IMAGE_SAMPLER = 250;
39 static constexpr uint32_t POOL_SIZE_UNIFORM_BUFFER = 500;
40 static constexpr uint32_t POOL_SIZE_UNIFORM_TEXEL_BUFFER = 100;
41 static constexpr uint32_t POOL_SIZE_INPUT_ATTACHMENT = 100;
42
44 int64_t active_pool_index_ = 0;
45
46 public:
49
50 void init(const VKDevice &vk_device);
51
52 VkDescriptorSet allocate(const VkDescriptorSetLayout descriptor_set_layout);
53
60 void discard(VKContext &vk_context);
61
62 private:
63 VkDescriptorPool active_pool_get();
64 void activate_next_pool();
65 void activate_last_pool();
66 bool is_last_pool_active();
67 void add_new_pool(const VKDevice &device);
68};
69} // namespace blender::gpu
void init()
long long int int64_t
VkDescriptorSet allocate(const VkDescriptorSetLayout descriptor_set_layout)
void discard(VKContext &vk_context)