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");
}
}
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);