diff options
author | marha <marha@users.sourceforge.net> | 2012-10-15 16:56:14 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-10-15 16:56:14 +0200 |
commit | f15a40afaf6d1b3a4841d25631f947da1b289f89 (patch) | |
tree | f2066dc8caaf2fddd3b88251d18839d5878bfd9b /mesalib/src/gallium/auxiliary/util/u_inlines.h | |
parent | f2a3390c8b2052e8f65d3502dd703b5c5b23a28e (diff) | |
parent | 54db46582aba2252d544fa3956522f9ef06b49cb (diff) | |
download | vcxsrv-f15a40afaf6d1b3a4841d25631f947da1b289f89.tar.gz vcxsrv-f15a40afaf6d1b3a4841d25631f947da1b289f89.tar.bz2 vcxsrv-f15a40afaf6d1b3a4841d25631f947da1b289f89.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
xserver mesa pixman git update 15 oct 2012
Conflicts:
xorg-server/hw/xwin/InitOutput.c
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_inlines.h | 66 |
1 files changed, 19 insertions, 47 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_inlines.h b/mesalib/src/gallium/auxiliary/util/u_inlines.h index 033c100ed..5c6e7eb32 100644 --- a/mesalib/src/gallium/auxiliary/util/u_inlines.h +++ b/mesalib/src/gallium/auxiliary/util/u_inlines.h @@ -251,19 +251,8 @@ pipe_buffer_map_range(struct pipe_context *pipe, u_box_1d(offset, length, &box); - *transfer = pipe->get_transfer( pipe, - buffer, - 0, - usage, - &box); - - if (*transfer == NULL) - return NULL; - - map = pipe->transfer_map( pipe, *transfer ); + map = pipe->transfer_map(pipe, buffer, 0, usage, &box, transfer); if (map == NULL) { - pipe->transfer_destroy( pipe, *transfer ); - *transfer = NULL; return NULL; } @@ -285,10 +274,7 @@ static INLINE void pipe_buffer_unmap(struct pipe_context *pipe, struct pipe_transfer *transfer) { - if (transfer) { - pipe->transfer_unmap(pipe, transfer); - pipe->transfer_destroy(pipe, transfer); - } + pipe->transfer_unmap(pipe, transfer); } static INLINE void @@ -397,35 +383,29 @@ pipe_buffer_read(struct pipe_context *pipe, offset, size, PIPE_TRANSFER_READ, &src_transfer); + if (!map) + return; - if (map) - memcpy(data, map, size); - + memcpy(data, map, size); pipe_buffer_unmap(pipe, src_transfer); } -static INLINE struct pipe_transfer * -pipe_get_transfer( struct pipe_context *context, - struct pipe_resource *resource, - unsigned level, unsigned layer, - enum pipe_transfer_usage usage, - unsigned x, unsigned y, - unsigned w, unsigned h) -{ - struct pipe_box box; - u_box_2d_zslice( x, y, layer, w, h, &box ); - return context->get_transfer( context, - resource, - level, - usage, - &box ); -} - static INLINE void * -pipe_transfer_map( struct pipe_context *context, - struct pipe_transfer *transfer ) +pipe_transfer_map(struct pipe_context *context, + struct pipe_resource *resource, + unsigned level, unsigned layer, + enum pipe_transfer_usage usage, + unsigned x, unsigned y, + unsigned w, unsigned h, + struct pipe_transfer **transfer) { - return context->transfer_map( context, transfer ); + struct pipe_box box; + u_box_2d_zslice(x, y, layer, w, h, &box); + return context->transfer_map(context, + resource, + level, + usage, + &box, transfer); } static INLINE void @@ -435,14 +415,6 @@ pipe_transfer_unmap( struct pipe_context *context, context->transfer_unmap( context, transfer ); } - -static INLINE void -pipe_transfer_destroy( struct pipe_context *context, - struct pipe_transfer *transfer ) -{ - context->transfer_destroy(context, transfer); -} - static INLINE void pipe_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index, struct pipe_resource *buf) |