summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-03-27 16:25:12 +1100
committerTimothy Arceri <[email protected]>2016-09-28 10:43:15 +1000
commit3eb0baeecfed7a2de2b323e1b5d90e2b14dfc803 (patch)
treead1473f1bc16ece498f58fa08a5c246b4ca9f3d4 /src/mesa/main/shaderapi.c
parent87ab26b2ab35a29d446ae66f1795d40c184c0739 (diff)
glsl: don't crash when dumping shaders if some come from cache
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r--src/mesa/main/shaderapi.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 4ebc39febbb..1af1c3f5794 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1039,8 +1039,13 @@ _mesa_compile_shader(struct gl_context *ctx, struct gl_shader *sh)
if (ctx->_Shader->Flags & GLSL_DUMP) {
if (sh->CompileStatus) {
- _mesa_log("GLSL IR for shader %d:\n", sh->Name);
- _mesa_print_ir(_mesa_get_log_file(), sh->ir, NULL);
+ if (sh->ir) {
+ _mesa_log("GLSL IR for shader %d:\n", sh->Name);
+ _mesa_print_ir(_mesa_get_log_file(), sh->ir, NULL);
+ } else {
+ _mesa_log("No GLSL IR for shader %d (shader may be from "
+ "cache)\n", sh->Name);
+ }
_mesa_log("\n\n");
} else {
_mesa_log("GLSL shader %d failed to compile.\n", sh->Name);