Merge commit 'origin/master' into gallium-0.2
[mesa.git] / src / mesa / main / bufferobj.c
index 59fe8e25defe464d729505389a0aa332e1527996..016543da01f2b6cb09dda538ffcc0392a498e30d 100644 (file)
 #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;
 }
 
 
@@ -664,8 +671,8 @@ _mesa_map_drawpix_pbo(GLcontext *ctx,
  * \sa _mesa_unmap_bitmap_pbo
  */
 void
-_mesa_unmap_drapix_pbo(GLcontext *ctx,
-                       const struct gl_pixelstore_attrib *unpack)
+_mesa_unmap_drawpix_pbo(GLcontext *ctx,
+                        const struct gl_pixelstore_attrib *unpack)
 {
    if (unpack->BufferObj->Name) {
       ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
@@ -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;