From 6ff60049a4ab1abac46e5c8e317b0dd842e088c2 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 3 Dec 2003 10:15:17 +0000 Subject: Ensure PRIM_BEGIN marker isn't lost when incomplete primitives are wrapped. --- src/mesa/tnl/t_vtx_api.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/mesa/tnl/t_vtx_api.c') diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c index 73849a4dc5..34a77ec40a 100644 --- a/src/mesa/tnl/t_vtx_api.c +++ b/src/mesa/tnl/t_vtx_api.c @@ -51,6 +51,8 @@ static void init_attrfv( TNLcontext *tnl ); static void _tnl_wrap_buffers( GLcontext *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); + GLuint last_prim = tnl->vtx.prim[tnl->vtx.prim_count-1].mode; + GLuint last_count = tnl->vtx.prim[tnl->vtx.prim_count-1].count; if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { GLint i = tnl->vtx.prim_count - 1; @@ -72,6 +74,9 @@ static void _tnl_wrap_buffers( GLcontext *ctx ) tnl->vtx.prim[0].start = 0; tnl->vtx.prim[0].count = 0; tnl->vtx.prim_count++; + + if (tnl->vtx.copied.nr == last_count) + tnl->vtx.prim[0].mode |= last_prim & PRIM_BEGIN; } } @@ -1008,18 +1013,16 @@ static void _tnl_End( void ) ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1; + /* Two choices which effect the way vertex attributes are + * carried over (or not) between adjacent primitives. + */ #if 0 - if (tnl->vtx.counter * 2 > tnl->vtx.initial_counter) - _tnl_FlushVertices( ctx, ~0 ); -#endif - - if (tnl->vtx.prim_count == TNL_MAX_PRIM) { -#if 0 + if (tnl->vtx.prim_count == TNL_MAX_PRIM) _tnl_FlushVertices( ctx, ~0 ); #else + if (tnl->vtx.prim_count == TNL_MAX_PRIM) _tnl_flush_vtx( ctx ); #endif - } } else -- cgit v1.2.3