[Mesa-dev] [PATCH 42/65] glsl: don't cache shader if linking fails

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


Fixes crash in piglit tests. The assumption is that linking was successful
if we see the linked program in the cache.
---
 src/mesa/program/ir_to_mesa.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index e950f9e..fa034ab 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -3032,7 +3032,8 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog,
    }
 
 #ifdef ENABLE_SHADER_CACHE
-   shader_cache_write_program_metadata(ctx, prog);
+   if (prog->LinkStatus)
+      shader_cache_write_program_metadata(ctx, prog);
 #endif
 }
 
-- 
2.5.5



More information about the mesa-dev mailing list