summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorGrazvydas Ignotas <[email protected]>2017-03-16 01:09:29 +0200
committerTimothy Arceri <[email protected]>2017-03-24 11:20:09 +1100
commitfeb716239e1a318eb844fd3bcaca1ffd6903067c (patch)
treee3dd1a2d303a2e98efe307bd0aaae0fb14214359 /src/compiler
parent7ceb1a4fa826910508ef6cb1d1b27529cd999340 (diff)
util/disk_cache: hash timestamps into the cache keys
Instead of using a directory, hash the timestamps into the cache keys themselves. Since there is no more timestamp directory, there is no more need for deleting the cache of other mesa versions and we rely on eviction to clean up the old cache entries. This solves the problem of using several incarnations of disk_cache at the same time, where one deletes a directory belonging to the other, like when both OpenGL and gallium nine are used simultaneously (or several different mesa installations). v2: using additional blob instead of trying to clone sha1 state v3: (Timothy Arceri) don't use an opaque data type to store timestamp. V4: (Timothy Arceri) use blob to store driver keys just make sure to store null terminator for strings, and make sure blob is defined by disk_cache and not it's users. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100091
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/tests/cache_test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/glsl/tests/cache_test.c b/src/compiler/glsl/tests/cache_test.c
index b1b3c33535e..b604943feeb 100644
--- a/src/compiler/glsl/tests/cache_test.c
+++ b/src/compiler/glsl/tests/cache_test.c
@@ -128,7 +128,7 @@ rmrf_local(const char *path)
}
static void
-check_timestamp_and_gpu_id_directories_created(char *cache_dir)
+check_directories_created(char *cache_dir)
{
bool sub_dirs_created = false;
@@ -184,13 +184,13 @@ test_disk_cache_create(void)
/* Create string with expected directory hierarchy */
char expected_dir_h[255];
sprintf(expected_dir_h, "%s%s%s", CACHE_TEST_TMP "/xdg-cache-home/mesa/",
- get_arch_bitness_str(), "/make_check/test");
+ get_arch_bitness_str(), "/test");
mkdir(CACHE_TEST_TMP, 0755);
cache = disk_cache_create("test", "make_check");
expect_non_null(cache, "disk_cache_create with XDG_CACHE_HOME set");
- check_timestamp_and_gpu_id_directories_created(expected_dir_h);
+ check_directories_created(expected_dir_h);
disk_cache_destroy(cache);
@@ -205,13 +205,13 @@ test_disk_cache_create(void)
sprintf(expected_dir_h, "%s%s%s", CACHE_TEST_TMP
"/mesa-glsl-cache-dir/mesa/", get_arch_bitness_str(),
- "/make_check/test");
+ "/test");
mkdir(CACHE_TEST_TMP, 0755);
cache = disk_cache_create("test", "make_check");
expect_non_null(cache, "disk_cache_create with MESA_GLSL_CACHE_DIR set");
- check_timestamp_and_gpu_id_directories_created(expected_dir_h);
+ check_directories_created(expected_dir_h);
disk_cache_destroy(cache);
}