[vulkan] Plug some memory leaks

I still can't find the run-time leak. I suspect something that
accumulates but gets freed on exit.
This commit is contained in:
Bill Currie 2022-05-13 00:55:37 +09:00
parent ef87baf339
commit 3823ea1858
3 changed files with 7 additions and 0 deletions

View file

@ -484,6 +484,7 @@ Vulkan_BuildDisplayLists (model_t **models, int num_models, vulkan_ctx_t *ctx)
vertex_index_base = 0; vertex_index_base = 0;
// holds all the polygon definitions: vertex indices + poly_count "end of // holds all the polygon definitions: vertex indices + poly_count "end of
// primitive" markers. // primitive" markers.
free (bctx->polys);
bctx->polys = malloc ((index_count + poly_count) * sizeof (uint32_t)); bctx->polys = malloc ((index_count + poly_count) * sizeof (uint32_t));
// All usable surfaces have been chained to the (base) texture they use. // All usable surfaces have been chained to the (base) texture they use.

View file

@ -357,6 +357,7 @@ Vulkan_Lighting_Init (vulkan_ctx_t *ctx)
device->physDev->properties.limits.maxPerStageDescriptorSamplers); device->physDev->properties.limits.maxPerStageDescriptorSamplers);
lframe->shadowWrite.pImageInfo = lframe->shadowInfo; lframe->shadowWrite.pImageInfo = lframe->shadowInfo;
} }
free (shadow_set);
free (attach_set); free (attach_set);
free (lights_set); free (lights_set);
qfvPopDebug (ctx); qfvPopDebug (ctx);

View file

@ -549,6 +549,9 @@ destroy_attachments (vulkan_ctx_t *ctx, qfv_renderpass_t *rp)
dfunc->vkDestroyImage (device->dev, rp->attachment_images->a[i], 0); dfunc->vkDestroyImage (device->dev, rp->attachment_images->a[i], 0);
} }
dfunc->vkFreeMemory (device->dev, rp->attachmentMemory, 0); dfunc->vkFreeMemory (device->dev, rp->attachmentMemory, 0);
free (rp->attachment_images);
free (rp->attachment_views);
} }
static void static void
@ -591,6 +594,8 @@ Vulkan_DestroyRenderPasses (vulkan_ctx_t *ctx)
destroy_renderframes (ctx, rp); destroy_renderframes (ctx, rp);
destroy_framebuffers (ctx, rp); destroy_framebuffers (ctx, rp);
DARRAY_CLEAR (&rp->frames);
free (rp->clearValues);
free (rp); free (rp);
} }
} }