summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-11-15 08:47:58 -0700
committerBrian Paul <brianp@vmware.com>2010-11-15 08:53:12 -0700
commit3db8f85446328909c10bb79592c0142bdead4c9a (patch)
treec3d1b2a66ce465c2888f2f2ee6dd5e107ac6183c
parent3e4ed3879102878ee880d739e17253ce4ab789be (diff)
mesa: fix glDeleteBuffers() regression
This fixes a regression (failed assertion) from commit c552f273f559968dfd770367e25329baccbcd0c4 which was hit if glDeleteBuffers() was called on a buffer that was never bound. NOTE: this is a candidate for the 7.9 branch. (cherry picked from commit 78587ea0122d34e13c078d095aa5b730ce24bb73)
-rw-r--r--src/mesa/main/bufferobj.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 967bdf9acd0..d9eaadaeb9c 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1004,7 +1004,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
GLuint j;
- ASSERT(bufObj->Name == ids[i]);
+ ASSERT(bufObj->Name == ids[i] || bufObj == &DummyBufferObject);
if (_mesa_bufferobj_mapped(bufObj)) {
/* if mapped, unmap it now */
@@ -1045,7 +1045,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
}
/* The ID is immediately freed for re-use */
- _mesa_HashRemove(ctx->Shared->BufferObjects, bufObj->Name);
+ _mesa_HashRemove(ctx->Shared->BufferObjects, ids[i]);
_mesa_reference_buffer_object(ctx, &bufObj, NULL);
}
}