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 <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26164>
(cherry picked from commit 8ffdad731c)
This commit is contained in:
Friedrich Vock 2023-11-12 21:00:04 +01:00 committed by Eric Engestrom
parent 16ed2f180c
commit 7cf359fb57
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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 {