Mesa (master): vbo: use FLUSH_UPDATE_CURRENT flag to indicate whether the vbo module is active

Keith Whitwell keithw at kemper.freedesktop.org
Wed Mar 4 15:19:21 UTC 2009


Module: Mesa
Branch: master
Commit: f9ce417aaf14c00e72e92307b910de5dbed1bb6d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9ce417aaf14c00e72e92307b910de5dbed1bb6d

Author: Keith Whitwell <keithw at vmware.com>
Date:   Wed Mar  4 15:15:43 2009 +0000

vbo: use FLUSH_UPDATE_CURRENT flag to indicate whether the vbo module is active

Add asserts for expected values on wakeup and flush.  Remove cases where
this flag is set or cleared except when waking up and flushing vbo module.

---

 src/mesa/vbo/vbo_exec_api.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index c0ffdb5..9c2d065 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -183,8 +183,6 @@ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec )
       _mesa_update_color_material(ctx, 
 				  ctx->Current.Attrib[VBO_ATTRIB_COLOR0]);
    }
-
-   ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
 }
 
 
@@ -204,8 +202,6 @@ static void vbo_exec_copy_from_current( struct vbo_exec_context *exec )
 	 break;
       }
    }
-
-   ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT;
 }
 
 
@@ -346,8 +342,6 @@ static void vbo_exec_fixup_vertex( GLcontext *ctx,
     */
    if (attr == 0) 
       exec->ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
-   else 
-      exec->ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT;
 }
 
 
@@ -750,6 +744,9 @@ void vbo_exec_BeginVertices( GLcontext *ctx )
    struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
    if (0) _mesa_printf("%s\n", __FUNCTION__);
    vbo_exec_vtx_map( exec );
+
+   assert(exec->ctx->Driver.NeedFlush == 0);
+   exec->ctx->Driver.NeedFlush = FLUSH_UPDATE_CURRENT;
 }
 
 void vbo_exec_FlushVertices_internal( GLcontext *ctx, GLboolean unmap )
@@ -785,6 +782,7 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
     */
    _mesa_restore_exec_vtxfmt( ctx );
 
+   assert(exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT);
    exec->ctx->Driver.NeedFlush = 0;
 }
 




More information about the mesa-commit mailing list