mesa: move num_instances and base_instance out of _mesa_prim
[mesa.git] / src / mesa / tnl / t_split_copy.c
index 085ae9a28c939c118e6d2b26e48fcaea8c40c96b..45b20fbd49c816884f18edb83fdb0a8cbe3dc797 100644 (file)
@@ -105,13 +105,6 @@ struct copy_context {
 };
 
 
-static GLuint
-attr_size(const struct gl_array_attributes *attrib)
-{
-   return attrib->Size * _mesa_sizeof_type(attrib->Type);
-}
-
-
 /**
  * Shallow copy one vertex array to another.
  */
@@ -176,7 +169,7 @@ dump_draw_info(struct gl_context *ctx,
          const GLubyte *ptr = _mesa_vertex_attrib_address(attrib, binding);
          printf("    array %d at %p:\n", j, (void*) &arrays[j]);
          printf("      ptr %p, size %d, type 0x%x, stride %d\n",
-                ptr, attrib->Size, attrib->Type, binding->Stride);
+                ptr, attrib->Format.Size, attrib->Format.Type, binding->Stride);
          if (0) {
             GLint k = prims[i].start + prims[i].count - 1;
             GLfloat *last = (GLfloat *) (ptr + binding->Stride * k);
@@ -218,7 +211,9 @@ flush(struct copy_context *copy)
               GL_TRUE,
               0,
               copy->dstbuf_nr - 1,
-              NULL, 0, NULL);
+              1,
+              0,
+              NULL, 0);
 
    /* Reset all pointers:
     */
@@ -244,7 +239,6 @@ begin(struct copy_context *copy, GLenum mode, GLboolean begin_flag)
 
    prim->mode = mode;
    prim->begin = begin_flag;
-   prim->num_instances = 1;
 }
 
 
@@ -276,7 +270,7 @@ elt(struct copy_context *copy, GLuint elt_idx)
          csr += copy->varying[i].size;
 
 #ifdef NAN_CHECK
-         if (srcarray->Type == GL_FLOAT) {
+         if (srcarray->Format.Type == GL_FLOAT) {
             GLuint k;
             GLfloat *f = (GLfloat *) srcptr;
             for (k = 0; k < srcarray->Size; k++) {
@@ -458,8 +452,8 @@ replay_init(struct copy_context *copy)
 
          copy->varying[j].attr = i;
          copy->varying[j].array = &copy->array[i];
-         copy->varying[j].size = attr_size(attrib);
-         copy->vertex_size += attr_size(attrib);
+         copy->varying[j].size = attrib->Format._ElementSize;
+         copy->vertex_size += attrib->Format._ElementSize;
 
          if (_mesa_is_bufferobj(vbo) &&
              !_mesa_bufferobj_mapped(vbo, MAP_INTERNAL))
@@ -535,16 +529,10 @@ replay_init(struct copy_context *copy)
       struct gl_vertex_buffer_binding *dstbind = &copy->varying[i].dstbinding;
       struct gl_array_attributes *dstattr = &copy->varying[i].dstattribs;
 
-      dstattr->Size = srcattr->Size;
-      dstattr->Type = srcattr->Type;
-      dstattr->Format = GL_RGBA;
-      dstbind->Stride = copy->vertex_size;
+      dstattr->Format = srcattr->Format;
       dstattr->Ptr = copy->dstbuf + offset;
-      dstattr->Normalized = srcattr->Normalized;
-      dstattr->Integer = srcattr->Integer;
-      dstattr->Doubles = srcattr->Doubles;
+      dstbind->Stride = copy->vertex_size;
       dstbind->BufferObj = ctx->Shared->NullBufferObj;
-      dstattr->_ElementSize = srcattr->_ElementSize;
       dst->BufferBinding = dstbind;
       dst->VertexAttrib = dstattr;