From: Kenneth Graunke Date: Wed, 26 Feb 2014 06:15:30 +0000 (-0800) Subject: i965: Don't try to dump shader source for fixed-function FS programs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f896e82301255177894a6c51883e18d32c36b307;p=mesa.git i965: Don't try to dump shader source for fixed-function FS programs. 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 Reviewed-by: Eric Anholt --- diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp index 7034907ebab..173aeb6f6de 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.cpp +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp @@ -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)