Fix invalid enums passed to MapBuffer
authorAapo Tahkola <aapo@aapo-desktop.(none)>
Thu, 18 Jan 2007 02:17:56 +0000 (04:17 +0200)
committerAapo Tahkola <aapo@aapo-desktop.(none)>
Thu, 18 Jan 2007 02:17:56 +0000 (04:17 +0200)
src/mesa/vbo/vbo_exec_array.c
src/mesa/vbo/vbo_save_api.c
src/mesa/vbo/vbo_split_copy.c

index cec353cf43b520f1ffd7f6618349d7715ff9d8d0..e0a6240c2a6b4bd9745953b3b9017b38c2461bec 100644 (file)
@@ -334,7 +334,7 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *ind
    if (ctx->Array.ElementArrayBufferObj->Name) {
       const GLvoid *map = ctx->Driver.MapBuffer(ctx,
                                                 GL_ELEMENT_ARRAY_BUFFER_ARB,
-                                                GL_DYNAMIC_READ_ARB,
+                                                GL_READ_ONLY,
                                                 ctx->Array.ElementArrayBufferObj);
 
       max_index = get_max_index(count, type, ADD_POINTERS(map, indices));
index f718cdd91a73eb4aa584b243aff25eb72e6d7b6a..c08fd1fe555ba26a9321cd7e6b30c8e11bc7d301 100644 (file)
@@ -198,7 +198,7 @@ static GLfloat *map_vertex_store( GLcontext *ctx, struct vbo_save_vertex_store *
    assert(!vertex_store->buffer);
    vertex_store->buffer = (GLfloat *)ctx->Driver.MapBuffer(ctx, 
                                                           GL_ARRAY_BUFFER_ARB, /* not used */
-                                                          GL_STATIC_DRAW_ARB, /* not used */
+                                                          GL_WRITE_ONLY, /* not used */
                                                           vertex_store->bufferobj); 
 
    assert(vertex_store->buffer);
index 08eae2db40f2d13f18bb9932fed0264297049a08..fff733ccb5384348376d52544f4434bb0836a1f9 100644 (file)
@@ -382,7 +382,7 @@ static void replay_init( struct copy_context *copy )
         if (vbo->Name && !vbo->Pointer) 
            ctx->Driver.MapBuffer(ctx,
                                  GL_ARRAY_BUFFER_ARB, 
-                                 GL_DYNAMIC_DRAW_ARB, /* XXX */
+                                 GL_WRITE_ONLY, /* XXX */
                                  vbo);
 
         copy->varying[j].src_ptr = ADD_POINTERS(vbo->Pointer,
@@ -399,7 +399,7 @@ 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_DYNAMIC_DRAW_ARB, /* XXX */
+                           GL_WRITE_ONLY, /* XXX */
                            copy->ib->obj);
 
    switch (copy->ib->type) {