Mesa (master): iris: Loosen aux state getter/setter assert on HiZ

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 10 20:53:48 UTC 2021


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

Author: Nanley Chery <nanley.g.chery at intel.com>
Date:   Tue Dec 15 16:38:52 2020 -0800

iris: Loosen aux state getter/setter assert on HiZ

The aux state getter and setter currently assert
iris_resource_level_has_hiz() for depth surfaces.

This assertion is too strict however. In some cases where the assert
would fail, we can still correctly describe the aux state with the ISL
enums (using ISL_AUX_STATE_AUX_INVALID, for example).

When HiZ is enabled on a resource but disabled for a given level, allow
the getter to be called and allow the setter to set aux states that lack
compression. Enables code simplifications later on.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

---

 src/gallium/drivers/iris/iris_resolve.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c
index 75f5e3a1afb..754bbe57678 100644
--- a/src/gallium/drivers/iris/iris_resolve.c
+++ b/src/gallium/drivers/iris/iris_resolve.c
@@ -767,7 +767,7 @@ iris_resource_get_aux_state(const struct iris_resource *res,
    iris_resource_check_level_layer(res, level, layer);
 
    if (res->surf.usage & ISL_SURF_USAGE_DEPTH_BIT) {
-      assert(iris_resource_level_has_hiz(res, level));
+      assert(isl_aux_usage_has_hiz(res->aux.usage));
    } else {
       assert(res->surf.samples == 1 ||
              res->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY);
@@ -785,7 +785,8 @@ iris_resource_set_aux_state(struct iris_context *ice,
    num_layers = miptree_layer_range_length(res, level, start_layer, num_layers);
 
    if (res->surf.usage & ISL_SURF_USAGE_DEPTH_BIT) {
-      assert(iris_resource_level_has_hiz(res, level));
+      assert(iris_resource_level_has_hiz(res, level) ||
+             !isl_aux_state_has_valid_aux(aux_state));
    } else {
       assert(res->surf.samples == 1 ||
              res->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY);



More information about the mesa-commit mailing list