mesa: call update_array_format() after error checking
authorBrian Paul <brianp@vmware.com>
Mon, 11 Nov 2013 22:06:13 +0000 (15:06 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 12 Nov 2013 18:05:19 +0000 (11:05 -0700)
We try to do all error checking before changing any GL state.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Jordan Justen <jordan.l.justen@intel.com>

src/mesa/main/varray.c

index d17d698..0f38270 100644 (file)
@@ -390,11 +390,6 @@ update_array(struct gl_context *ctx,
       return;
    }
 
-   if (!update_array_format(ctx, func, attrib, legalTypesMask, sizeMin, sizeMax,
-                            size, type, normalized, integer, 0)) {
-      return;
-   }
-
    if (stride < 0) {
       _mesa_error( ctx, GL_INVALID_VALUE, "%s(stride=%d)", func, stride );
       return;
@@ -418,6 +413,11 @@ update_array(struct gl_context *ctx,
       return;
    }
 
+   if (!update_array_format(ctx, func, attrib, legalTypesMask, sizeMin,
+                            sizeMax, size, type, normalized, integer, 0)) {
+      return;
+   }
+
    /* Reset the vertex attrib binding */
    vertex_attrib_binding(ctx, attrib, attrib);