diff options
author | Brian Paul <[email protected]> | 2009-02-27 12:58:07 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-02-27 12:58:07 -0700 |
commit | c79079895f526828beb0e9e1bb9fc76f4c6e3b9d (patch) | |
tree | bb18edd25157fb50ad1d9b24783ba22a1f429036 | |
parent | 4480e631cdb1d749cc0d921897a5df237ccdf997 (diff) |
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.
(cherry picked from master, commit 75e3ccf6a5b639834bcda0ff6f9035b148fca8f1)
-rw-r--r-- | src/mesa/main/bufferobj.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 59fe8e25def..7fce9e70c07 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -944,8 +944,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 = GL_READ_WRITE_ARB; + bufObj->Pointer = NULL; } ASSERT(ctx->Driver.BufferData); |