From b72fbcbe63bd53460da07ce840094924f04d38e0 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 22 Nov 2006 13:53:21 +0000 Subject: [PATCH] Another fix --- src/mesa/main/api_arrayelt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index b3c33f2a79f..49aa427d1a3 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -1076,6 +1076,7 @@ static void check_vbo( AEcontext *actx, for (i = 0; i < actx->nr_vbos; i++) if (actx->vbo[i] == vbo) return; + assert(actx->nr_vbos < VERT_ATTRIB_MAX); actx->vbo[actx->nr_vbos++] = vbo; } } @@ -1094,6 +1095,8 @@ static void _ae_update_state( GLcontext *ctx ) AEattrib *at = actx->attribs; GLuint i; + actx->nr_vbos = 0; + /* conventional vertex arrays */ if (ctx->Array.ArrayObj->Index.Enabled) { aa->array = &ctx->Array.ArrayObj->Index; @@ -1296,6 +1299,11 @@ 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. + */ assert(!actx->mapped_vbos); actx->NewState |= new_state; } -- 2.30.2