From: Iago Toral Quiroga Date: Tue, 26 Sep 2023 11:11:39 +0000 (+0100) Subject: v3d: use pre-computed shader sha1 for disk cache X-Git-Tag: upstream/23.3.3~1392 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a4bd328cf1a2e5655294080a21baa60f8d84178;p=platform%2Fupstream%2Fmesa.git v3d: use pre-computed shader sha1 for disk cache Reviewed-by: Juan A. Suarez Part-of: --- diff --git a/src/gallium/drivers/v3d/v3d_disk_cache.c b/src/gallium/drivers/v3d/v3d_disk_cache.c index 3b8f1250256..79be2973039 100644 --- a/src/gallium/drivers/v3d/v3d_disk_cache.c +++ b/src/gallium/drivers/v3d/v3d_disk_cache.c @@ -27,7 +27,6 @@ #include "v3d_context.h" -#include "compiler/nir/nir_serialize.h" #include "util/blob.h" #include "util/u_upload_mgr.h" @@ -86,17 +85,15 @@ v3d_disk_cache_compute_key(struct disk_cache *cache, assert(uncompiled->base.type == PIPE_SHADER_IR_NIR); nir_shader *nir = uncompiled->base.ir.nir; - struct blob blob; - blob_init(&blob); - uint32_t ckey_size = v3d_key_size(nir->info.stage); struct v3d_key *ckey = malloc(ckey_size); memcpy(ckey, key, ckey_size); ckey->shader_state = NULL; + struct blob blob; + blob_init(&blob); blob_write_bytes(&blob, ckey, ckey_size); - - nir_serialize(&blob, nir, true); + blob_write_bytes(&blob, uncompiled->sha1, 20); disk_cache_compute_key(cache, blob.data, blob.size, cache_key);