From be45255ab1f63c10fefcf2f399ac7d1c9294cf6a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 21 Oct 2010 19:03:38 -0600 Subject: vbo: support for primitive restart We handle splitting of glDrawArrays() calls into two primitives here so that drivers don't have to worry about it. --- src/mesa/vbo/vbo_save_api.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/mesa/vbo/vbo_save_api.c') diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 8d66e14ab3..19c4b15d5f 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -896,6 +896,18 @@ static void GLAPIENTRY _save_Begin( GLenum mode ) } +static void GLAPIENTRY _save_PrimitiveRestartNV( void ) +{ + GLenum curPrim; + GET_CURRENT_CONTEXT( ctx ); + + curPrim = ctx->Driver.CurrentSavePrimitive; + + _save_End(); + _save_Begin(curPrim); +} + + /* Unlike the functions above, these are to be hooked into the vtxfmt * maintained in ctx->ListState, active when the list is known or * suspected to be outside any begin/end primitive. @@ -1003,6 +1015,7 @@ static void _save_vtxfmt_init( struct gl_context *ctx ) vfmt->Color4fv = _save_Color4fv; vfmt->EdgeFlag = _save_EdgeFlag; vfmt->End = _save_End; + vfmt->PrimitiveRestartNV = _save_PrimitiveRestartNV; vfmt->FogCoordfEXT = _save_FogCoordfEXT; vfmt->FogCoordfvEXT = _save_FogCoordfvEXT; vfmt->Indexf = _save_Indexf; -- cgit v1.2.3