mesa: fix logic error in GLSL linker when looking for main() shaders
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 10 Nov 2008 17:45:50 +0000 (10:45 -0700)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 10 Nov 2008 21:59:34 +0000 (14:59 -0700)
src/mesa/shader/slang/slang_link.c

index 511e740..4361efc 100644 (file)
@@ -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