<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Aug 16, 2017 at 11:32 AM, Karol Herbst <span dir="ltr"><<a href="mailto:karolherbst@gmail.com" target="_blank">karolherbst@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fixes 'KHR-GL45.copy_image.<wbr>functional' on Nouveau<br>
<br>
Signed-off-by: Karol Herbst <<a href="mailto:karolherbst@gmail.com">karolherbst@gmail.com</a>><br>
---<br>
src/mesa/main/format_utils.c | 6 +++++-<br>
1 file changed, 5 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c<br>
index d16d69c379..a3ddaebb2e 100644<br>
--- a/src/mesa/main/format_utils.c<br>
+++ b/src/mesa/main/format_utils.c<br>
@@ -485,7 +485,11 @@ _mesa_format_convert(void *void_dst, uint32_t dst_format, size_t dst_stride,<br>
<br>
assert(src_integer == dst_integer);<br>
<br>
- if (src_integer && dst_integer) {<br>
+ /* do a simply memcpy if applicable */<br>
+ if (dst_format == src_format && dst_stride == src_stride &&<br>
+ !dst_format_is_mesa_array_<wbr>format && !rebase_swizzle) {<br>
+ memcpy(dst, src, src_stride * height);<br>
+ } else if (src_integer && dst_integer) {<br></blockquote><div><br></div><div>I think this is the right thing to do in general but I think the code belongs in a different place. In particular, At the top of the first "if (!rebase_swizzle) {", we want something like</div><div><br></div><div>if ((dst_format_is_mesa_array_format &&</div><div> src_format_is_mesa_array_format &&</div><div> src_array_format == dst_array_format) ||</div><div> src_format == dst_format) {</div><div> for (row = 0; row < height; row++) {</div><div> memcpy(dst, src, width * format_size);</div><div> src += src_stride;</div><div> dst += dst_stride;<br></div><div> }</div><div> return;<br></div><div>}<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
tmp_uint = malloc(width * height * sizeof(*tmp_uint));<br>
<br>
/* The [un]packing functions for unsigned datatypes treat the 32-bit<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.1<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>