Mesa (master): u_upload_mgr: Use pipe_buffer_map_range istead of pipe_buffer_map.
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Fri Jul 1 17:32:49 UTC 2011
Module: Mesa
Branch: master
Commit: dda8d7ac3f0e5148d9738a57f7bc03216f6514d1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dda8d7ac3f0e5148d9738a57f7bc03216f6514d1
Author: José Fonseca <jfonseca at vmware.com>
Date: Fri Jul 1 17:05:30 2011 +0100
u_upload_mgr: Use pipe_buffer_map_range istead of pipe_buffer_map.
pipe_buffer_map_range makes stricter assertions, and would have saved us
grief detecting a bug in svga user buffer uploads.
---
src/gallium/auxiliary/util/u_upload_mgr.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c
index d36697d..e50db6d 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -240,10 +240,11 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
struct pipe_transfer *transfer = NULL;
const char *map = NULL;
- map = (const char *)pipe_buffer_map(upload->pipe,
- inbuf,
- PIPE_TRANSFER_READ,
- &transfer);
+ map = (const char *)pipe_buffer_map_range(upload->pipe,
+ inbuf,
+ offset, size,
+ PIPE_TRANSFER_READ,
+ &transfer);
if (map == NULL) {
ret = PIPE_ERROR_OUT_OF_MEMORY;
@@ -256,7 +257,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 );
More information about the mesa-commit
mailing list