summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-04-21 12:50:00 +0200
committerMarek Olšák <[email protected]>2011-04-21 15:51:18 +0200
commit64f55216e4c11e8acb787bfe40e6dd25e862cd43 (patch)
tree21a6c82fd6078aa892b302e08185cd50f3335b59
parent08ba9778dbf3326bdfc8ca8035b51412032748ea (diff)
util: add a simple memcpy path for copying buffers in util_resource_copy_region
Reviewed-by: Jakob Bornecrantz <[email protected]>
-rw-r--r--src/gallium/auxiliary/util/u_surface.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index 9caf76c802b..43a026691d3 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -188,15 +188,19 @@ util_resource_copy_region(struct pipe_context *pipe,
assert(dst_map);
if (src_map && dst_map) {
- util_copy_rect(dst_map,
- dst_format,
- dst_trans->stride,
- 0, 0,
- w, h,
- src_map,
- src_trans->stride,
- 0,
- 0);
+ if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
+ memcpy(dst_map, src_map, w);
+ } else {
+ util_copy_rect(dst_map,
+ dst_format,
+ dst_trans->stride,
+ 0, 0,
+ w, h,
+ src_map,
+ src_trans->stride,
+ 0,
+ 0);
+ }
}
pipe->transfer_unmap(pipe, src_trans);