diff options
author | Timothy Arceri <[email protected]> | 2016-09-28 08:55:02 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-09-28 09:16:31 +1000 |
commit | 87ab26b2ab35a29d446ae66f1795d40c184c0739 (patch) | |
tree | 18db7f28e1cb85d6338c91f5df6087a587d70fd8 /configure.ac | |
parent | 44bcf1ffcced04fd7f2b537a922ffa85dd1418e2 (diff) |
glsl: Add initial functions to implement an on-disk cache
This code provides for an on-disk cache of objects. Objects are stored
and retrieved via names that are arbitrary 20-byte sequences,
(intended to be SHA-1 hashes of something identifying for the
content). The directory used for the cache can be specified by means
of environment variables in the following priority order:
$MESA_GLSL_CACHE_DIR
$XDG_CACHE_HOME/mesa
<user-home-directory>/.cache/mesa
By default the cache will be limited to a maximum size of 1GB. The
environment variable:
$MESA_GLSL_CACHE_MAX_SIZE
can be set (at the time of GL context creation) to choose some other
size. This variable is a number that can optionally be followed by
'K', 'M', or 'G' to select a size in kilobytes, megabytes, or
gigabytes. By default, an unadorned value will be interpreted as
gigabytes.
The cache will be entirely disabled at runtime if the variable
MESA_GLSL_CACHE_DISABLE is set at the time of GL context creation.
Many thanks to Kristian Høgsberg <[email protected]> for the initial
implementation of code that led to this patch. In particular, the idea
of using an mmapped file, (indexed by a portion of the SHA-1), for the
efficent implementation of cache_has_key was entirely his
idea. Kristian also provided some very helpful advice in discussions
regarding various race conditions to be avoided in this code.
Signed-off-by: Timothy Arceri <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index b9e6000a3d5..c702b539994 100644 --- a/configure.ac +++ b/configure.ac @@ -1305,6 +1305,9 @@ if test "x$with_sha1" = "x"; then fi fi AM_CONDITIONAL([ENABLE_SHADER_CACHE], [test x$enable_shader_cache = xyes]) +if test "x$enable_shader_cache" = "xyes"; then + AC_DEFINE([ENABLE_SHADER_CACHE], [1], [Enable shader cache]) +fi case "$host_os" in linux*) |