mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 02:10:12 +01:00
vbo: make flush recursion check code per-context
This fixes invalid failed assertions when running multi-threaded apps.
This commit is contained in:
parent
8c26cefec7
commit
c8cdce6657
2 changed files with 10 additions and 5 deletions
|
|
@ -138,6 +138,10 @@ struct vbo_exec_context
|
|||
*/
|
||||
const struct gl_client_array *inputs[VERT_ATTRIB_MAX];
|
||||
} array;
|
||||
|
||||
#ifdef DEBUG
|
||||
GLint flush_call_depth;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue