[Mesa-dev] [PATCH] util/disk_cache: avoid making mesa subdir when cache dir is specified

Timothy Arceri tarceri at itsqueeze.com
Sat Mar 25 01:56:18 UTC 2017


I'm not sure  this is a good idea. Adding an extra dir doesn't do much 
harm, on the other hand if MESA_GLSL_CACHE_DIR is not a newly create dir 
just for the cache we could run into problems.

I think I'd rather leave this as is.

On 25/03/17 10:06, Grazvydas Ignotas wrote:
> When MESA_GLSL_CACHE_DIR is specified, we currently add a /mesa subdir
> even though the documentation and nearby comment in the code make no
> mention of it. Doesn't look useful too, remove.
>
> Signed-off-by: Grazvydas Ignotas <notasas at gmail.com>
> ---
>  src/compiler/glsl/tests/cache_test.c | 2 +-
>  src/util/disk_cache.c                | 4 ----
>  2 files changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/src/compiler/glsl/tests/cache_test.c b/src/compiler/glsl/tests/cache_test.c
> index 537a81b..4665026 100644
> --- a/src/compiler/glsl/tests/cache_test.c
> +++ b/src/compiler/glsl/tests/cache_test.c
> @@ -200,11 +200,11 @@ test_disk_cache_create(void)
>
>     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_directories_created(CACHE_TEST_TMP "/mesa-glsl-cache-dir/mesa");
> +   check_directories_created(CACHE_TEST_TMP "/mesa-glsl-cache-dir");
>
>     disk_cache_destroy(cache);
>  }
>
>  static bool
> diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
> index a9a3e59..4f66aa9 100644
> --- a/src/util/disk_cache.c
> +++ b/src/util/disk_cache.c
> @@ -195,14 +195,10 @@ disk_cache_create(const char *gpu_name, const char *timestamp)
>      */
>     path = getenv("MESA_GLSL_CACHE_DIR");
>     if (path) {
>        if (mkdir_if_needed(path) == -1)
>           goto fail;
> -
> -      path = concatenate_and_mkdir(local, path, "mesa");
> -      if (path == NULL)
> -         goto fail;
>     }
>
>     if (path == NULL) {
>        char *xdg_cache_home = getenv("XDG_CACHE_HOME");
>
>


More information about the mesa-dev mailing list