v3dv/pipeline_cache: adds check to skip searching for a entry

If we are calling pipeline_cache_upload_shared_data with
from_disk_cache, that means that we had used the disk-cache to found
that entry. And that should only happens if we didn't find the entry
on the cache. So on that case we can skip to search for it.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16313>
This commit is contained in:
Alejandro Piñeiro 2022-05-03 13:03:54 +02:00 committed by Marge Bot
parent 080e14ff61
commit f57a01c5f9

View file

@ -427,8 +427,13 @@ pipeline_cache_upload_shared_data(struct v3dv_pipeline_cache *cache,
return;
pipeline_cache_lock(cache);
struct hash_entry *entry =
_mesa_hash_table_search(cache->cache, shared_data->sha1_key);
struct hash_entry *entry = NULL;
/* If this is being called from the disk cache, we already know that the
* entry is not on the hash table
*/
if (!from_disk_cache)
entry = _mesa_hash_table_search(cache->cache, shared_data->sha1_key);
if (entry) {
pipeline_cache_unlock(cache);