actually set pool sizez properly

This commit is contained in:
Gregory Wells
2025-06-17 12:47:27 -04:00
parent 960fee7cec
commit e5a11b1ef4
2 changed files with 20 additions and 7 deletions

View File

@@ -29,11 +29,11 @@ const char* *vkGetGryphnDeviceExtensions(uint32_t* outCount, VkPhysicalDevice de
}
free(vkExtensions);
// if (supportsDescriptorPoolOverallocation) {
// count++;
// extensiosns = realloc(extensiosns, sizeof(const char*) * count);
// extensiosns[(count - 1)] = VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_EXTENSION_NAME;
// }
if (supportsDescriptorPoolOverallocation) {
count++;
extensiosns = realloc(extensiosns, sizeof(const char*) * count);
extensiosns[(count - 1)] = VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_EXTENSION_NAME;
}
*outCount = count;

View File

@@ -66,10 +66,23 @@ gnUniform* gnUniformPoolAllocateUniformsFn(gnUniformPool pool, gnUniformAllocati
}
}
uint32_t count = 0;
VkDescriptorPoolSize poolSizes[2] = {};
if (uniformBufferSize.descriptorCount > 0) {
poolSizes[count] = uniformBufferSize;
count++;
}
if (imageSize.descriptorCount > 0) {
poolSizes[count] = imageSize;
count++;
}
VkDescriptorPoolCreateInfo poolInfo = {
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.poolSizeCount = 2,
.pPoolSizes = (VkDescriptorPoolSize[]){ uniformBufferSize, imageSize },
.poolSizeCount = count,
.pPoolSizes = poolSizes,
.maxSets = allocInfo.setCount
};