summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2006-11-22 15:27:58 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2006-11-22 15:27:58 +0000
commit96c0a6de25de2ba8f9601c13f67c22e1aff17b29 (patch)
treef891c1e4b6e8cb693e646020bc42fcf63de6729e /src
parentb72fbcbe63bd53460da07ce840094924f04d38e0 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/api_arrayelt.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index 49aa427d1a..1899975213 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;
+ }
}