From 6d1055c9675fb8c39d3843b550beaa168e031fc9 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 11 May 2001 08:11:31 +0000 Subject: Clean up translation of array elements, copying of elts in pure-elt cassettes. Fixes problem with isosurf/compiled-array-elt/strips. --- src/mesa/tnl/t_imm_api.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/mesa/tnl/t_imm_api.c') diff --git a/src/mesa/tnl/t_imm_api.c b/src/mesa/tnl/t_imm_api.c index c7184c8523..143cee2d48 100644 --- a/src/mesa/tnl/t_imm_api.c +++ b/src/mesa/tnl/t_imm_api.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_api.c,v 1.12 2001/04/30 21:08:52 keithw Exp $ */ +/* $Id: t_imm_api.c,v 1.13 2001/05/11 08:11:31 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -52,6 +52,10 @@ void _tnl_flush_immediate( struct immediate *IM ) { GLcontext *ctx = IM->backref; + if (IM->FlushElt == FLUSH_ELT_EAGER) { + _tnl_translate_array_elts( ctx, IM, IM->LastPrimitive, IM->Count ); + } + /* Mark the last primitive: */ IM->PrimitiveLength[IM->LastPrimitive] = IM->Count - IM->LastPrimitive; @@ -122,9 +126,8 @@ _tnl_begin( GLcontext *ctx, GLenum p ) * when not known to be inside begin/end and arrays are * unlocked. */ - if (IM->FlushElt) { + if (IM->FlushElt == FLUSH_ELT_EAGER) { _tnl_translate_array_elts( ctx, IM, last, count ); - IM->FlushElt = 0; } } @@ -229,7 +232,7 @@ _tnl_hard_begin( GLcontext *ctx, GLenum p ) IM->PrimitiveLength[last] = count - last; IM->LastPrimitive = count; - ASSERT (!IM->FlushElt); + ASSERT (IM->FlushElt != FLUSH_ELT_EAGER); /* This is necessary as this immediate will not be flushed in * _tnl_end() -- we leave it active, hoping to pick up more @@ -305,9 +308,8 @@ _tnl_end( GLcontext *ctx ) IM->Primitive[count] = PRIM_OUTSIDE_BEGIN_END; IM->LastPrimitive = count; - if (IM->FlushElt) { + if (IM->FlushElt == FLUSH_ELT_EAGER) { _tnl_translate_array_elts( ctx, IM, last, count ); - IM->FlushElt = 0; } } @@ -1053,7 +1055,7 @@ _tnl_EvalPoint2( GLint i, GLint j ) IM->Elt[count] = i; \ IM->Flag[count] &= IM->ArrayEltFlags; \ IM->Flag[count] |= VERT_ELT; \ - IM->FlushElt |= IM->ArrayEltFlush; \ + IM->FlushElt = IM->ArrayEltFlush; \ IM->Count += IM->ArrayEltIncr; \ if (IM->Count == IMM_MAXDATA) \ _tnl_flush_immediate( IM ); \ -- cgit v1.2.3