From: Markus Amsler Date: Mon, 17 Mar 2008 14:35:37 +0000 (-0600) Subject: only set InputsRead bit if input is really used X-Git-Tag: android-x86-1.6~16^2~1465^2~390^2~2246 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f3c490634ffb8cd2c5329ba1ebfe9c738c2b7441;p=android-x86%2Fexternal-mesa.git only set InputsRead bit if input is really used --- diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index e385b9d9973..9e5169eff17 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -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; }