summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_exec_api.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-12-01 13:26:15 -0700
committerBrian Paul <[email protected]>2009-12-01 13:27:32 -0700
commitc8cdce665790263bb2142d894a81c87abc4da9fb (patch)
tree5af432e626c7023b11b2b68a42cecaf82da7a98e /src/mesa/vbo/vbo_exec_api.c
parent8c26cefec7ad52c4fa52fd1a89e18f463b85257b (diff)
vbo: make flush recursion check code per-context
This fixes invalid failed assertions when running multi-threaded apps.
Diffstat (limited to 'src/mesa/vbo/vbo_exec_api.c')
-rw-r--r--src/mesa/vbo/vbo_exec_api.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index c90565eae8c..f0a7eeadd0f 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -876,9 +876,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
#ifdef DEBUG
/* debug check: make sure we don't get called recursively */
- static GLuint callDepth = 0;
- callDepth++;
- assert(callDepth == 1);
+ exec->flush_call_depth++;
+ assert(exec->flush_call_depth == 1);
#endif
if (0) _mesa_printf("%s\n", __FUNCTION__);
@@ -886,7 +885,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
if (0) _mesa_printf("%s - inside begin/end\n", __FUNCTION__);
#ifdef DEBUG
- callDepth--;
+ exec->flush_call_depth--;
+ assert(exec->flush_call_depth == 0);
#endif
return;
}
@@ -903,7 +903,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
exec->ctx->Driver.NeedFlush &= ~flags;
#ifdef DEBUG
- callDepth--;
+ exec->flush_call_depth--;
+ assert(exec->flush_call_depth == 0);
#endif
}