summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_transfer.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2012-12-05 20:15:40 +0000
committerJosé Fonseca <[email protected]>2012-12-06 17:12:31 +0000
commitb79194401a944e952e3035c676d1d22df24aa2a8 (patch)
tree8aa18376a4d6b900cb4afdbfcaeb6b10e372afe5 /src/gallium/auxiliary/util/u_transfer.c
parent4da4e8ee2ac337a765afd828880efe5a5a168088 (diff)
util: Add util_copy_box helper.
Must users of util_copy_rect() need or should deal with volumes. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_transfer.c')
-rw-r--r--src/gallium/auxiliary/util/u_transfer.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/gallium/auxiliary/util/u_transfer.c b/src/gallium/auxiliary/util/u_transfer.c
index 8b4c3659253..86168255325 100644
--- a/src/gallium/auxiliary/util/u_transfer.c
+++ b/src/gallium/auxiliary/util/u_transfer.c
@@ -1,5 +1,5 @@
#include "pipe/p_context.h"
-#include "util/u_rect.h"
+#include "util/u_surface.h"
#include "util/u_inlines.h"
#include "util/u_transfer.h"
#include "util/u_memory.h"
@@ -47,21 +47,19 @@ void u_default_transfer_inline_write( struct pipe_context *pipe,
}
else {
const uint8_t *src_data = data;
- unsigned i;
- for (i = 0; i < box->depth; i++) {
- util_copy_rect(map,
- resource->format,
- transfer->stride, /* bytes */
- 0, 0,
- box->width,
- box->height,
- src_data,
- stride, /* bytes */
- 0, 0);
- map += transfer->layer_stride;
- src_data += layer_stride;
- }
+ util_copy_box(map,
+ resource->format,
+ transfer->stride, /* bytes */
+ transfer->layer_stride, /* bytes */
+ 0, 0, 0,
+ box->width,
+ box->height,
+ box->depth,
+ src_data,
+ stride, /* bytes */
+ layer_stride, /* bytes */
+ 0, 0, 0);
}
pipe_transfer_unmap(pipe, transfer);