diff options
author | Keith Whitwell <[email protected]> | 2009-03-09 12:17:28 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-03-09 12:18:51 +0000 |
commit | 0756dc876c01a3d07da34e2da1899b340b0fb819 (patch) | |
tree | a3d078f69763eb1016f6cc2dc4781f70839d2890 /src/mesa/vbo/vbo_exec_api.c | |
parent | a2aedf95d8f6ea7ecff3dc2c2f8db4a20e42e9d0 (diff) |
vbo: stricter checks on Driver.NeedFlush
This variable is being used in the r300 driver to trigger a flush under
circumstances unrelated to the use in the vbo module. Tighten up the
checks in vbo so as to avoid conflict with r300.
Reported by Maciej Cencora <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_exec_api.c')
-rw-r--r-- | src/mesa/vbo/vbo_exec_api.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index a1e66aec63d..6402745ab62 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -748,7 +748,7 @@ void vbo_exec_BeginVertices( GLcontext *ctx ) if (0) _mesa_printf("%s\n", __FUNCTION__); vbo_exec_vtx_map( exec ); - assert(exec->ctx->Driver.NeedFlush == 0); + assert((exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) == 0); exec->ctx->Driver.NeedFlush = FLUSH_UPDATE_CURRENT; } @@ -783,10 +783,12 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) /* Need to do this to ensure BeginVertices gets called again: */ - _mesa_restore_exec_vtxfmt( ctx ); + if (flags & FLUSH_UPDATE_CURRENT) { + assert(exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT); + _mesa_restore_exec_vtxfmt( ctx ); + } - assert(exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT); - exec->ctx->Driver.NeedFlush = 0; + exec->ctx->Driver.NeedFlush &= ~flags; } |