glsl2: Don't try to dump GLSL IR for a shader that didn't compile.
authorEric Anholt <eric@anholt.net>
Thu, 5 Aug 2010 05:57:08 +0000 (22:57 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 5 Aug 2010 16:17:45 +0000 (09:17 -0700)
src/mesa/program/ir_to_mesa.cpp

index f0e0133..74996ae 100644 (file)
@@ -2646,9 +2646,11 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
       printf("GLSL source for shader %d:\n", shader->Name);
       printf("%s\n", shader->Source);
 
-      printf("GLSL IR for shader %d:\n", shader->Name);
-      _mesa_print_ir(shader->ir, NULL);
-      printf("\n\n");
+      if (shader->CompileStatus) {
+        printf("GLSL IR for shader %d:\n", shader->Name);
+        _mesa_print_ir(shader->ir, NULL);
+        printf("\n\n");
+      }
    }
 
    /* Retain any live IR, but trash the rest. */