Mesa (master): mesa: if a buffer object is mapped when glDeleteBuffers() is called, unmap it

Brian Paul brianp at kemper.freedesktop.org
Fri Feb 27 20:05:04 UTC 2009


Module: Mesa
Branch: master
Commit: a7f434b486187129ae8d5507170c42a9ce750258
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a7f434b486187129ae8d5507170c42a9ce750258

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Feb 27 13:04:38 2009 -0700

mesa: if a buffer object is mapped when glDeleteBuffers() is called, unmap it

---

 src/mesa/main/bufferobj.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 1f41565..8df0a5b 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -793,6 +793,11 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
 
          ASSERT(bufObj->Name == ids[i]);
 
+         if (bufObj->Pointer) {
+            /* if mapped, unmap it now */
+            ctx->Driver.UnmapBuffer(ctx, 0, bufObj);
+         }
+
          /* unbind any vertex pointers bound to this buffer */
          unbind(ctx, &ctx->Array.ArrayObj->Vertex.BufferObj, bufObj);
          unbind(ctx, &ctx->Array.ArrayObj->Normal.BufferObj, bufObj);




More information about the mesa-commit mailing list