From: Brian Paul Date: Fri, 27 Feb 2009 19:30:21 +0000 (-0700) Subject: mesa: fix incorrect error handling in glBufferDataARB() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=75e3ccf6a5b639834bcda0ff6f9035b148fca8f1;p=mesa.git mesa: fix incorrect error handling in glBufferDataARB() If glBufferDataARB() is called while a buffer object is currently mapped we're supposed to unmap the current buffer, then replace it. Don't generate an error. --- diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 016543da01f..e4bdc6f1e79 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -951,8 +951,10 @@ _mesa_BufferDataARB(GLenum target, GLsizeiptrARB size, } if (bufObj->Pointer) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBufferDataARB(buffer is mapped)" ); - return; + /* Unmap the existing buffer. We'll replace it now. Not an error. */ + ctx->Driver.UnmapBuffer(ctx, target, bufObj); + bufObj->Access = DEFAULT_ACCESS; + bufObj->Pointer = NULL; } ASSERT(ctx->Driver.BufferData);