summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/arbprogparse.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 810a7b8f3e4..0984d881723 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -1496,10 +1496,16 @@ generic_attrib_check(struct var_cache *vc_head)
curr = vc_head;
while (curr) {
if (curr->type == vt_attrib) {
- if (curr->attrib_is_generic)
- genericAttrib[ curr->attrib_binding ] = GL_TRUE;
- else
+ if (curr->attrib_is_generic) {
+ GLuint attr = (curr->attrib_binding == 0)
+ ? 0 : (curr->attrib_binding - VERT_ATTRIB_GENERIC0);
+ assert(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
+ genericAttrib[attr] = GL_TRUE;
+ }
+ else {
+ assert(curr->attrib_binding < MAX_VERTEX_PROGRAM_ATTRIBS);
explicitAttrib[ curr->attrib_binding ] = GL_TRUE;
+ }
}
curr = curr->next;