diff options
author | José Fonseca <[email protected]> | 2009-03-03 18:52:51 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-03-03 18:52:51 +0000 |
commit | 004d8f11882c6c149a395cf2e86d5d5fb3fa114b (patch) | |
tree | 24a12be904abf67cf763ff141885eed5fef26fa9 /src/mesa/state_tracker | |
parent | 190db8b4c36bffcaae996538e250eb144242c064 (diff) |
mesa: Massage the interface to more closely resemble ARB_map_buffer_range
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_bufferobjects.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 28e387c399d..526fc958734 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -218,6 +218,7 @@ st_bufferobj_map_range(GLcontext *ctx, GLenum target, struct pipe_context *pipe = st_context(ctx)->pipe; struct st_buffer_object *st_obj = st_buffer_object(obj); GLuint flags = 0; + char *map; if (access & GL_MAP_WRITE_BIT) flags |= PIPE_BUFFER_USAGE_CPU_WRITE; @@ -231,8 +232,12 @@ st_bufferobj_map_range(GLcontext *ctx, GLenum target, if (access & MESA_MAP_NOWAIT_BIT) flags |= PIPE_BUFFER_USAGE_DONTBLOCK; - obj->Pointer = pipe_buffer_map(pipe->screen, st_obj->buffer, flags); - return obj->Pointer; + map = pipe_buffer_map_range(pipe->screen, st_obj->buffer, offset, length, flags); + /* FIXME: some code expects this to point to the buffer start, which means that + * the range might not be respected in all circumstances + */ + obj->Pointer = map ? map - offset : NULL; + return map; } |