<div dir="ltr">Much better.  Thanks!<br><div><br>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 1, 2016 at 8:03 AM, 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">From: Ben Widawsky <<a href="mailto:ben@bwidawsk.net">ben@bwidawsk.net</a>><br>
<br>
v2 (Jason):<br>
   - Use PRM citation for SKL now that it is available<br>
   - Also return false for gen < 8 mipmapped/arrayed<br>
<br>
Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
---<br>
 src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 51 +++++++++++++++++++--------<br>
 1 file changed, 37 insertions(+), 14 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
index 32d8094..39ac86d 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
@@ -226,30 +226,53 @@ intel_miptree_supports_non_<wbr>msrt_fast_clear(struct brw_context *brw,<br>
<span class=""><br>
    if (mt->cpp != 4 && mt->cpp != 8 && mt->cpp != 16)<br>
       return false;<br>
-   if (mt->first_level != 0 || mt->last_level != 0) {<br>
-      if (brw->gen >= 8) {<br>
</span>-         perf_debug("Multi-LOD fast clear - giving up (%dx%dx%d).\n",<br>
-                    mt->logical_width0, mt->logical_height0, mt->last_level);<br>
-      }<br>
<br>
-      return false;<br>
-   }<br>
<span class="">+   const bool mip_mapped = mt->first_level != 0 || mt->last_level != 0;<br>
+   const bool arrayed = mt->physical_depth0 != 1;<br>
<br>
</span><span class="">-   /* Check for layered surfaces. */<br>
-   if (mt->physical_depth0 != 1) {<br>
</span>+   if (arrayed) {<br>
<span class="">        /* Multisample surfaces with the CMS layout are not layered surfaces,<br>
</span><span class="">         * yet still have physical_depth0 > 1. Assert that we don't<br>
</span><span class="">         * accidentally reject a multisampled surface here. We should have<br>
</span><span class="">         * rejected it earlier by explicitly checking the sample count.<br>
</span>         */<br>
<span class="">       assert(mt->num_samples <= 1);<br>
+   }<br>
<br>
</span><span class="">-      if (brw->gen >= 8) {<br>
</span>-         perf_debug("Layered fast clear - giving up. (%dx%d%d)\n",<br>
-                    mt->logical_width0, mt->logical_height0,<br>
-                    mt->physical_depth0);<br>
-      }<br>
<span class="">+   /* Handle the hardware restrictions...<br>
+    *<br>
+    * All GENs have the following restriction: "MCS buffer for non-MSRT is<br>
+    * supported only for RT formats 32bpp, 64bpp, and 128bpp."<br>
+    *<br>
+    * From the HSW PRM Volume 7: 3D-Media-GPGPU, page 652: (Color Clear of<br>
+    * Non-MultiSampler Render Target Restrictions) Support is for<br>
</span>+    * non-mip-mapped and non-array surface types only.<br>
<span class="">+    *<br>
+    * From the BDW PRM Volume 7: 3D-Media-GPGPU, page 649: (Color Clear of<br>
+    * Non-MultiSampler Render Target Restriction). Mip-mapped and arrayed<br>
+    * surfaces are supported with MCS buffer layout with these alignments in<br>
</span>+    * the RT space: Horizontal Alignment = 256 and Vertical Alignment = 128.<br>
+    *<br>
+    * From the SKL PRM Volume 7: 3D-Media-GPGPU, page 632: (Color Clear of<br>
<span class="">+    * Non-MultiSampler Render Target Restriction). Mip-mapped and arrayed<br>
+    * surfaces are supported with MCS buffer layout with these alignments in<br>
</span>+    * the RT space: Horizontal Alignment = 128 and Vertical Alignment = 64.<br>
+    */<br>
+   if (brw->gen < 8 && (mip_mapped || arrayed))<br>
+      return false;<br>
+<br>
+   /* Not implemented yet. */<br>
+   if (mip_mapped) {<br>
+      perf_debug("Multi-LOD fast clear - giving up (%dx%dx%d).\n",<br>
+                 mt->logical_width0, mt->logical_height0, mt->last_level);<br>
+      return false;<br>
+   }<br>
<br>
+   /* Not implemented yet. */<br>
+   if (arrayed) {<br>
+      perf_debug("Layered fast clear - giving up. (%dx%d%d)\n",<br>
+                 mt->logical_width0, mt->logical_height0,<br>
+                 mt->physical_depth0);<br>
       return false;<br>
<div class="HOEnZb"><div class="h5">    }<br>
<br>
--<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>
</div></div></blockquote></div><br></div></div></div></div>