vulkan/pipeline_cache: remove a bogus assert when inserting objects

If two threads deserialize the raw object at the same time, the
refcount could be more than 1 temporarily.

This can be reproduced with Granite during the multi-threaded pipeline
cache pre-warm on startup, and also with Dota2.

Fixes: cbab396f54 ("vulkan/pipeline_cache: replace raw data objects on cache insertion of real objects")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22853>
(cherry picked from commit 8126e0287d)
This commit is contained in:
Samuel Pitoiset 2023-05-04 15:29:39 +02:00 committed by Eric Engestrom
parent ca9cfa13a7
commit e16268059d
2 changed files with 2 additions and 2 deletions

View File

@ -328,7 +328,7 @@
"description": "vulkan/pipeline_cache: remove a bogus assert when inserting objects",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "cbab396f549fa7c1a948d469fe6b4df18a81adc9"
},

View File

@ -325,7 +325,7 @@ vk_pipeline_cache_insert_object(struct vk_pipeline_cache *cache,
if (found_object->ops != object->ops) {
/* The found object in the cache isn't fully formed. Replace it. */
assert(found_object->ops == &raw_data_object_ops);
assert(found_object->ref_cnt == 1 && object->ref_cnt == 1);
assert(object->ref_cnt == 1);
entry->key = object;
object = found_object;
}