diff --git a/.pick_status.json b/.pick_status.json index c01e7e7933d..90a26795d38 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -364,7 +364,7 @@ "description": "vulkan/pipeline_cache: replace raw data objects on cache insertion of real objects", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "8b13ee75ba9f27ceac6b6180ca05d321caa13612" }, diff --git a/src/vulkan/runtime/vk_pipeline_cache.c b/src/vulkan/runtime/vk_pipeline_cache.c index 68014c7582a..d5b9f347daa 100644 --- a/src/vulkan/runtime/vk_pipeline_cache.c +++ b/src/vulkan/runtime/vk_pipeline_cache.c @@ -319,6 +319,15 @@ vk_pipeline_cache_insert_object(struct vk_pipeline_cache *cache, struct vk_pipeline_cache_object *result = NULL; /* add reference to either the found or inserted object */ if (found) { + struct vk_pipeline_cache_object *found_object = (void *)entry->key; + 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); + entry->key = object; + object = found_object; + } + result = vk_pipeline_cache_object_ref((void *)entry->key); } else { result = vk_pipeline_cache_object_ref(object);