From f896e82301255177894a6c51883e18d32c36b307 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 25 Feb 2014 22:15:30 -0800 Subject: [PATCH] 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 --- src/mesa/drivers/dri/i965/brw_shader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.30.2