i965: Don't try to dump shader source for fixed-function FS programs.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 26 Feb 2014 06:15:30 +0000 (22:15 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 26 Feb 2014 10:31:24 +0000 (02:31 -0800)
sh->Source is NULL and this will segfault.

Fixes MESA_GLSL=dump with "The Swapper".

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_shader.cpp

index 7034907ebab3eb1b775f65fd059c5613804b2680..173aeb6f6de4c0009ea9723863ce29515511fc08 100644 (file)
@@ -258,7 +258,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
       }
    }
 
-   if (ctx->Shader.Flags & GLSL_DUMP) {
+   if ((ctx->Shader.Flags & GLSL_DUMP) && shProg->Name != 0) {
       for (unsigned i = 0; i < shProg->NumShaders; i++) {
          const struct gl_shader *sh = shProg->Shaders[i];
          if (!sh)