anv: Add func anv_image_has_hiz()
authorChad Versace <chad.versace@intel.com>
Thu, 6 Oct 2016 22:21:48 +0000 (15:21 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Fri, 7 Oct 2016 19:54:17 +0000 (12:54 -0700)
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_private.h

index dfcedd16a153e687dc5e7479fa9b1cddf48ef96e..fd886bfd03ec5e567f0a01e80ef253d06487605e 100644 (file)
@@ -1759,6 +1759,16 @@ const struct anv_surface *
 anv_image_get_surface_for_aspect_mask(const struct anv_image *image,
                                       VkImageAspectFlags aspect_mask);
 
+static inline bool
+anv_image_has_hiz(const struct anv_image *image)
+{
+   /* We must check the aspect because anv_image::hiz_surface belongs to
+    * a union.
+    */
+   return (image->aspects & VK_IMAGE_ASPECT_DEPTH_BIT) &&
+          image->hiz_surface.isl.size > 0;
+}
+
 void anv_image_view_init(struct anv_image_view *view,
                          struct anv_device *device,
                          const VkImageViewCreateInfo* pCreateInfo,