mesa: in vbo split code, map buffers read-only, not write-only
authorBrian Paul <brianp@vmware.com>
Wed, 6 May 2009 15:51:56 +0000 (09:51 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 7 May 2009 16:12:32 +0000 (10:12 -0600)
And use GL_ELEMENT_ARRAY_BUFFER where appropriate.

src/mesa/vbo/vbo_split_copy.c

index 5fb66d3318f6c77878c1ac14cfff3d9f0582d9ac..4fc0e36156c89390e833663c9c5a223a6b1ed3bd 100644 (file)
@@ -389,8 +389,8 @@ static void replay_init( struct copy_context *copy )
       
         if (vbo->Name && !vbo->Pointer) 
            ctx->Driver.MapBuffer(ctx,
-                                 GL_ARRAY_BUFFER_ARB, 
-                                 GL_WRITE_ONLY, /* XXX */
+                                 GL_ARRAY_BUFFER,
+                                 GL_READ_ONLY,
                                  vbo);
 
         copy->varying[j].src_ptr = ADD_POINTERS(vbo->Pointer,
@@ -406,8 +406,8 @@ static void replay_init( struct copy_context *copy )
     */
    if (copy->ib->obj->Name && !copy->ib->obj->Pointer) 
       ctx->Driver.MapBuffer(ctx, 
-                           GL_ARRAY_BUFFER_ARB, /* XXX */
-                           GL_WRITE_ONLY, /* XXX */
+                           GL_ELEMENT_ARRAY_BUFFER,
+                           GL_READ_ONLY,
                            copy->ib->obj);
 
    srcptr = (const GLubyte *)ADD_POINTERS(copy->ib->obj->Pointer, copy->ib->ptr);
@@ -509,14 +509,14 @@ static void replay_finish( struct copy_context *copy )
       struct gl_buffer_object *vbo = copy->varying[i].array->BufferObj;
 
       if (vbo->Name && vbo->Pointer) 
-        ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, vbo);
+        ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, vbo);
    }
 
    /* Unmap index buffer:
     */
    if (copy->ib->obj->Name && copy->ib->obj->Pointer) {
       ctx->Driver.UnmapBuffer(ctx, 
-                             GL_ARRAY_BUFFER_ARB, /* XXX */
+                             GL_ELEMENT_ARRAY_BUFFER,
                              copy->ib->obj);
    }
 }