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

Timothy Arceri timothy.arceri at collabora.com
Wed Jun 1 06:23:08 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
everything.
---
 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 fdfd476..9efc1b6 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -658,9 +658,10 @@ shader_cache_read_program_metadata(struct gl_context *ctx,
    _mesa_sha1_compute(buf, offset, prog->sha1);
    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;
    }
 
-- 
2.5.5



More information about the mesa-dev mailing list