Do we actually allow overlapping copies in Gallium? I thought we don't.<br><br>Marek<br><br><div class="gmail_quote">On Thu, Apr 21, 2011 at 6:00 PM, Ferry Huberts <span dir="ltr"><<a href="mailto:mailings@hupie.com">mailings@hupie.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
<br>
On 04/21/2011 01:11 PM, Marek Olšák wrote:<br>
> ---<br>
> src/gallium/auxiliary/util/u_surface.c | 22 +++++++++++++---------<br>
> 1 files changed, 13 insertions(+), 9 deletions(-)<br>
><br>
> diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c<br>
> index 9caf76c..43a0266 100644<br>
> --- a/src/gallium/auxiliary/util/u_surface.c<br>
> +++ b/src/gallium/auxiliary/util/u_surface.c<br>
> @@ -188,15 +188,19 @@ util_resource_copy_region(struct pipe_context *pipe,<br>
> assert(dst_map);<br>
><br>
> if (src_map && dst_map) {<br>
> - util_copy_rect(dst_map,<br>
> - dst_format,<br>
> - dst_trans->stride,<br>
> - 0, 0,<br>
> - w, h,<br>
> - src_map,<br>
> - src_trans->stride,<br>
> - 0,<br>
> - 0);<br>
> + if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {<br>
> + memcpy(dst_map, src_map, w);<br>
<br>
</div>this will not work if dst_map and src_map overlap...<br>
if you're sure that they never overlap: ok, else maybe use memmove?<br>
<br>
<br>
grtz<br>
<br>
--<br>
<font color="#888888">Ferry Huberts<br>
</font></blockquote></div><br>