Mesa (gallium-0.2): mesa: fix default buffer object access value

Brian Paul brianp at kemper.freedesktop.org
Fri Sep 26 13:37:44 UTC 2008


Module: Mesa
Branch: gallium-0.2
Commit: 6c72bc8089037daed0c471dda62310d1101e08f0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6c72bc8089037daed0c471dda62310d1101e08f0

Author: Brian Paul <brian.paul at tungstengraphics.com>
Date:   Thu Sep 25 11:46:27 2008 -0600

mesa: fix default buffer object access value

---

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

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 6849135..190e6ab 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -38,6 +38,13 @@
 #include "bufferobj.h"
 
 
+#ifdef FEATURE_OES_mapbuffer
+#define DEFAULT_ACCESS GL_WRITE_ONLY;
+#else
+#define DEFAULT_ACCESS GL_READ_WRITE;
+#endif
+
+
 /**
  * Get the buffer object bound to the specified target in a GL context.
  *
@@ -255,7 +262,7 @@ _mesa_initialize_buffer_object( struct gl_buffer_object *obj,
    obj->RefCount = 1;
    obj->Name = name;
    obj->Usage = GL_STATIC_DRAW_ARB;
-   obj->Access = GL_READ_WRITE_ARB;
+   obj->Access = DEFAULT_ACCESS;
 }
 
 
@@ -1065,7 +1072,7 @@ _mesa_UnmapBufferARB(GLenum target)
       status = ctx->Driver.UnmapBuffer( ctx, target, bufObj );
    }
 
-   bufObj->Access = GL_READ_WRITE_ARB; /* initial value, OK? */
+   bufObj->Access = DEFAULT_ACCESS;
    bufObj->Pointer = NULL;
 
    return status;




More information about the mesa-commit mailing list