only set InputsRead bit if input is really used

This commit is contained in:
Markus Amsler
2008-03-17 08:35:37 -06:00
committed by Brian
parent 9425a702be
commit f3c490634f
+5 -3
View File
@@ -1576,9 +1576,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;
}
@@ -2557,6 +2554,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;
}