Destroy descriptor pools properly;

This commit is contained in:
bjorn 2022-05-30 13:12:04 -07:00
parent e59a75fce8
commit 32fb5e63ac
2 changed files with 10 additions and 1 deletions

View File

@ -2277,6 +2277,7 @@ static void expunge() {
case VK_OBJECT_TYPE_IMAGE_VIEW: vkDestroyImageView(state.device, victim->handle, NULL); break;
case VK_OBJECT_TYPE_SAMPLER: vkDestroySampler(state.device, victim->handle, NULL); break;
case VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT: vkDestroyDescriptorSetLayout(state.device, victim->handle, NULL); break;
case VK_OBJECT_TYPE_DESCRIPTOR_POOL: vkDestroyDescriptorPool(state.device, victim->handle, NULL); break;
case VK_OBJECT_TYPE_PIPELINE_LAYOUT: vkDestroyPipelineLayout(state.device, victim->handle, NULL); break;
case VK_OBJECT_TYPE_PIPELINE: vkDestroyPipeline(state.device, victim->handle, NULL); break;
case VK_OBJECT_TYPE_DEVICE_MEMORY: vkFreeMemory(state.device, victim->handle, NULL); break;
@ -2285,7 +2286,6 @@ static void expunge() {
}
}
#include <stdio.h>
// Ugliness until we can use dynamic rendering
static VkRenderPass getCachedRenderPass(gpu_pass_info* pass, bool compatible) {
bool depth = pass->depth.layout != VK_IMAGE_LAYOUT_UNDEFINED;

View File

@ -305,6 +305,15 @@ void lovrGraphicsDestroy() {
free(state.pipelines.data[i]);
}
for (uint32_t i = 0; i < state.layouts.length; i++) {
BundlePool* pool = state.layouts.data[i].head;
while (pool) {
BundlePool* next = pool->next;
gpu_bundle_pool_destroy(pool->gpu);
free(pool->gpu);
free(pool->bundles);
free(pool);
pool = next;
}
gpu_layout_destroy(state.layouts.data[i].gpu);
free(state.layouts.data[i].gpu);
}