From 2369f14245222a9c073846baa1bb03e23aa37c15 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 6 May 2009 09:51:56 -0600 Subject: [PATCH] mesa: in vbo split code, map buffers read-only, not write-only And use GL_ELEMENT_ARRAY_BUFFER where appropriate. --- src/mesa/vbo/vbo_split_copy.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index 5fb66d3318f..4fc0e36156c 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -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); } } -- 2.30.2