diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2005-01-22 14:38:00 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2005-01-22 14:38:00 +0000 |
commit | 36a35c5614336bffdac4827c1e04bcaa8ab2fa27 (patch) | |
tree | e7a41d044ac2998fe23e89b0f36868de67fa05d1 /src/mesa/tnl | |
parent | 8fca9bdc35bfb5220012cfa5041504b0a05d2440 (diff) |
Determine ahead of time whether a display list will include vertices
which have to be processed in the 'loopback' path. If so, send
all vertices that way as the transition from playback->loopback has
several problems.
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r-- | src/mesa/tnl/t_context.h | 1 | ||||
-rw-r--r-- | src/mesa/tnl/t_save_api.c | 20 | ||||
-rw-r--r-- | src/mesa/tnl/t_save_api.h | 2 | ||||
-rw-r--r-- | src/mesa/tnl/t_save_playback.c | 9 |
4 files changed, 19 insertions, 13 deletions
diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 2d99c8576f..56fc2013dc 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -364,6 +364,7 @@ struct tnl_save { GLfloat *buffer; GLuint count; GLuint wrap_count; + GLuint replay_flags; struct tnl_prim *prim; GLuint prim_count, prim_max; diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c index 81b68f77be..6e737f400f 100644 --- a/src/mesa/tnl/t_save_api.c +++ b/src/mesa/tnl/t_save_api.c @@ -248,7 +248,6 @@ static void _save_compile_vertex_list( GLcontext *ctx ) node->prim_count = tnl->save.prim_count; node->vertex_store = tnl->save.vertex_store; node->prim_store = tnl->save.prim_store; - node->dangling_attr_ref = tnl->save.dangling_attr_ref; node->normal_lengths = 0; node->vertex_store->refcount++; @@ -257,13 +256,17 @@ static void _save_compile_vertex_list( GLcontext *ctx ) assert(node->attrsz[_TNL_ATTRIB_POS] != 0 || node->count == 0); + if (tnl->save.dangling_attr_ref) + ctx->ListState.CurrentList->flags |= MESA_DLIST_DANGLING_REFS; + /* Maybe calculate normal lengths: */ if (tnl->CalcDListNormalLengths && node->attrsz[_TNL_ATTRIB_NORMAL] == 3 && - !node->dangling_attr_ref) + !(ctx->ListState.CurrentList->flags & MESA_DLIST_DANGLING_REFS)) build_normal_lengths( node ); + tnl->save.vertex_store->used += tnl->save.vertex_size * node->count; tnl->save.prim_store->used += node->prim_count; @@ -1189,8 +1192,6 @@ static void GLAPIENTRY _save_Indexfv( const GLfloat *f ) do { \ TNLcontext *tnl = TNL_CONTEXT(ctx); \ \ - /*fprintf(stderr, "fallback %s inside begin/end\n", __FUNCTION__);*/ \ - \ if (tnl->save.initial_counter != tnl->save.counter || \ tnl->save.prim_count) \ _save_compile_vertex_list( ctx ); \ @@ -1577,14 +1578,19 @@ void _tnl_EndList( GLcontext *ctx ) assert(TNL_CONTEXT(ctx)->save.vertex_size == 0); } -void _tnl_BeginCallList( GLcontext *ctx, GLuint list ) +void _tnl_BeginCallList( GLcontext *ctx, struct mesa_display_list *dlist ) { - (void) ctx; (void) list; + TNLcontext *tnl = TNL_CONTEXT(ctx); + tnl->save.replay_flags |= dlist->flags; + tnl->save.replay_flags |= tnl->LoopbackDListCassettes; } void _tnl_EndCallList( GLcontext *ctx ) { - (void) ctx; + TNLcontext *tnl = TNL_CONTEXT(ctx); + + if (ctx->ListState.CallDepth == 1) + tnl->save.replay_flags = 0; } diff --git a/src/mesa/tnl/t_save_api.h b/src/mesa/tnl/t_save_api.h index eec2d685b0..8ffb7f5733 100644 --- a/src/mesa/tnl/t_save_api.h +++ b/src/mesa/tnl/t_save_api.h @@ -43,7 +43,7 @@ extern void _tnl_EndList( GLcontext *ctx ); extern void _tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode ); extern void _tnl_EndCallList( GLcontext *ctx ); -extern void _tnl_BeginCallList( GLcontext *ctx, GLuint list ); +extern void _tnl_BeginCallList( GLcontext *ctx, struct mesa_display_list *list ); extern void _tnl_SaveFlushVertices( GLcontext *ctx ); diff --git a/src/mesa/tnl/t_save_playback.c b/src/mesa/tnl/t_save_playback.c index 26c77bd7d8..d5fcbe6c02 100644 --- a/src/mesa/tnl/t_save_playback.c +++ b/src/mesa/tnl/t_save_playback.c @@ -178,7 +178,7 @@ void _tnl_playback_vertex_list( GLcontext *ctx, void *data ) if (node->prim_count > 0 && node->count > 0) { if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END && - (node->prim[0].mode & PRIM_BEGIN)) { + (node->prim[0].mode & PRIM_BEGIN)) { /* Degenerate case: list is called inside begin/end pair and * includes operations such as glBegin or glDrawArrays. @@ -187,10 +187,9 @@ void _tnl_playback_vertex_list( GLcontext *ctx, void *data ) _tnl_loopback_vertex_list( ctx, node ); return; } - else if (tnl->LoopbackDListCassettes || - node->dangling_attr_ref) { - /* Degenerate case: list references current data and would - * require fixup. Take the easier option & loop it back. + else if (tnl->save.replay_flags) { + /* Various degnerate cases: translate into immediate mode + * calls rather than trying to execute in place. */ _tnl_loopback_vertex_list( ctx, node ); return; |