mesa: remove _mesa_index_buffer::index_size in favor of index_size_shift
[mesa.git] / src / mesa / tnl / t_rebase.c
index d28512423c3f5e4d5f304e4623fbcacbef4ad7b2..54d39df733ba207b55607cface35fc31d2ce3c65 100644 (file)
@@ -48,6 +48,7 @@
 
 #include <stdio.h>
 #include "main/bufferobj.h"
+#include "main/errors.h"
 #include "main/glheader.h"
 #include "main/imports.h"
 #include "main/mtypes.h"
@@ -103,16 +104,18 @@ REBASE(GLubyte)
  *      all or nothing.
  */
 void t_rebase_prims( struct gl_context *ctx,
-                     const struct gl_vertex_array *arrays,
+                     const struct tnl_vertex_array *arrays,
                      const struct _mesa_prim *prim,
                      GLuint nr_prims,
                      const struct _mesa_index_buffer *ib,
                      GLuint min_index,
                      GLuint max_index,
+                     GLuint num_instances,
+                     GLuint base_instance,
                      tnl_draw_func draw )
 {
    struct gl_array_attributes tmp_attribs[VERT_ATTRIB_MAX];
-   struct gl_vertex_array tmp_arrays[VERT_ATTRIB_MAX];
+   struct tnl_vertex_array tmp_arrays[VERT_ATTRIB_MAX];
 
    struct _mesa_index_buffer tmp_ib;
    struct _mesa_prim *tmp_prims = NULL;
@@ -162,14 +165,14 @@ void t_rebase_prims( struct gl_context *ctx,
       /* Some users might prefer it if we translated elements to
        * GLuints here.  Others wouldn't...
        */
-      switch (ib->index_size) {
-      case 4:
+      switch (ib->index_size_shift) {
+      case 2:
         tmp_indices = rebase_GLuint( ptr, ib->count, min_index );
         break;
-      case 2:
+      case 1:
         tmp_indices = rebase_GLushort( ptr, ib->count, min_index );
         break;
-      case 1:
+      case 0:
         tmp_indices = rebase_GLubyte( ptr, ib->count, min_index );
         break;
       }      
@@ -184,7 +187,7 @@ void t_rebase_prims( struct gl_context *ctx,
       tmp_ib.obj = ctx->Shared->NullBufferObj;
       tmp_ib.ptr = tmp_indices;
       tmp_ib.count = ib->count;
-      tmp_ib.index_size = ib->index_size;
+      tmp_ib.index_size_shift = ib->index_size_shift;
 
       ib = &tmp_ib;
    }
@@ -241,7 +244,8 @@ void t_rebase_prims( struct gl_context *ctx,
         GL_TRUE,
         0, 
         max_index - min_index,
-        NULL, 0, NULL );
+         num_instances, base_instance,
+        NULL, 0);
 
    free(tmp_indices);