summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2016-10-06 15:21:48 -0700
committerNanley Chery <[email protected]>2016-10-07 12:54:17 -0700
commit3aec432ed3306ffb62e2a703f5b419d5ae012afa (patch)
treec3062fceec9f1ec41acab097b3e747a307472ad3 /src/intel/vulkan
parentfe40d026a1400d7651d08eed5321c44beda9bb82 (diff)
anv: Add func anv_image_has_hiz()
Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r--src/intel/vulkan/anv_private.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index dfcedd16a15..fd886bfd03e 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -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,