diff options
author | Brian Paul <brianp@vmware.com> | 2009-08-31 08:49:22 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-08-31 08:49:24 -0600 |
commit | c69a4dce75d5282fc88f76da5ac0d27e65012727 (patch) | |
tree | bcab32c274443dbc17773cb0958af794a7d7d480 | |
parent | 241c3a1d8001fc5a30e2af4b4636b48e6f99690a (diff) |
st/mesa: fix obj->Pointer offset in st_bufferobj_map_range()
This fixes a bunch of gallium regressions since
commit 8096aa521369c3bcf5226c060efa6dd06e48ddc8
-rw-r--r-- | src/mesa/state_tracker/st_cb_bufferobjects.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 8c1fd5ce02..69dd76d083 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -228,7 +228,6 @@ 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); uint flags = 0x0; - char *map; if (access & GL_MAP_WRITE_BIT) flags |= PIPE_BUFFER_USAGE_CPU_WRITE; @@ -250,14 +249,15 @@ st_bufferobj_map_range(GLcontext *ctx, GLenum target, assert(offset < obj->Size); assert(offset + length <= obj->Size); - map = obj->Pointer = pipe_buffer_map_range(pipe->screen, st_obj->buffer, offset, length, flags); - if(obj->Pointer) { + obj->Pointer = pipe_buffer_map_range(pipe->screen, st_obj->buffer, offset, length, flags); + if (obj->Pointer) { + obj->Pointer = (ubyte *) obj->Pointer + offset; obj->Offset = offset; obj->Length = length; - map += offset; + obj->AccessFlags = access; } - return map; + return obj->Pointer; } |