From 7cf359fb57dd747c9ca0d933673bb2a993b2e4cf Mon Sep 17 00:00:00 2001 From: Friedrich Vock Date: Sun, 12 Nov 2023 21:00:04 +0100 Subject: [PATCH] vulkan: Don't use set_foreach_remove when destroying pipeline caches set_foreach_remove assumes no entries have been removed. That assumption only holds if no errors occur, since pipeline cache objects can get removed if an error occurs during deserialization. This fixes dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic crashing on RADV. Cc: mesa-stable Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Samuel Pitoiset Reviewed-by: Faith Ekstrand Part-of: (cherry picked from commit 8ffdad731cd8d8900c10810b61283afffa142f29) --- .pick_status.json | 2 +- src/vulkan/runtime/vk_pipeline_cache.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 96c65da5b57..6bbacbbc553 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5364,7 +5364,7 @@ "description": "vulkan: Don't use set_foreach_remove when destroying pipeline caches", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/vulkan/runtime/vk_pipeline_cache.c b/src/vulkan/runtime/vk_pipeline_cache.c index d5988952a5b..71471dd0239 100644 --- a/src/vulkan/runtime/vk_pipeline_cache.c +++ b/src/vulkan/runtime/vk_pipeline_cache.c @@ -659,7 +659,7 @@ vk_pipeline_cache_destroy(struct vk_pipeline_cache *cache, { if (cache->object_cache) { if (!cache->weak_ref) { - set_foreach_remove(cache->object_cache, entry) { + set_foreach(cache->object_cache, entry) { vk_pipeline_cache_object_unref(cache->base.device, (void *)entry->key); } } else {