do not import arrays for generic arb attribs if the array is not enabled (same as...
authorRoland Scheidegger <rscheidegger@gmx.ch>
Sat, 7 Oct 2006 01:04:49 +0000 (01:04 +0000)
committerRoland Scheidegger <rscheidegger@gmx.ch>
Sat, 7 Oct 2006 01:04:49 +0000 (01:04 +0000)
src/mesa/tnl/t_array_import.c

index 0677a1f..13c5689 100644 (file)
@@ -327,9 +327,10 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLint end)
       }
       else if (index >= VERT_ATTRIB_GENERIC1 &&
                index <= VERT_ATTRIB_GENERIC15) {
-         if (program && !program->IsNVProgram) {
+         const GLuint arrayIndex = index - VERT_ATTRIB_GENERIC0;
+         if (program && !program->IsNVProgram &&
+            ctx->Array.ArrayObj->VertexAttrib[arrayIndex].Enabled) {
             /* GL_ARB_vertex_program: bind a generic attribute array */
-            const GLuint arrayIndex = index - VERT_ATTRIB_GENERIC0;
             _tnl_import_attrib(ctx, arrayIndex, GL_FALSE, GL_TRUE);
             VB->AttribPtr[index] = &tmp->Attribs[arrayIndex];
          }