[vulkan] Destroy the right framebuffers

Why nvidia's drivers accepted double-destroyed framebuffers is beyond
me, but this fixes the Intel drivers complaining about such (and the
subsequent segfault).
This commit is contained in:
Bill Currie 2021-11-30 21:56:57 +09:00
parent 5b1052087a
commit 08721f7a21

View file

@ -572,7 +572,7 @@ Vulkan_DestroyFrames (vulkan_ctx_t *ctx)
df->vkDestroyFence (dev, frame->fence, 0);
df->vkDestroySemaphore (dev, frame->imageAvailableSemaphore, 0);
df->vkDestroySemaphore (dev, frame->renderDoneSemaphore, 0);
df->vkDestroyFramebuffer (dev, frame->framebuffer, 0);
frame->framebuffer = 0;
for (int j = 0; j < frame->cmdSetCount; j++) {
DARRAY_CLEAR (&frame->cmdSets[j]);
}
@ -580,6 +580,11 @@ Vulkan_DestroyFrames (vulkan_ctx_t *ctx)
}
DARRAY_CLEAR (&ctx->frames);
for (size_t i = 0; i < ctx->framebuffers->size; i++) {
df->vkDestroyFramebuffer (dev, ctx->framebuffers->a[i], 0);
}
free (ctx->framebuffers);
}
void