From: Brian Paul Date: Mon, 31 Aug 2009 14:49:22 +0000 (-0600) Subject: st/mesa: fix obj->Pointer offset in st_bufferobj_map_range() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c69a4dce75d5282fc88f76da5ac0d27e65012727;p=mesa.git st/mesa: fix obj->Pointer offset in st_bufferobj_map_range() This fixes a bunch of gallium regressions since commit 8096aa521369c3bcf5226c060efa6dd06e48ddc8 --- diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 8c1fd5ce025..69dd76d0837 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; }