From 3db8f85446328909c10bb79592c0142bdead4c9a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 15 Nov 2010 08:47:58 -0700 Subject: [PATCH 30/31] 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) --- src/mesa/main/bufferobj.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 967bdf9..d9eaada 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); } } -- 1.7.3.2