From 96c0a6de25de2ba8f9601c13f67c22e1aff17b29 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 22 Nov 2006 15:27:58 +0000 Subject: [PATCH] Prune incoming state to the atoms of interest. Hopefully this will prevent driver-initiated statechanges in the middle of DrawElements/DrawArrays from disturbing this code. --- src/mesa/main/api_arrayelt.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index 49aa427d1a3..1899975213f 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -1299,11 +1299,19 @@ void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ) { AEcontext *actx = AE_CONTEXT(ctx); - /* It is possible to raise a statechange between begin/end pairs as - * the glMaterial calls will raise _NEW_LIGHT eventually. However, - * within a DrawArrays or DrawElements call (which cannot emit - * material data), it should never be possible. + + /* Only interested in this subset of mesa state. Need to prune + * this down as both tnl/ and the drivers can raise statechanges + * for arcane reasons in the middle of seemingly atomic operations + * like DrawElements, over which we'd like to keep a known set of + * arrays and vbo's mapped. + * + * Luckily, neither the drivers nor tnl muck with the state that + * concerns us here: */ - assert(!actx->mapped_vbos); - actx->NewState |= new_state; + new_state &= _NEW_ARRAY | _NEW_PROGRAM; + if (new_state) { + assert(!actx->mapped_vbos); + actx->NewState |= new_state; + } } -- 2.30.2