diff options
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_inlines.h | 7 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_upload_mgr.c | 4 |
2 files changed, 5 insertions, 6 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); } diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c index a2319d0c436..936e881d9c0 100644 --- a/src/gallium/auxiliary/util/u_upload_mgr.c +++ b/src/gallium/auxiliary/util/u_upload_mgr.c @@ -192,6 +192,8 @@ enum pipe_error u_upload_alloc( struct u_upload_mgr *upload, *ptr = NULL; return PIPE_ERROR_OUT_OF_MEMORY; } + + upload->map -= offset; } assert(offset < upload->buffer->width0); @@ -261,7 +263,7 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload, ret = u_upload_data( upload, min_out_offset, size, - map + offset, + map, out_offset, outbuf, flushed ); |