Module: Mesa
Branch: main
Commit: 8ffdad731cd8d8900c10810b61283afffa142f29
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ffdad731cd8d8900c10810b61283afffa142f29

Author: Friedrich Vock <[email protected]>
Date:   Sun Nov 12 21:00:04 2023 +0100

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 <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Faith Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26164>

---

 src/vulkan/runtime/vk_pipeline_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 {

Reply via email to