[Mesa-dev] [PATCH 5/5] anv/image: Support CCS_E for images which may be used for storage

Nanley Chery nanleychery at gmail.com
Wed Jun 27 18:44:15 UTC 2018


On Tue, Feb 20, 2018 at 05:33:23PM -0800, Jason Ekstrand wrote:
> Nanley,
> 
> 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.
> 

Were you able to get any info on other apps? Either way, more testing is
good.

This patch is
Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>

> --Jason
> 
> On Tue, Feb 20, 2018 at 1:52 PM, Jason Ekstrand <jason at jlekstrand.net>
> wrote:
> 
> > We have to do resolves whenever we go into the general layout for these
> > images.  However, it also means that images which declare the storage
> > usage but don't actually need it most of the time will still get
> > compression.
> > ---
> >  src/intel/vulkan/anv_image.c | 18 +++++++++++++++---
> >  1 file changed, 15 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
> > index a297cc4..477d167 100644
> > --- a/src/intel/vulkan/anv_image.c
> > +++ b/src/intel/vulkan/anv_image.c
> > @@ -463,8 +463,7 @@ make_surface(const struct anv_device *dev,
> >               * a render target.  This means that it's safe to just leave
> >               * compression on at all times for these formats.
> >               */
> > -            if (!(vk_info->usage & VK_IMAGE_USAGE_STORAGE_BIT) &&
> > -                all_formats_ccs_e_compatible(&dev->info, vk_info)) {
> > +            if (all_formats_ccs_e_compatible(&dev->info, vk_info)) {
> >                 image->planes[plane].aux_usage = ISL_AUX_USAGE_CCS_E;
> >              }
> >           }
> > @@ -799,9 +798,22 @@ anv_layout_to_aux_usage(const struct gen_device_info
> > * const devinfo,
> >        return ISL_AUX_USAGE_NONE;
> >
> >
> > +   case VK_IMAGE_LAYOUT_GENERAL:
> > +      if (aspect == VK_IMAGE_ASPECT_DEPTH_BIT) {
> > +         return ISL_AUX_USAGE_NONE;
> > +      } else if (image->usage & VK_IMAGE_USAGE_STORAGE_BIT) {
> > +         /* If we might be used as a storage image and we're in the
> > general
> > +          * layout, we have to disable aux because the dataport doesn't
> > +          * support CCS.
> > +          */
> > +         return ISL_AUX_USAGE_NONE;
> > +      } else {
> > +         return image->planes[plane].aux_usage;
> > +      }
> > +
> > +
> >     /* Transfer Layouts
> >      */
> > -   case VK_IMAGE_LAYOUT_GENERAL:
> >     case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL:
> >     case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
> >        if (aspect == VK_IMAGE_ASPECT_DEPTH_BIT) {
> > --
> > 2.5.0.400.gff86faf
> >
> >

> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list