st/mesa: support for primitive restart
authorBrian Paul <brianp@vmware.com>
Fri, 22 Oct 2010 01:03:38 +0000 (19:03 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 22 Oct 2010 01:03:38 +0000 (19:03 -0600)
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_extensions.c

index f6f5bb179384bc05841f410fe06ab91fb5cac7fd..5387499eb94c83c479f302ae9efbb2af96f9424c 100644 (file)
@@ -703,6 +703,9 @@ st_draw_vbo(struct gl_context *ctx,
       }
    }
 
+   info.primitive_restart = st->ctx->Array.PrimitiveRestart;
+   info.restart_index = st->ctx->Array.RestartIndex;
+
    /* do actual drawing */
    for (i = 0; i < nr_prims; i++) {
       info.mode = translate_prim( ctx, prims[i].mode );
index 96e4efcafad5c0e278dfb1bf72db71dd3aaa808a..2720f446450ffd3612d1e7db37251e0149341a21 100644 (file)
@@ -432,6 +432,10 @@ void st_init_extensions(struct st_context *st)
       ctx->Extensions.ARB_geometry_shader4 = GL_TRUE;
    }
 
+   if (screen->get_param(screen, PIPE_CAP_PRIMITIVE_RESTART)) {
+      ctx->Extensions.NV_primitive_restart = GL_TRUE;
+   }
+
    if (screen->get_param(screen, PIPE_CAP_DEPTH_CLAMP)) {
       ctx->Extensions.ARB_depth_clamp = GL_TRUE;
    }