glsl: Change _mesa_glsl_parse_state ctor to use gl_shader_stage enum.
[mesa.git] / src / mesa / main / api_arrayelt.c
index 5a316f0c168b59c0fd8715da4eed1eac9ad83bec..c9d4d038f007dd1ac5f512ce4a3ec31b184905d8 100644 (file)
@@ -35,6 +35,7 @@
  */
 
 #include "glheader.h"
+#include "arrayobj.h"
 #include "api_arrayelt.h"
 #include "bufferobj.h"
 #include "context.h"
@@ -1468,6 +1469,18 @@ check_vbo(AEcontext *actx, struct gl_buffer_object *vbo)
 }
 
 
+static inline void
+update_derived_client_arrays(struct gl_context *ctx)
+{
+   struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+
+   if (arrayObj->NewArrays) {
+      _mesa_update_array_object_client_arrays(ctx, arrayObj);
+      arrayObj->NewArrays = 0;
+   }
+}
+
+
 /**
  * Make a list of per-vertex functions to call for each glArrayElement call.
  * These functions access the array data (i.e. glVertex, glColor, glNormal,
@@ -1611,6 +1624,8 @@ _ae_map_vbos(struct gl_context *ctx)
    if (actx->mapped_vbos)
       return;
 
+   update_derived_client_arrays(ctx);
+
    if (actx->NewState)
       _ae_update_state(ctx);
 
@@ -1662,6 +1677,8 @@ _ae_ArrayElement(GLint elt)
    const struct _glapi_table * const disp = GET_DISPATCH();
    GLboolean do_map;
 
+   update_derived_client_arrays(ctx);
+
    /* If PrimitiveRestart is enabled and the index is the RestartIndex
     * then we call PrimitiveRestartNV and return.
     */