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 19:39:36 +0000 (12:39 -0700)
src/mesa/shader/slang/slang_link.c

index 511e7406159a8015de17d3c3f4604997bb5ab7d1..4361efc56e53f90ecf0cd3be4ee43860ac4a6b0b 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