mesa/tests: Sanity check the ES2 dispatch table
[mesa.git] / src / mesa / vbo / vbo_split_copy.c
index 40906e389177f229a864f5528eb6aba46b3de5cf..a917f39ca4fa568cb127e6861e4c2fc7e46c7975 100644 (file)
@@ -32,7 +32,7 @@
 #include "main/glheader.h"
 #include "main/bufferobj.h"
 #include "main/imports.h"
-#include "main/image.h"
+#include "main/glformats.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 
@@ -171,6 +171,8 @@ dump_draw_info(struct gl_context *ctx,
 static void
 flush( struct copy_context *copy )
 {
+   struct gl_context *ctx = copy->ctx;
+   const struct gl_client_array **saved_arrays = ctx->Array._DrawArrays;
    GLuint i;
 
    /* Set some counters: 
@@ -189,14 +191,20 @@ flush( struct copy_context *copy )
    (void) dump_draw_info;
 #endif
 
-   copy->draw( copy->ctx,
-              copy->dstarray_ptr,
+   ctx->Array._DrawArrays = copy->dstarray_ptr;
+   ctx->NewDriverState |= ctx->DriverFlags.NewArray;
+
+   copy->draw( ctx,
               copy->dstprim,
               copy->dstprim_nr,
               &copy->dstib,
               GL_TRUE,
               0,
-              copy->dstbuf_nr - 1 );
+              copy->dstbuf_nr - 1,
+              NULL );
+
+   ctx->Array._DrawArrays = saved_arrays;
+   ctx->NewDriverState |= ctx->DriverFlags.NewArray;
 
    /* Reset all pointers: 
     */
@@ -518,6 +526,7 @@ replay_init( struct copy_context *copy )
       dst->Ptr = copy->dstbuf + offset;
       dst->Enabled = GL_TRUE;
       dst->Normalized = src->Normalized; 
+      dst->Integer = src->Integer;
       dst->BufferObj = ctx->Shared->NullBufferObj;
       dst->_ElementSize = src->_ElementSize;
       dst->_MaxElement = copy->dstbuf_size; /* may be less! */