From 27cf49205c01097359f681e6a189f5f42bd94873 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 1 May 2024 20:31:55 +0300 Subject: [PATCH] anv: fix leak of custom border colors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inside a HAVE_VALGRIND section. Signed-off-by: Lionel Landwerlin Fixes: 4dad2a4a6f ("anv: enable shader border color capture/replay") Reviewed-by: Rohan Garg Reviewed-by: José Roberto de Souza Part-of: (cherry picked from commit ae6d20815ad1029c50bf8a3bdde13d34414142aa) --- .pick_status.json | 2 +- src/intel/vulkan/anv_device.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 07549eccc56..a2c3f701a38 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -164,7 +164,7 @@ "description": "anv: fix leak of custom border colors", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "4dad2a4a6fd76d8bc889d655c812a6f0ba757ed7", "notes": null diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 142ca21cf44..c85bf3ae17f 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -4032,6 +4032,9 @@ void anv_DestroyDevice( device->companion_rcs_cmd_pool, NULL); } + if (device->vk.enabled_extensions.EXT_descriptor_buffer) + anv_state_reserved_array_pool_finish(&device->custom_border_colors_db); + #ifdef HAVE_VALGRIND /* We only need to free these to prevent valgrind errors. The backing * BO will go away in a couple of lines so we don't actually leak. @@ -4045,7 +4048,6 @@ void anv_DestroyDevice( anv_state_pool_free(&device->dynamic_state_db_pool, device->cps_states_db); anv_state_pool_free(&device->dynamic_state_db_pool, device->slice_hash_db); anv_state_pool_free(&device->dynamic_state_db_pool, device->border_colors_db); - anv_state_reserved_array_pool_finish(&device->custom_border_colors_db); } #endif