Do we actually allow overlapping copies in Gallium? I thought we don&#39;t.<br><br>Marek<br><br><div class="gmail_quote">On Thu, Apr 21, 2011 at 6:00 PM, Ferry Huberts <span dir="ltr">&lt;<a href="mailto:mailings@hupie.com">mailings@hupie.com</a>&gt;</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>
&gt; ---<br>
&gt;  src/gallium/auxiliary/util/u_surface.c |   22 +++++++++++++---------<br>
&gt;  1 files changed, 13 insertions(+), 9 deletions(-)<br>
&gt;<br>
&gt; diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c<br>
&gt; index 9caf76c..43a0266 100644<br>
&gt; --- a/src/gallium/auxiliary/util/u_surface.c<br>
&gt; +++ b/src/gallium/auxiliary/util/u_surface.c<br>
&gt; @@ -188,15 +188,19 @@ util_resource_copy_region(struct pipe_context *pipe,<br>
&gt;     assert(dst_map);<br>
&gt;<br>
&gt;     if (src_map &amp;&amp; dst_map) {<br>
&gt; -      util_copy_rect(dst_map,<br>
&gt; -                     dst_format,<br>
&gt; -                     dst_trans-&gt;stride,<br>
&gt; -                     0, 0,<br>
&gt; -                     w, h,<br>
&gt; -                     src_map,<br>
&gt; -                     src_trans-&gt;stride,<br>
&gt; -                     0,<br>
&gt; -                     0);<br>
&gt; +      if (dst-&gt;target == PIPE_BUFFER &amp;&amp; src-&gt;target == PIPE_BUFFER) {<br>
&gt; +         memcpy(dst_map, src_map, w);<br>
<br>
</div>this will not work if dst_map and src_map overlap...<br>
if you&#39;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>