Mesa (staging/20.0): iris: Don't skip fast depth clears if the color changed

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Mar 7 00:42:58 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: a1041546ec05b96583ab22f3c58403abaeb556dc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a1041546ec05b96583ab22f3c58403abaeb556dc

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Thu Mar  5 17:17:40 2020 -0600

iris: Don't skip fast depth clears if the color changed

We depend on BLORP to convert the clear color and write it into the
clear color buffer for us.  However, we weren't bothering to call blorp
in the case where the state is ISL_AUX_STATE_CLEAR.  This leads to the
clear color not getting properly updated if we have back-to-back clears
with different clear colors.  Technically, we could go out of our way to
set the clear color directly from iris in this case but this is a case
we're unlikely to see in the wild so let's not bother.  This matches
what we already do for color surfaces.

Cc: mesa-stable at lists.freedesktop.org
Reported-by: Mark Janes <mark.a.janes at intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4073>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4073>
(cherry picked from commit 9d07d598423e4015bbc7beb7a2fdc4c657d5e0cf)

---

 .pick_status.json                     | 2 +-
 src/gallium/drivers/iris/iris_clear.c | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 1f85bedabb6..3670555993d 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -409,7 +409,7 @@
         "description": "iris: Don't skip fast depth clears if the color changed",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c
index bc6fe1ded0f..a27dc30d69c 100644
--- a/src/gallium/drivers/iris/iris_clear.c
+++ b/src/gallium/drivers/iris/iris_clear.c
@@ -521,7 +521,11 @@ fast_clear_depth(struct iris_context *ice,
    for (unsigned l = 0; l < box->depth; l++) {
       enum isl_aux_state aux_state =
          iris_resource_get_aux_state(res, level, box->z + l);
-      if (aux_state != ISL_AUX_STATE_CLEAR) {
+      if (update_clear_depth || aux_state != ISL_AUX_STATE_CLEAR) {
+         if (aux_state == ISL_AUX_STATE_CLEAR) {
+            perf_debug(&ice->dbg, "Performing HiZ clear just to update the "
+                                  "depth clear value\n");
+         }
          iris_hiz_exec(ice, batch, res, level,
                        box->z + l, 1, ISL_AUX_OP_FAST_CLEAR,
                        update_clear_depth);



More information about the mesa-commit mailing list