diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/api_arrayelt.c | 8 |
1 files changed, 8 insertions, 0 deletions
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; } |