[Mesa-dev] [PATCH 22/77] glsl: compile shaders when program not found in cache

Timothy Arceri timothy.arceri at collabora.com
Mon Oct 3 06:04:41 UTC 2016

We may have seen the individual shaders before and skipped compiling
but they may not have been used together in this combination before.

We could probably only compile the shaders which were skipped here
but we need to be careful because the source may also have been
changed since the last compile so for now we just recompile
 src/compiler/glsl/shader_cache.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp
index 4903980..c7d9e80 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -679,9 +679,10 @@ shader_cache_read_program_metadata(struct gl_context *ctx,
    buffer = (uint8_t *) cache_get(cache, prog->sha1, &size);
    if (buffer == NULL) {
-      /* FIXME: Fall back and link shaders here, if necessary, compile any
-       * shaders we didn't compile earlier.
+      /* Cached program not found. Fall back to linking shaders but first
+       * compile any shaders we didn't compile earlier.
+      compile_shaders(ctx, prog);
       return false;

More information about the mesa-dev mailing list