summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
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/drivers
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/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_link.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index e528411f756..02151d681eb 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -183,10 +183,16 @@ process_glsl_ir(struct brw_context *brw,
if (ctx->_Shader->Flags & GLSL_DUMP) {
fprintf(stderr, "\n");
- fprintf(stderr, "GLSL IR for linked %s program %d:\n",
- _mesa_shader_stage_to_string(shader->Stage),
- shader_prog->Name);
- _mesa_print_ir(stderr, shader->ir, NULL);
+ if (shader->ir) {
+ fprintf(stderr, "GLSL IR for linked %s program %d:\n",
+ _mesa_shader_stage_to_string(shader->Stage),
+ shader_prog->Name);
+ _mesa_print_ir(stderr, shader->ir, NULL);
+ } else {
+ fprintf(stderr, "No GLSL IR for linked %s program %d (shader may be "
+ "from cache)\n", _mesa_shader_stage_to_string(shader->Stage),
+ shader_prog->Name);
+ }
fprintf(stderr, "\n");
}
}