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

Nanley Chery nanleychery at gmail.com
Thu Sep 1 03:29:50 UTC 2016


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(+)

diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 8964e3f..5718a19 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -1765,6 +1765,16 @@ struct anv_surface *
 anv_image_get_surface_for_aspect_mask(struct anv_image *image,
                                       VkImageAspectFlags aspect_mask);
 
+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) &&
+          image->hiz_surface.isl.size > 0;
+}
+
 void anv_image_view_init(struct anv_image_view *view,
                          struct anv_device *device,
                          const VkImageViewCreateInfo* pCreateInfo,
-- 
2.9.3



More information about the mesa-dev mailing list