Commit 20bf14be authored by Keith Whitwell's avatar Keith Whitwell
Browse files

util: fix up several uses of pipe_map_buffer_range

This function used to return a pointer to where the start of the
actual buffer would have been, even though only the requested range is
being mapped.

In the resources change, the function was modified to use a transfer
internally, and started returning the pointer to the beginning of the
transfer, ie the mapped range.

Some users of the function were changed to reflect this new behaviour,
some were not.  Since then the function has reverted to its original
behaviour, matching master.

This change restores some of the users of the map_buffer_range helper
to expect the old/original behaviour.
parent 33179a86
......@@ -179,8 +179,10 @@ pipe_buffer_map_range(struct pipe_context *pipe,
return NULL;
map = pipe->transfer_map( pipe, *transfer );
if (map == NULL)
if (map == NULL) {
pipe->transfer_destroy( pipe, *transfer );
return NULL;
/* Match old screen->buffer_map_range() behaviour, return pointer
* to where the beginning of the buffer would be:
......@@ -298,7 +300,7 @@ pipe_buffer_read(struct pipe_context *pipe,
if (map)
memcpy(data, map, size);
memcpy(data, map + offset, size);
pipe_buffer_unmap(pipe, buf, src_transfer);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment