1#ifndef VULKAN_DESCRIPTORSETPOOL
2#define VULKAN_DESCRIPTORSETPOOL
4#include <vulkan/vulkan.h>
10namespace Vulkan {
class DescriptorSetPool; }
26 template<std::same_as<VkDescriptorType>... DT>
29 std::vector<VkDescriptorType> typesArray;
30 (typesArray.push_back(types), ...);
33 std::vector<VkDescriptorPoolSize> typesInfo;
34 for (
const auto& poolType : typesArray) {
35 VkDescriptorPoolSize poolSize;
36 poolSize.type = poolType;
37 poolSize.descriptorCount =
static_cast<uint32_t
>(size);
38 typesInfo.push_back(poolSize);
42 VkDescriptorPoolCreateInfo poolInfo{};
43 poolInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
44 poolInfo.poolSizeCount = typesInfo.size();
45 poolInfo.pPoolSizes = typesInfo.data();
46 poolInfo.maxSets =
static_cast<uint32_t
>(size);
49 if (VkResult result = vkCreateDescriptorPool(+virtualGpu, &poolInfo,
nullptr, &descriptorPool); result != VK_SUCCESS) {
62 vkDestroyDescriptorPool(+virtualGpu, descriptorPool,
nullptr);
67 return descriptorPool;
71 VkDescriptorPool descriptorPool;
Class used to allocate DescriptorSet(s).
Definition: DescriptorSetPool.h:16
const VkDescriptorPool & operator+() const
Definition: DescriptorSetPool.h:66
DescriptorSetPool & operator=(DescriptorSetPool &&)=delete
DescriptorSetPool(DescriptorSetPool &&)=delete
~DescriptorSetPool()
Definition: DescriptorSetPool.h:61
DescriptorSetPool & operator=(const DescriptorSetPool &)=delete
DescriptorSetPool(const DescriptorSetPool &)=delete
DescriptorSetPool(const LogicalDevice &virtualGpu, unsigned int size, DT... types)
Creates a DescriptorSetPool object of the specified size. There is one pool of size size for each typ...
Definition: DescriptorSetPool.h:27
A logical device is an abstraction of the physical GPU which we can mainly use to send commands.
Definition: LogicalDevice.h:15
Generic runtime exception thrown by Vulkan-related functions.
Definition: VulkanException.h:13
Types of queue families.
Definition: Animations.h:17