only set InputsRead bit if input is really used
authorMarkus Amsler <markus.amsler@oribi.org>
Mon, 17 Mar 2008 14:35:27 +0000 (08:35 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Mon, 17 Mar 2008 14:35:27 +0000 (08:35 -0600)
src/mesa/shader/arbprogparse.c

index 10fa196..8803658 100644 (file)
@@ -1616,8 +1616,6 @@ parse_attrib_binding(GLcontext * ctx, const GLubyte ** inst,
 
    if (err) {
       program_error(ctx, Program->Position, "Bad attribute binding");
-   } else {
-       Program->Base.InputsRead |= (1 << *inputReg);
    }
 
    return err;
@@ -2574,6 +2572,11 @@ parse_src_reg (GLcontext * ctx, const GLubyte ** inst,
          return 1;
    }
 
+   /* Add attributes to InputsRead only if they are used the program.
+    * This avoids the handling of unused ATTRIB declarations in the drivers. */
+   if (*File == PROGRAM_INPUT)
+      Program->Base.InputsRead |= (1 << *Index);
+
    return 0;
 }