[Mesa-dev] [PATCH 02/37] glsl: Switch to disable-by-default for the GLSL shader cache
Eric Anholt
eric at anholt.net
Tue Jan 24 23:55:41 UTC 2017
Timothy Arceri <t_arceri at yahoo.com.au> writes:
> From: Carl Worth <cworth at cworth.org>
>
> The shader cache is expected to be developed incrementally over a
> fairly long series of commits. For that period of instability, we
> require users to opt into the shader cache by setting:
>
> MESA_GLSL_CACHE_ENABLE=1
>
> In the future, when the shader cache is complete, we can revert this
> commit so that the cache will be on by default.
>
> The user can always disable the cache with
> MESA_GLSL_CACHE_DISABLE=1. That functionality is not affected by this
> commit, (nor will it be affected by the future revert).
> ---
> src/compiler/glsl/tests/cache_test.c | 5 +++++
> src/util/disk_cache.c | 7 +++++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/src/compiler/glsl/tests/cache_test.c b/src/compiler/glsl/tests/cache_test.c
> index 0ef05aa..8547141 100644
> --- a/src/compiler/glsl/tests/cache_test.c
> +++ b/src/compiler/glsl/tests/cache_test.c
> @@ -388,6 +388,11 @@ main(void)
> #ifdef ENABLE_SHADER_CACHE
> int err;
>
> + /* While the shader cache is still experimental, this variable must
> + * be set or the cache does nothing.
> + */
> + setenv("MESA_GLSL_CACHE_ENABLE", "1", 1);
> +
> test_disk_cache_create();
>
> test_put_and_get();
> diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
> index 6de608c..dec09e0 100644
> --- a/src/util/disk_cache.c
> +++ b/src/util/disk_cache.c
> @@ -151,6 +151,13 @@ disk_cache_create(void)
> if (getenv("MESA_GLSL_CACHE_DISABLE"))
> goto fail;
>
> + /* As a temporary measure, (while the shader cache is under
> + * development, and known to not be fully function), also require
"functional"
> + * the MESA_GLSL_CACHE_ENABLE variable to be set.
> + */
> + if (! getenv ("MESA_GLSL_CACHE_ENABLE"))
> + goto fail;
cworth-style whitespace to be fixed here.
Other than that, 1-5 are:
Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170124/30e9c3be/attachment.sig>
More information about the mesa-dev
mailing list