Mesa (main): iris: Convert some mod_info checks to asserts

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 21 20:47:54 UTC 2021


Module: Mesa
Branch: main
Commit: b71264e4656fc93904827ad7d0737220da3f303e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b71264e4656fc93904827ad7d0737220da3f303e

Author: Nanley Chery <nanley.g.chery at intel.com>
Date:   Wed Aug 25 10:34:20 2021 -0700

iris: Convert some mod_info checks to asserts

Depth and multisample images aren't supported with modifiers. So,
instead of checking for the absence of modifiers before adding HiZ or
MCS, simply assert that they aren't present at a more convenient time.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11960>

---

 src/gallium/drivers/iris/iris_resource.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 12857416ef8..df13aef8d02 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -736,10 +736,10 @@ iris_resource_configure_aux(struct iris_screen *screen,
           res->mod_info->aux_usage == ISL_AUX_USAGE_GFX12_CCS_E ||
           res->mod_info->aux_usage == ISL_AUX_USAGE_MC);
 
-   const bool has_mcs = !res->mod_info &&
+   const bool has_mcs =
       isl_surf_get_mcs_surf(&screen->isl_dev, &res->surf, &res->aux.surf);
 
-   const bool has_hiz = !res->mod_info && !INTEL_DEBUG(DEBUG_NO_HIZ) &&
+   const bool has_hiz = !INTEL_DEBUG(DEBUG_NO_HIZ) &&
       isl_surf_get_hiz_surf(&screen->isl_dev, &res->surf, &res->aux.surf);
 
    const bool has_ccs =
@@ -755,9 +755,11 @@ iris_resource_configure_aux(struct iris_screen *screen,
       /* Only allow a CCS modifier if the aux was created successfully. */
       res->aux.possible_usages |= 1 << res->mod_info->aux_usage;
    } else if (has_mcs) {
+      assert(!res->mod_info);
       res->aux.possible_usages |=
          1 << (has_ccs ? ISL_AUX_USAGE_MCS_CCS : ISL_AUX_USAGE_MCS);
    } else if (has_hiz) {
+      assert(!res->mod_info);
       if (!has_ccs) {
          res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ;
       } else if (res->surf.samples == 1 &&



More information about the mesa-commit mailing list