diff options
Diffstat (limited to 'src/mesa/tnl/t_imm_dlist.c')
-rw-r--r-- | src/mesa/tnl/t_imm_dlist.c | 47 |
1 files changed, 10 insertions, 37 deletions
diff --git a/src/mesa/tnl/t_imm_dlist.c b/src/mesa/tnl/t_imm_dlist.c index 7218244ae3..9af32dad0f 100644 --- a/src/mesa/tnl/t_imm_dlist.c +++ b/src/mesa/tnl/t_imm_dlist.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_dlist.c,v 1.14 2001/04/30 09:04:00 keithw Exp $ */ +/* $Id: t_imm_dlist.c,v 1.15 2001/04/30 21:08:52 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -95,15 +95,11 @@ _tnl_compile_cassette( GLcontext *ctx, struct immediate *IM ) andflag &= IM->Flag[i]; IM->CopyAndFlag = IM->AndFlag = andflag; } + IM->CopyOrFlag |= ctx->Array._Enabled; } _tnl_fixup_input( ctx, IM ); - /* Mark the last primitive: - */ - IM->PrimitiveLength[IM->LastPrimitive] = IM->Count - IM->LastPrimitive; - ASSERT(IM->Primitive[IM->LastPrimitive] & PRIM_LAST); - /* _tnl_print_cassette( IM ); */ @@ -145,10 +141,9 @@ _tnl_compile_cassette( GLcontext *ctx, struct immediate *IM ) /* Call it full... */ struct immediate *new_im = _tnl_alloc_immediate(ctx); - if (!new_im) return; new_im->ref_count++; - im->ref_count--; /* remove CURRENT_IM reference */ - ASSERT(im->ref_count > 0); + im->ref_count--; /* remove CURRENT_IM reference */ + ASSERT(im->ref_count > 0); /* it is compiled into a display list */ SET_IMMEDIATE( ctx, new_im ); _tnl_reset_input( ctx, IMM_MAX_COPIED_VERTS, new_beginstate, node->SavedBeginState ); @@ -270,41 +265,28 @@ _tnl_BeginCallList( GLcontext *ctx, GLuint list ) } -/* Called at the tail of a CallList. Copy vertices out of the display - * list if necessary. +/* Called at the tail of a CallList. Nothing to do. */ void _tnl_EndCallList( GLcontext *ctx ) { - /* May have to copy vertices from a dangling begin/end inside the - * list to the current immediate. - */ - if (ctx->CallDepth == 0) { - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct immediate *IM = TNL_CURRENT_IM(ctx); - - if (tnl->ExecCopySource != IM) - _tnl_copy_immediate_vertices( ctx, IM ); - } } void _tnl_EndList( GLcontext *ctx ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); struct immediate *IM = TNL_CURRENT_IM(ctx); /* fprintf(stderr, "%s\n", __FUNCTION__); */ ctx->swtnl_im = 0; IM->ref_count--; - if (IM == tnl->ExecCopySource) { - IM->ref_count--; - } else { - if ( --tnl->ExecCopySource->ref_count == 0 ) - _tnl_free_immediate( tnl->ExecCopySource ); - } + + /* outside begin/end, even in COMPILE_AND_EXEC, + * so no vertices to copy, right? + */ + ASSERT(TNL_CONTEXT(ctx)->ExecCopyCount == 0); /* If this one isn't free, get a clean one. (Otherwise we'll be * using one that's already half full). @@ -314,19 +296,10 @@ _tnl_EndList( GLcontext *ctx ) ASSERT(IM->ref_count == 0); - tnl->ExecCopyCount = 0; - tnl->ExecCopySource = IM; - IM->ref_count++; - SET_IMMEDIATE( ctx, IM ); IM->ref_count++; _tnl_reset_input( ctx, IMM_MAX_COPIED_VERTS, 0, 0 ); - - /* outside begin/end, even in COMPILE_AND_EXEC, - * so no vertices to copy, right? - */ - ASSERT(TNL_CONTEXT(ctx)->ExecCopyCount == 0); } |