Mesa (master): i965: Don' t try to dump shader source for fixed-function FS programs.

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Feb 26 10:28:01 UTC 2014


Module: Mesa
Branch: master
Commit: f896e82301255177894a6c51883e18d32c36b307
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f896e82301255177894a6c51883e18d32c36b307

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Feb 25 22:15:30 2014 -0800

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 at lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 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 7034907..173aeb6 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)




More information about the mesa-commit mailing list