As the title says, I am explicitly creating a too small descriptor pool, which should NOT support the resources I am going to allocate from it.
std::array<vk::DescriptorPoolSize, 3> type_count;
// Initialize our pool with these values
type_count[0].type = vk::DescriptorType::eCombinedImageSampler;
type_count[0].descriptorCount = 0;
type_count[1].type = vk::DescriptorType::eSampler;
type_count[1].descriptorCount = 0;
type_count[2].type = vk::DescriptorType::eUniformBuffer;
type_count[2].descriptorCount = 0;
vk::DescriptorPoolCreateInfo createInfo = vk::DescriptorPoolCreateInfo()
.setPNext(nullptr)
.setMaxSets(iMaxSets)
.setPoolSizeCount(type_count.size())
.setPPoolSizes(type_count.data());
pool = aDevice.createDescriptorPool(createInfo);
I have an allocation function which looks like this, I am allocating a uniform, image-combined sampler and a regular sampler. Though if my pool is empty this should not work?
vk::DescriptorSetAllocateInfo alloc_info[1] = {};
alloc_info[0].pNext = NULL;
alloc_info[0].setDescriptorPool(pool);
alloc_info[0].setDescriptorSetCount(iNumToAllocate);
alloc_info[0].setPSetLayouts(&iDescriptorLayouts);
std::vector<vk::DescriptorSet> tDescriptors;
tDescriptors.resize(iNumToAllocate);
iDevice.allocateDescriptorSets(alloc_info, tDescriptors.data());
↧