14 const uint32_t concurrentFrames,
15 std::vector<VkDescriptorType> descriptorTypes
19 std::vector<VkDescriptorPoolSize> sizes(descriptorTypes.size());
21 for (
unsigned i = 0; i < descriptorTypes.size(); i++)
23 sizes[i].type = descriptorTypes[i];
24 sizes[i].descriptorCount = concurrentFrames;
28 VkDescriptorPoolCreateInfo poolInfo{};
29 poolInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
30 poolInfo.poolSizeCount = sizes.size();
31 poolInfo.pPoolSizes = sizes.data();
32 poolInfo.maxSets = concurrentFrames*sizes.size();
34 if (vkCreateDescriptorPool(device.
getVkDevice(), &poolInfo,
nullptr, &descriptorPool) != VK_SUCCESS)
36 throw std::runtime_error(
"Failed to create descriptor pool");