[Mesa-dev] [PATCH 04/12] anv: Add func anv_image_has_hiz()

Chad Versace chadversary at chromium.org
Fri Sep 2 18:42:24 UTC 2016


On Thu 01 Sep 2016, Jason Ekstrand wrote:
> On Wed, Aug 31, 2016 at 8:29 PM, Nanley Chery <nanleychery at gmail.com> wrote:
> 
>     From: Chad Versace <chad.versace at intel.com>
> 
>     Nanley Chery (amend):
>      - Remove wip! tag
> 
>     Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
>     ---
>      src/intel/vulkan/anv_private.h | 10 ++++++++++
>      1 file changed, 10 insertions(+)
> 


>     +static inline bool
>     +anv_image_has_hiz(const struct anv_image *image)
>     +{
>     +   /* We must check the usage because anv_image::hiz_surface belongs to
>     +    * a union.
>     +    */
>     +   return (image->usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) &&
> 
> 
> Would checking (image->aspects & VK_IMAGE_ASPECT_DEPTH_BIT) be more
> appropriate?

I agree. VK_IMAGE_ASPECT_DEPTH_BIT makes more sense.

Also, that's what the documentation for anv_image says, quoted below:
   
   struct anv_image {
      ...

      /**
       * Image subsurfaces
       *
       * For each foo, anv_image::foo_surface is valid if and only if
       * anv_image::aspects has a foo aspect.
       *
       * ...
       */
      union {
         struct anv_surface color_surface;
   
         struct {
            struct anv_surface depth_surface;
            struct anv_surface stencil_surface;                                            
         };
      };
   };
   


More information about the mesa-dev mailing list