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>
This commit is contained in:
Friedrich Vock 2023-11-12 21:00:04 +01:00 committed by Marge Bot
parent 1cb3c349ff
commit 8ffdad731c

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 {