vulkan/pipeline_cache: Do not consume object passed into remove_object.

Future use case will require removing an object with zero ref count, so
leave it up to the caller to call unref.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23877>
This commit is contained in:
Tatsuyuki Ishi 2023-06-27 21:20:38 +09:00 committed by Marge Bot
parent 3774c3232c
commit 64c959e46c

View file

@ -164,9 +164,6 @@ vk_pipeline_cache_remove_object(struct vk_pipeline_cache *cache,
_mesa_set_remove(cache->object_cache, entry);
}
vk_pipeline_cache_unlock(cache);
/* Drop our reference */
vk_pipeline_cache_object_unref(cache->base.device, object);
}
static bool
@ -367,6 +364,7 @@ vk_pipeline_cache_lookup_object(struct vk_pipeline_cache *cache,
"Deserializing pipeline cache object failed");
vk_pipeline_cache_remove_object(cache, hash, object);
vk_pipeline_cache_object_unref(cache->base.device, object);
return NULL;
}