Mesa (gallium-mesa-7.4): mesa: set bufObj->Pointer = NULL after unmapping

Alan Hourihane alanh at kemper.freedesktop.org
Fri Mar 6 11:55:50 UTC 2009


Module: Mesa
Branch: gallium-mesa-7.4
Commit: b65bfde84d2f0d83a432602cda425a63560e4034
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b65bfde84d2f0d83a432602cda425a63560e4034

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

mesa: set bufObj->Pointer = NULL after unmapping

Also, ctx->Driver.UnmapBuffer can never be null, so remove conditional.

(cherry picked from master, commit 67025f789324163a69771436e852975d3acbcd86)

---

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

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 4f1e12f..df90610 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -797,6 +797,8 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
          if (bufObj->Pointer) {
             /* if mapped, unmap it now */
             ctx->Driver.UnmapBuffer(ctx, 0, bufObj);
+            bufObj->Access = GL_READ_WRITE_ARB;
+            bufObj->Pointer = NULL;
          }
 
          unbind(ctx, &ctx->Array.ArrayObj->Vertex.BufferObj, bufObj);
@@ -1068,11 +1070,8 @@ _mesa_UnmapBufferARB(GLenum target)
       return GL_FALSE;
    }
 
-   if (ctx->Driver.UnmapBuffer) {
-      status = ctx->Driver.UnmapBuffer( ctx, target, bufObj );
-   }
-
-   bufObj->Access = GL_READ_WRITE_ARB; /* initial value, OK? */
+   status = ctx->Driver.UnmapBuffer( ctx, target, bufObj );
+   bufObj->Access = GL_READ_WRITE_ARB;
    bufObj->Pointer = NULL;
 
    return status;




More information about the mesa-commit mailing list