Mesa (master): r300: Use util_writes_depth_stencil() helper

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 20 23:34:37 UTC 2021


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

Author: Rob Clark <robdclark at chromium.org>
Date:   Wed Jan 20 11:04:09 2021 -0800

r300: Use util_writes_depth_stencil() helper

Signed-off-by: Rob Clark <robdclark at chromium.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8598>

---

 src/gallium/drivers/r300/r300_hyperz.c | 28 +---------------------------
 1 file changed, 1 insertion(+), 27 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_hyperz.c b/src/gallium/drivers/r300/r300_hyperz.c
index 3c2902d2c73..7e146dfe57a 100644
--- a/src/gallium/drivers/r300/r300_hyperz.c
+++ b/src/gallium/drivers/r300/r300_hyperz.c
@@ -218,32 +218,6 @@ static void r300_update_hyperz(struct r300_context* r300)
 /* The ZTOP state                                                            */
 /*****************************************************************************/
 
-static boolean r300_dsa_writes_stencil(
-        struct pipe_stencil_state *s)
-{
-    return s->enabled && s->writemask &&
-           (s->fail_op  != PIPE_STENCIL_OP_KEEP ||
-            s->zfail_op != PIPE_STENCIL_OP_KEEP ||
-            s->zpass_op != PIPE_STENCIL_OP_KEEP);
-}
-
-static boolean r300_dsa_writes_depth_stencil(
-        struct pipe_depth_stencil_alpha_state *dsa)
-{
-    /* We are interested only in the cases when a depth or stencil value
-     * can be changed. */
-
-    if (dsa->depth_enabled && dsa->depth_writemask &&
-        dsa->depth_func != PIPE_FUNC_NEVER)
-        return TRUE;
-
-    if (r300_dsa_writes_stencil(&dsa->stencil[0]) ||
-        r300_dsa_writes_stencil(&dsa->stencil[1]))
-        return TRUE;
-
-    return FALSE;
-}
-
 static boolean r300_dsa_alpha_test_enabled(
         struct pipe_depth_stencil_alpha_state *dsa)
 {
@@ -287,7 +261,7 @@ static void r300_update_ztop(struct r300_context* r300)
      */
 
     /* ZS writes */
-    if (r300_dsa_writes_depth_stencil(r300->dsa_state.state) &&
+    if (util_writes_depth_stencil(r300->dsa_state.state) &&
            (r300_dsa_alpha_test_enabled(r300->dsa_state.state) ||  /* (1) */
             r300_fs(r300)->shader->info.uses_kill)) {              /* (2) */
         ztop_state->z_buffer_top = R300_ZTOP_DISABLE;



More information about the mesa-commit mailing list