summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_exec_array.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/vbo/vbo_exec_array.c')
-rw-r--r--src/mesa/vbo/vbo_exec_array.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 8359a7f1529..484e1a85e41 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -96,7 +96,8 @@ vbo_get_minmax_index(struct gl_context *ctx,
if (_mesa_is_bufferobj(ib->obj)) {
const GLvoid *map =
- ctx->Driver.MapBuffer(ctx, GL_READ_ONLY, ib->obj);
+ ctx->Driver.MapBufferRange(ctx, 0, ib->obj->Size, GL_MAP_READ_BIT,
+ ib->obj);
indices = ADD_POINTERS(map, ib->ptr);
} else {
indices = ib->ptr;
@@ -195,7 +196,8 @@ check_array_data(struct gl_context *ctx, struct gl_client_array *array,
if (!array->BufferObj->Pointer) {
/* need to map now */
array->BufferObj->Pointer =
- ctx->Driver.MapBuffer(ctx, GL_READ_ONLY, array->BufferObj);
+ ctx->Driver.MapBufferRange(ctx, 0, array->BufferObj->Size,
+ GL_MAP_READ_BIT, array->BufferObj);
}
data = ADD_POINTERS(data, array->BufferObj->Pointer);
}
@@ -254,9 +256,10 @@ check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType,
GLint i, k;
if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) {
- elemMap = ctx->Driver.MapBuffer(ctx,
- GL_READ_ONLY,
- ctx->Array.ElementArrayBufferObj);
+ elemMap = ctx->Driver.MapBufferRange(ctx, 0,
+ ctx->Array.ElementArrayBufferObj->Size,
+ GL_MAP_READ_BIT,
+ ctx->Array.ElementArrayBufferObj);
elements = ADD_POINTERS(elements, elemMap);
}
@@ -347,7 +350,8 @@ print_draw_arrays(struct gl_context *ctx,
bufName);
if (bufName) {
- GLubyte *p = ctx->Driver.MapBuffer(ctx, GL_READ_ONLY_ARB, bufObj);
+ GLubyte *p = ctx->Driver.MapBufferRange(ctx, 0, bufObj->Size,
+ GL_MAP_READ_BIT, bufObj);
int offset = (int) (GLintptr) exec->array.inputs[i]->Ptr;
float *f = (float *) (p + offset);
int *k = (int *) f;
@@ -710,9 +714,11 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
static void
dump_element_buffer(struct gl_context *ctx, GLenum type)
{
- const GLvoid *map = ctx->Driver.MapBuffer(ctx,
- GL_READ_ONLY,
- ctx->Array.ElementArrayBufferObj);
+ const GLvoid *map =
+ ctx->Driver.MapBufferRange(ctx, 0,
+ ctx->Array.ElementArrayBufferObj->Size,
+ GL_MAP_READ_BIT,
+ ctx->Array.ElementArrayBufferObj);
switch (type) {
case GL_UNSIGNED_BYTE:
{