summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_inlines.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-01-01 17:12:35 +0100
committerMarek Olšák <[email protected]>2012-01-05 18:29:11 +0100
commit214b87aa0469a12ea72d624cfaee0ca46179ec5f (patch)
tree1ccbe951a20a1443b21343d36749a83eae31fbfd /src/gallium/auxiliary/util/u_inlines.h
parentfb0aa34fab77fe8a7fc3253d5ecf635ce37a21c7 (diff)
gallium: fix behavior of pipe_buffer_map_range
To match what transfer_map returns. Really, subtracting the offset leads to bugs if someone expects it to work exactly like transfer_map. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index 44283909aec..9660cdc6eae 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -252,10 +252,7 @@ pipe_buffer_map_range(struct pipe_context *pipe,
return NULL;
}
- /* Match old screen->buffer_map_range() behaviour, return pointer
- * to where the beginning of the buffer would be:
- */
- return (void *)((char *)map - offset);
+ return map;
}
@@ -374,7 +371,7 @@ pipe_buffer_read(struct pipe_context *pipe,
&src_transfer);
if (map)
- memcpy(data, map + offset, size);
+ memcpy(data, map, size);
pipe_buffer_unmap(pipe, src_transfer);
}