summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Amsler <markus.amsler@oribi.org>2008-03-17 08:35:34 -0600
committerBrian <brian.paul@tungstengraphics.com>2008-03-17 08:35:34 -0600
commit0dee2a4f6f92b47614dc10ca63acdbeb13e53e62 (patch)
treee0ab67fa691d88fda40cbdeea86ca4a44c9fe86c
parent3cebc35669e625499eef2469c317c3387166b673 (diff)
only set InputsRead bit if input is really used
-rw-r--r--src/mesa/shader/arbprogparse.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 4de8ccf0873..f74f727b240 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -1609,8 +1609,6 @@ parse_attrib_binding(GLcontext * ctx, const GLubyte ** inst,
program_error(ctx, Program->Position, "Bad attribute binding");
}
- Program->Base.InputsRead |= (1 << *inputReg);
-
return err;
}
@@ -2565,6 +2563,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;
}