Mesa (master): mesa: fix logic error in GLSL linker when looking for main() shaders

Brian Paul brianp at kemper.freedesktop.org
Mon Nov 10 11:40:11 PST 2008


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

Author: Brian Paul <brian.paul at tungstengraphics.com>
Date:   Mon Nov 10 10:45:50 2008 -0700

mesa: fix logic error in GLSL linker when looking for main() shaders

---

 src/mesa/shader/slang/slang_link.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 511e740..4361efc 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -465,12 +465,17 @@ _slang_link(GLcontext *ctx,
    fragProg = NULL;
    for (i = 0; i < shProg->NumShaders; i++) {
       struct gl_shader *shader = shProg->Shaders[i];
-      if (shader->Type == GL_VERTEX_SHADER && shader->Main)
-         vertProg = vertex_program(shader->Program);
-      else if (shader->Type == GL_FRAGMENT_SHADER && shader->Main)
-         fragProg = fragment_program(shader->Program);
-      else
+      if (shader->Type == GL_VERTEX_SHADER) {
+         if (shader->Main)
+            vertProg = vertex_program(shader->Program);
+      }
+      else if (shader->Type == GL_FRAGMENT_SHADER) {
+         if (shader->Main)
+            fragProg = fragment_program(shader->Program);
+      }
+      else {
          _mesa_problem(ctx, "unexpected shader target in slang_link()");
+      }
    }
 
 #if FEATURE_es2_glsl



More information about the mesa-commit mailing list