st/mesa: implement and advertise GL_ARB_draw_elements_base_vertex
authorMarek Olšák <maraeo@gmail.com>
Sat, 5 Jun 2010 17:32:29 +0000 (19:32 +0200)
committerBrian Paul <brianp@vmware.com>
Tue, 20 Jul 2010 17:53:43 +0000 (11:53 -0600)
Signed-off-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_extensions.c

index 7fdaff45f76b5dcc5d1900e3b90ecd894df803ff..5821da4889d3c9f9a8e21a3994a629aa94223a8c 100644 (file)
@@ -695,7 +695,8 @@ st_draw_vbo(GLcontext *ctx,
             unsigned prim = translate_prim(ctx, prims[i].mode);
 
             if (u_trim_pipe_prim(prims[i].mode, &vcount)) {
-               pipe->draw_range_elements(pipe, indexBuf, indexSize, 0,
+               pipe->draw_range_elements(pipe, indexBuf, indexSize,
+                                         prims[i].basevertex,
                                          min_index, max_index, prim,
                                          prims[i].start + indexOffset, vcount);
             }
@@ -710,7 +711,7 @@ st_draw_vbo(GLcontext *ctx,
                if (prims[i].num_instances == 1) {
                   pipe->draw_elements(pipe, indexBuf,
                                       indexSize,
-                                      0, /* indexBias */
+                                      prims[i].basevertex,
                                       prim,
                                       prims[i].start + indexOffset,
                                       vcount);
@@ -718,7 +719,7 @@ st_draw_vbo(GLcontext *ctx,
                else {
                   pipe->draw_elements_instanced(pipe, indexBuf,
                                                 indexSize,
-                                                0, /* indexBias */
+                                                prims[i].basevertex,
                                                 prim,
                                                 prims[i].start + indexOffset,
                                                 vcount,
index c5326fe0db0b9369e919c4cbea75d0cd24868687..d23ac0c28451cbfc5faabe41c3ad2e03f29cb8a9 100644 (file)
@@ -180,6 +180,7 @@ void st_init_extensions(struct st_context *st)
     * Extensions that are supported by all Gallium drivers:
     */
    ctx->Extensions.ARB_copy_buffer = GL_TRUE;
+   ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE;
    ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
    ctx->Extensions.ARB_fragment_program = GL_TRUE;
    ctx->Extensions.ARB_map_buffer_range = GL_TRUE;