From 43738a9a94fe9b51c0072ac21d1628edbeb703f0 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 4 Dec 2024 16:10:56 +0100 Subject: [PATCH] vulkan/meta: plug a couple of memory leaks We create NIR shaders here, and we need to free them when we're done with them as well. These shaders are created using nir_builder_init_simple_shader(), which allocates using a NULL ralloc-parent, so ralloc_free should be the right function to free them with. Fixes: 514c10344e6 ("vulkan/meta: Add a concept of rect pipelines") Reviewed-by: Boris Brezillon Part-of: --- src/vulkan/runtime/vk_meta.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vulkan/runtime/vk_meta.c b/src/vulkan/runtime/vk_meta.c index f642f1064b1..39830212232 100644 --- a/src/vulkan/runtime/vk_meta.c +++ b/src/vulkan/runtime/vk_meta.c @@ -369,6 +369,10 @@ create_rect_list_pipeline(struct vk_device *device, 1, &info_local, NULL, pipeline_out); + ralloc_free(vs_nir_info.nir); + if (use_gs) + ralloc_free(gs_nir_info.nir); + STACK_ARRAY_FINISH(dyn_state); STACK_ARRAY_FINISH(stages);