aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_exec_api.c
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-10-13 11:11:47 -0400
committerKristian Høgsberg <[email protected]>2010-10-14 08:53:59 -0400
commit81ccb3e2ce708619f4c23537a237d61bdffdd35f (patch)
tree5f98c3b1fce750b949191044ddf75b03a5e03da6 /src/mesa/vbo/vbo_exec_api.c
parentd6de1f44a0cdcc739d3b319b5f102e1733e5b4e3 (diff)
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.
Diffstat (limited to 'src/mesa/vbo/vbo_exec_api.c')
-rw-r--r--src/mesa/vbo/vbo_exec_api.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 5070b35c11d..80ca1d866e7 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;