adjust_buffer_object_ref_counts(&ctx->Array, -1);
ctx->Array.ActiveTexture = data->ActiveTexture;
- ctx->Array.LockFirst = data->LockFirst;
- ctx->Array.LockCount = data->LockCount;
+ if (data->LockCount != 0)
+ _mesa_LockArraysEXT(data->LockFirst, data->LockCount);
+ else
+ _mesa_UnlockArraysEXT();
_mesa_BindVertexArrayAPPLE( data->ArrayObj->Name );
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glLockArrays %d %d\n", first, count);
- if (first == 0 && count > 0 &&
- count <= (GLint) ctx->Const.MaxArrayLockSize) {
- ctx->Array.LockFirst = first;
- ctx->Array.LockCount = count;
+ if (first < 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glLockArraysEXT(first)" );
+ return;
}
- else {
- ctx->Array.LockFirst = 0;
- ctx->Array.LockCount = 0;
+ if (count <= 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glLockArraysEXT(count)" );
+ return;
+ }
+ if (ctx->Array.LockCount != 0) {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glLockArraysEXT(reentry)" );
+ return;
}
+ ctx->Array.LockFirst = first;
+ ctx->Array.LockCount = count;
+
ctx->NewState |= _NEW_ARRAY;
ctx->Array.NewState |= _NEW_ARRAY_ALL;
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glUnlockArrays\n");
+ if (ctx->Array.LockCount == 0) {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glUnlockArraysEXT(reexit)" );
+ return;
+ }
+
ctx->Array.LockFirst = 0;
ctx->Array.LockCount = 0;
ctx->NewState |= _NEW_ARRAY;
GLenum type, const GLvoid * const * indices,
GLsizei primcount, GLint modestride );
+extern void GLAPIENTRY
+_mesa_LockArraysEXT(GLint first, GLsizei count);
+
+extern void GLAPIENTRY
+_mesa_UnlockArraysEXT( void );
extern void
_mesa_init_varray( GLcontext * ctx );