summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_vtx_api.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2003-12-03 10:15:17 +0000
committerKeith Whitwell <[email protected]>2003-12-03 10:15:17 +0000
commit6ff60049a4ab1abac46e5c8e317b0dd842e088c2 (patch)
tree07710f102d6ac96a780a6a2f69ed69a093ff9439 /src/mesa/tnl/t_vtx_api.c
parent9b0dcfd4080200a35478f2a006969ea529763ed3 (diff)
Ensure PRIM_BEGIN marker isn't lost when incomplete primitives are wrapped.
Diffstat (limited to 'src/mesa/tnl/t_vtx_api.c')
-rw-r--r--src/mesa/tnl/t_vtx_api.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c
index 73849a4dc50..34a77ec40a0 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