isl: Add isl_surf_supports_hiz_ccs_wt()
authorNanley Chery <nanley.g.chery@intel.com>
Thu, 19 Sep 2019 20:10:24 +0000 (13:10 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Mon, 28 Oct 2019 17:47:06 +0000 (10:47 -0700)
Add a helper to determine if an ISL surface supports the write-through
mode of HIZ_CCS.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/isl/isl.c
src/intel/isl/isl.h

index 954c7102b80410ab8dde5739670a4efaac84629e..c756fb0c80fb185b6a3a55241198ccba45970db7 100644 (file)
@@ -2582,6 +2582,16 @@ isl_surf_get_depth_format(const struct isl_device *dev,
    }
 }
 
+bool
+isl_surf_supports_hiz_ccs_wt(const struct gen_device_info *dev,
+                             const struct isl_surf *surf,
+                             enum isl_aux_usage aux_usage)
+{
+   return aux_usage == ISL_AUX_USAGE_HIZ_CCS &&
+          surf->samples == 1 &&
+          surf->usage & ISL_SURF_USAGE_TEXTURE_BIT;
+}
+
 bool
 isl_swizzle_supports_rendering(const struct gen_device_info *devinfo,
                                struct isl_swizzle swizzle)
index d50f86f6892a645b6271b22b5e6e2bef0d883349..bcb46b12266894c76ee11f3904f020a50d5a25a4 100644 (file)
@@ -2162,6 +2162,14 @@ uint32_t
 isl_surf_get_depth_format(const struct isl_device *dev,
                           const struct isl_surf *surf);
 
+/**
+ * @brief determines if a surface supports writing through HIZ to the CCS.
+ */
+bool
+isl_surf_supports_hiz_ccs_wt(const struct gen_device_info *dev,
+                             const struct isl_surf *surf,
+                             enum isl_aux_usage aux_usage);
+
 /**
  * @brief performs a copy from linear to tiled surface
  *