<div dir="ltr">Instead, I think we just want to start using my "CCS-correct copy patches"<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 11, 2016 at 12:26 PM, Topi Pohjolainen <span dir="ltr"><<a href="mailto:topi.pohjolainen@gmail.com" target="_blank">topi.pohjolainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
---<br>
src/intel/blorp/blorp.h | 2 ++<br>
src/intel/blorp/blorp_blit.c | 6 ++++++<br>
src/mesa/drivers/dri/i965/brw_<wbr>blorp.c | 25 ++++++++++++++++++++-----<br>
3 files changed, 28 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h<br>
index f69e99e..721322c 100644<br>
--- a/src/intel/blorp/blorp.h<br>
+++ b/src/intel/blorp/blorp.h<br>
@@ -94,6 +94,8 @@ struct blorp_surf<br>
union isl_color_value clear_color;<br>
};<br>
<br>
+bool blorp_copy_needs_format_<wbr>override(enum isl_format fmt);<br>
+<br>
void<br>
blorp_blit(struct blorp_batch *batch,<br>
const struct blorp_surf *src_surf,<br>
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c<br>
index 0c3ee72..bbeabd9 100644<br>
--- a/src/intel/blorp/blorp_blit.c<br>
+++ b/src/intel/blorp/blorp_blit.c<br>
@@ -1742,6 +1742,12 @@ get_copy_format_for_bpb(<wbr>unsigned bpb)<br>
}<br>
}<br>
<br>
+bool<br>
+blorp_copy_needs_format_<wbr>override(enum isl_format fmt)<br>
+{<br>
+ return fmt != get_copy_format_for_bpb(isl_<wbr>format_get_layout(fmt)->bpb);<br>
+}<br>
+<br>
static void<br>
surf_convert_to_uncompressed(<wbr>const struct isl_device *isl_dev,<br>
struct brw_blorp_surface_info *info,<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
index d937c5c..4e3359c 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
@@ -407,12 +407,18 @@ brw_blorp_copy_miptrees(struct brw_context *brw,<br>
unsigned dst_x, unsigned dst_y,<br>
unsigned src_width, unsigned src_height)<br>
{<br>
- /* Get ready to blit. This includes depth resolving the src and dst<br>
- * buffers if necessary. Note: it's not necessary to do a color resolve on<br>
- * the destination buffer because we use the standard render path to render<br>
- * to destination color buffers, and the standard render path is<br>
- * fast-color-aware.<br>
+ /* Get ready to blit. This includes color/depth resolving the src and dst<br>
+ * buffers if necessary.<br>
*/<br>
+ const enum isl_format dst_format =<br>
+ translate_tex_format(brw, dst_mt->format, false);<br>
+ const bool disable_dst_aux =<br>
+ dst_mt->mcs_mt && intel_miptree_is_lossless_<wbr>compressed(brw, dst_mt) &&<br>
+ blorp_copy_needs_format_<wbr>override(dst_format);<br>
+<br>
+ if (disable_dst_aux)<br>
+ intel_miptree_resolve_color(<wbr>brw, dst_mt, dst_level, dst_layer, 0);<br>
+<br>
intel_miptree_resolve_color(<wbr>brw, src_mt, src_level, src_layer,<br>
INTEL_MIPTREE_IGNORE_CCS_E);<br>
intel_miptree_slice_resolve_<wbr>depth(brw, src_mt, src_level, src_layer);<br>
@@ -437,6 +443,15 @@ brw_blorp_copy_miptrees(struct brw_context *brw,<br>
blorp_surf_for_miptree(brw, &dst_surf, dst_mt, true,<br>
&dst_level, dst_layer, &tmp_surfs[2]);<br>
<br>
+ /* Copy uses fixed formats that are guaranteed to agree with real surface<br>
+ * formats only with respect to size. Semantics may differ which will<br>
+ * confuse the hardware if any compression scheme is used. Therefore the<br>
+ * copy is performed target compression disabled unless the real format<br>
+ * matches exactly the fixed copy format.<br>
+ */<br>
+ if (disable_dst_aux)<br>
+ dst_surf.aux_usage = ISL_AUX_USAGE_NONE;<br>
+<br>
struct blorp_batch batch;<br>
blorp_batch_init(&brw->blorp, &batch, brw);<br>
blorp_copy(&batch, &src_surf, src_level, src_layer,<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.5<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>