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

Ian Romanick idr at kemper.freedesktop.org
Thu Feb 27 21:05:08 UTC 2014


Module: Mesa
Branch: 10.1
Commit: 09b03dcee6c27af5bf5ef05f50773f2be0769892
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=09b03dcee6c27af5bf5ef05f50773f2be0769892

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>
(cherry picked from commit f896e82301255177894a6c51883e18d32c36b307)

---

 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 739c516..43ae560 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