util/disk_cache: rename mesa cache dir and introduce cache versioning

Steam is already analysing cache items, unfortunatly we did not
introduce a versioning mechanism for identifying structural changes
to cache entries earlier so the only way to do so is to rename the
cache directory.

Since we are renaming it we take the opportunity to give the directory
a more meaningful name.

Adding a version field to the header of cache entries will help us to
avoid having to rename the directory in future. Please note this is
versioning for the internal structure of the entries as defined in
disk_cache.{c,h} as opposed to the structure of the data provided to
the disk cache by the GLSL compiler and the various driver backends.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Timothy Arceri
2017-08-24 11:11:40 +10:00
parent 4a091b0788
commit 28b326238b
3 changed files with 42 additions and 14 deletions

View File

@@ -185,7 +185,8 @@ test_disk_cache_create(void)
cache = disk_cache_create("test", "make_check", 0);
expect_non_null(cache, "disk_cache_create with XDG_CACHE_HOME set");
check_directories_created(CACHE_TEST_TMP "/xdg-cache-home/mesa");
check_directories_created(CACHE_TEST_TMP "/xdg-cache-home/"
CACHE_DIR_NAME);
disk_cache_destroy(cache);
@@ -202,7 +203,8 @@ test_disk_cache_create(void)
cache = disk_cache_create("test", "make_check", 0);
expect_non_null(cache, "disk_cache_create with MESA_GLSL_CACHE_DIR set");
check_directories_created(CACHE_TEST_TMP "/mesa-glsl-cache-dir/mesa");
check_directories_created(CACHE_TEST_TMP "/mesa-glsl-cache-dir/"
CACHE_DIR_NAME);
disk_cache_destroy(cache);
}