<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 21, 2018 at 1:45 PM, Rafael Antognolli <span dir="ltr"><<a href="mailto:rafael.antognolli@intel.com" target="_blank">rafael.antognolli@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On gen10+, if surface->clear_color_addr is present, use it directly<br>
intead of copying it to the surface state.<br>
<br>
Signed-off-by: Rafael Antognolli <<a href="mailto:rafael.antognolli@intel.com">rafael.antognolli@intel.com</a>><br>
---<br>
 src/intel/blorp/blorp_genX_<wbr>exec.h | 12 +++++++++---<br>
 1 file changed, 9 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/intel/blorp/blorp_genX_<wbr>exec.h b/src/intel/blorp/blorp_genX_<wbr>exec.h<br>
index 737720a70c9..122dccd7ca1 100644<br>
--- a/src/intel/blorp/blorp_genX_<wbr>exec.h<br>
+++ b/src/intel/blorp/blorp_genX_<wbr>exec.h<br>
@@ -1281,11 +1281,15 @@ blorp_emit_surface_state(<wbr>struct blorp_batch *batch,<br>
          write_disable_mask |= ISL_CHANNEL_ALPHA_BIT;<br>
    }<br>
<br>
+   const bool use_clear_address =<br>
+      GEN_GEN >= 10 && (surface->clear_color_addr.<wbr>buffer != NULL);<br>
+<br>
    isl_surf_fill_state(batch-><wbr>blorp->isl_dev, state,<br>
                        .surf = &surf, .view = &surface->view,<br>
                        .aux_surf = &surface->aux_surf, .aux_usage = aux_usage,<br>
                        .mocs = surface->addr.mocs,<br>
                        .clear_color = surface->clear_color,<br>
+                       .use_clear_address = use_clear_address,<br>
                        .write_disables = write_disable_mask);<br>
<br>
    blorp_surface_reloc(batch, state_offset + isl_dev->ss.addr_offset,<br>
@@ -1305,9 +1309,11 @@ blorp_emit_surface_state(<wbr>struct blorp_batch *batch,<br>
    blorp_flush_range(batch, state, GENX(RENDER_SURFACE_STATE_<wbr>length) * 4);<br>
<br>
    if (surface->clear_color_addr.<wbr>buffer) {<br>
-#if GEN_GEN > 10<br>
-      unreachable("Implement indirect clear support on gen11+");<br>
-#elif GEN_GEN >= 7 && GEN_GEN <= 10<br>
+#if GEN_GEN >= 10<br>
+      assert((surface->clear_color_<wbr>addr.offset & 0x3f) == 0);<br>
+      blorp_surface_reloc(batch, state_offset + isl_dev->ss.clear_value_<wbr>offset,<br>
+                          surface->clear_color_addr, 0);<br>
+#elif GEN_GEN >= 7 && GEN_GEN < 10<br></blockquote><div><br></div><div>The GEN_GEN < 10 here is redundant, I'd just drop it.  With that,<br><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
       struct blorp_address dst_addr = blorp_get_surface_base_<wbr>address(batch);<br>
       dst_addr.offset += state_offset + isl_dev->ss.clear_value_<wbr>offset;<br>
       blorp_emit_memcpy(batch, dst_addr, surface->clear_color_addr,<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.3<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>