summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2017-10-13 22:04:52 -0700
committerJordan Justen <jordan.l.justen@intel.com>2017-10-31 23:36:54 -0700
commite5b141634cff3aa1f68699f39a2c3794261a32b1 (patch)
treef343c683cdc6d55847d17bc301babb5d55b3baf2
parente6ecd7d73fdbbca45ed398185eee2823e381d472 (diff)
downloadmesa-e5b141634cff3aa1f68699f39a2c3794261a32b1.tar.gz
mesa-e5b141634cff3aa1f68699f39a2c3794261a32b1.tar.bz2
mesa-e5b141634cff3aa1f68699f39a2c3794261a32b1.zip
disk_cache: Fix issue reading GLSL metadata
This would cause the read of the metadata content to fail, which would prevent the linking from being skipped. Seen on Rocket League with i965 shader cache. Fixes: b86ecea3446e "util/disk_cache: write cache item metadata to disk" Cc: Timothy Arceri <tarceri@itsqueeze.com> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--src/util/disk_cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index e38cacb259b..fde6e2e0974 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -1110,7 +1110,7 @@ disk_cache_get(struct disk_cache *cache, const cache_key key, size_t *size)
* TODO: pass the metadata back to the caller and do some basic
* validation.
*/
- cache_item_md_size += sizeof(cache_key);
+ cache_item_md_size += num_keys * sizeof(cache_key);
ret = lseek(fd, num_keys * sizeof(cache_key), SEEK_CUR);
if (ret == -1)
goto fail;