diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2005-02-10 10:55:30 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2005-02-10 10:55:30 +0000 |
commit | a9a4c5489ec12f6aa768d44578c332f654c536ea (patch) | |
tree | 0f50695f7c75616541c2e0b48e8c5a41cfc5fc25 | |
parent | a85eb9c0a7eee87b76fc8deec5081628ed3e2ba8 (diff) | |
download | external_mesa3d-a9a4c5489ec12f6aa768d44578c332f654c536ea.zip external_mesa3d-a9a4c5489ec12f6aa768d44578c332f654c536ea.tar.gz external_mesa3d-a9a4c5489ec12f6aa768d44578c332f654c536ea.tar.bz2 |
Catch no-op vertex buffers consisting only of vertices which will
also appear in a future buffer.
-rw-r--r-- | src/mesa/tnl/t_vtx_exec.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/mesa/tnl/t_vtx_exec.c b/src/mesa/tnl/t_vtx_exec.c index e8700b9..690912d 100644 --- a/src/mesa/tnl/t_vtx_exec.c +++ b/src/mesa/tnl/t_vtx_exec.c @@ -259,28 +259,30 @@ static GLuint _tnl_copy_vertices( GLcontext *ctx ) void _tnl_flush_vtx( GLcontext *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); + GLuint vertex_count = tnl->vtx.initial_counter - tnl->vtx.counter; if (0) _tnl_print_vtx( ctx ); - if (tnl->vtx.prim_count && - tnl->vtx.counter != tnl->vtx.initial_counter) { + if (tnl->vtx.prim_count && vertex_count) { tnl->vtx.copied.nr = _tnl_copy_vertices( ctx ); - if (ctx->NewState) - _mesa_update_state( ctx ); + if (tnl->vtx.copied.nr != vertex_count) { + if (ctx->NewState) + _mesa_update_state( ctx ); - if (tnl->pipeline.build_state_changes) - _tnl_validate_pipeline( ctx ); + if (tnl->pipeline.build_state_changes) + _tnl_validate_pipeline( ctx ); - _tnl_vb_bind_vtx( ctx ); + _tnl_vb_bind_vtx( ctx ); - /* Invalidate all stored data before and after run: - */ - tnl->pipeline.run_input_changes |= tnl->pipeline.inputs; - tnl->Driver.RunPipeline( ctx ); - tnl->pipeline.run_input_changes |= tnl->pipeline.inputs; + /* Invalidate all stored data before and after run: + */ + tnl->pipeline.run_input_changes |= tnl->pipeline.inputs; + tnl->Driver.RunPipeline( ctx ); + tnl->pipeline.run_input_changes |= tnl->pipeline.inputs; + } } tnl->vtx.prim_count = 0; |