From 81ccb3e2ce708619f4c23537a237d61bdffdd35f Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 13 Oct 2010 11:11:47 -0400 Subject: Drop the "neutral" tnl module Just always check for FLUSH_UPDATE_CURRENT and call Driver.BeginVertices when necessary. By using the unlikely() macros, this ends up as a 10% performance improvement (for isosurf, anyway) over the old, complicated function pointer swapping. --- src/mesa/vbo/vbo_exec_api.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/mesa/vbo/vbo_exec_api.c') diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 5070b35c11..80ca1d866e 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -358,10 +358,12 @@ static void vbo_exec_fixup_vertex( struct gl_context *ctx, #define ATTR( A, N, V0, V1, V2, V3 ) \ do { \ struct vbo_exec_context *exec = &vbo_context(ctx)->exec; \ - \ - if (exec->vtx.active_sz[A] != N) \ - vbo_exec_fixup_vertex(ctx, A, N); \ - \ + \ + if (unlikely(!(exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT))) \ + ctx->Driver.BeginVertices( ctx ); \ + if (unlikely(exec->vtx.active_sz[A] != N)) \ + vbo_exec_fixup_vertex(ctx, A, N); \ + \ { \ GLfloat *dest = exec->vtx.attrptr[A]; \ if (N>0) dest[0] = V0; \ @@ -911,10 +913,8 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint flags ) /* Need to do this to ensure BeginVertices gets called again: */ - if (exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { - _mesa_restore_exec_vtxfmt( ctx ); + if (exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) exec->ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT; - } exec->ctx->Driver.NeedFlush &= ~flags; -- cgit v1.2.3