glx: Trivial clean-ups to __glXSetArrayEnable
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 15 Jul 2008 18:06:04 +0000 (11:06 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 15 Jul 2008 18:06:04 +0000 (11:06 -0700)
src/glx/x11/indirect_vertex_array.c

index 09d7244ba9243348141a04bcb8e9dbaa3efa6ee0..769c88f4d261f5ad70997c7a7b46447ed3cf6a35 100644 (file)
@@ -1601,17 +1601,21 @@ void __indirect_glClientActiveTextureARB(GLenum texture)
 
 
 /**
+ * Modify the enable state for the selected array
  */
 GLboolean
-__glXSetArrayEnable( __GLXattribute * state,
-                    GLenum key, unsigned index, GLboolean enable )
+__glXSetArrayEnable(__GLXattribute *state, GLenum key, unsigned index,
+                    GLboolean enable)
 {
     struct array_state_vector * arrays = state->array_state;
     struct array_state * a;
     
 
-    if ( key == GL_TEXTURE_COORD_ARRAY ) {
-       index = arrays->active_texture_unit;
+    /* Texture coordinate arrays have an implict index set when the
+     * application calls glClientActiveTexture.
+     */
+    if (key == GL_TEXTURE_COORD_ARRAY) {
+        index = arrays->active_texture_unit;
     }
 
     a = get_array_entry( arrays, key, index );