vbo: Use the new primitive restart index helper function.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 29 May 2013 15:21:14 +0000 (08:21 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 29 May 2013 21:22:04 +0000 (14:22 -0700)
This gets the correct restart index for unsigned byte/short types when
using GL_PRIMITIVE_RESTART_FIXED_INDEX.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/vbo/vbo_exec_array.c
src/mesa/vbo/vbo_primitive_restart.c

index cadb203c3cf234909e86dca81cc8d838366253ad..9dadd0421c3679daab7f581f44952be69415e658 100644 (file)
@@ -92,7 +92,7 @@ vbo_get_minmax_index(struct gl_context *ctx,
                     const GLuint count)
 {
    const GLboolean restart = ctx->Array._PrimitiveRestart;
-   const GLuint restartIndex = ctx->Array._RestartIndex;
+   const GLuint restartIndex = _mesa_primitive_restart_index(ctx, ib->type);
    const int index_size = vbo_sizeof_ib_type(ib->type);
    const char *indices;
    GLuint i;
index a6a0149ca63521238e2d99800b785d22a6a9393e..418f8829d9b7218e6508d64d3e908da388c99469 100644 (file)
@@ -31,6 +31,7 @@
 #include "main/imports.h"
 #include "main/bufferobj.h"
 #include "main/macros.h"
+#include "main/varray.h"
 
 #include "vbo.h"
 #include "vbo_context.h"
@@ -171,7 +172,7 @@ vbo_sw_primitive_restart(struct gl_context *ctx,
    GLuint sub_prim_num;
    GLuint end_index;
    GLuint sub_end_index;
-   GLuint restart_index = ctx->Array._RestartIndex;
+   GLuint restart_index = _mesa_primitive_restart_index(ctx, ib->type);
    struct _mesa_prim temp_prim;
    struct vbo_context *vbo = vbo_context(ctx);
    vbo_draw_func draw_prims_func = vbo->draw_prims;