[Mesa-dev] [PATCH 29/65] glsl: skip linking when current program has been retrieved from cache

Timothy Arceri timothy.arceri at collabora.com
Fri Apr 29 13:33:28 UTC 2016


The scenario is a program has been linked for the first time and we
cache the program metadata, then glLinkProgram() is called for a second
time. Since we will now retrieve the program metadata from cache we need
to skip linking.
---
 src/compiler/glsl/shader_cache.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp
index 8b8a28c..333b262 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -699,6 +699,7 @@ shader_cache_read_program_metadata(struct gl_context *ctx,
               "discard the item from the cache and rebuild from source.\n");
    }
 
+   prog->Version = 0; /* This is used to flag a shader retrieved from cache */
    prog->LinkStatus = true;
 
    free (buffer);
-- 
2.5.5



More information about the mesa-dev mailing list