<div dir="ltr"><div><div>Nanley,<br><br></div>At your request, I did a little fact-finding.  I ran all the Sascha demos, and only one of them ever hits this resolve: computeshader.  The demo only hits it once for the entire run probably because it does vkCmdCopyBufferToImage at the beginning and then uses it as a storage image.  I'll run some other games when I get to the office tomorrow.  I really doubt this will significantly affect the performance of any workloads we have today.  It's possible that some game will do a bunch of rendering and then run the result through a compute shader for after effects and we'd want the rendering to be compressed in that case.  Really, my primary motivation was to force more partial resolves in the CTS so that we can get better testing.<br><br></div>--Jason<br><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 20, 2018 at 1:52 PM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We have to do resolves whenever we go into the general layout for these<br>
images.  However, it also means that images which declare the storage<br>
usage but don't actually need it most of the time will still get<br>
compression.<br>
---<br>
 src/intel/vulkan/anv_image.c | 18 +++++++++++++++---<br>
 1 file changed, 15 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c<br>
index a297cc4..477d167 100644<br>
--- a/src/intel/vulkan/anv_image.c<br>
+++ b/src/intel/vulkan/anv_image.c<br>
@@ -463,8 +463,7 @@ make_surface(const struct anv_device *dev,<br>
              * a render target.  This means that it's safe to just leave<br>
              * compression on at all times for these formats.<br>
              */<br>
-            if (!(vk_info->usage & VK_IMAGE_USAGE_STORAGE_BIT) &&<br>
-                all_formats_ccs_e_compatible(&<wbr>dev->info, vk_info)) {<br>
+            if (all_formats_ccs_e_compatible(<wbr>&dev->info, vk_info)) {<br>
                image->planes[plane].aux_usage = ISL_AUX_USAGE_CCS_E;<br>
             }<br>
          }<br>
@@ -799,9 +798,22 @@ anv_layout_to_aux_usage(const struct gen_device_info * const devinfo,<br>
       return ISL_AUX_USAGE_NONE;<br>
<br>
<br>
+   case VK_IMAGE_LAYOUT_GENERAL:<br>
+      if (aspect == VK_IMAGE_ASPECT_DEPTH_BIT) {<br>
+         return ISL_AUX_USAGE_NONE;<br>
+      } else if (image->usage & VK_IMAGE_USAGE_STORAGE_BIT) {<br>
+         /* If we might be used as a storage image and we're in the general<br>
+          * layout, we have to disable aux because the dataport doesn't<br>
+          * support CCS.<br>
+          */<br>
+         return ISL_AUX_USAGE_NONE;<br>
+      } else {<br>
+         return image->planes[plane].aux_<wbr>usage;<br>
+      }<br>
+<br>
+<br>
    /* Transfer Layouts<br>
     */<br>
-   case VK_IMAGE_LAYOUT_GENERAL:<br>
    case VK_IMAGE_LAYOUT_TRANSFER_DST_<wbr>OPTIMAL:<br>
    case VK_IMAGE_LAYOUT_TRANSFER_SRC_<wbr>OPTIMAL:<br>
       if (aspect == VK_IMAGE_ASPECT_DEPTH_BIT) {<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.0.400.gff86faf<br>
<br>
</font></span></blockquote></div><br></div></div></div></div></div>