summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2021-01-20 11:04:31 -0800
committerMarge Bot <eric+marge@anholt.net>2021-01-20 23:15:47 +0000
commit77398a9e4186a02962b95fb352f7e7969cfbbdf1 (patch)
tree2c1fdc34f2d8fad2271e9354a5499d2b37dc4aa0
parent04f8aa7c1e780749eebf12068bf6dfc9cfe658d3 (diff)
radeonsi: Use util_writes_stencil() helper
Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8598>
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index c5a95fcaf75..278c9a733f0 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1100,13 +1100,6 @@ static uint32_t si_translate_stencil_op(int s_op)
return 0;
}
-static bool si_dsa_writes_stencil(const 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 bool si_order_invariant_stencil_op(enum pipe_stencil_op op)
{
/* REPLACE is normally order invariant, except when the stencil
@@ -1194,8 +1187,7 @@ static void *si_create_dsa_state(struct pipe_context *ctx,
dsa->depth_write_enabled = state->depth_enabled && state->depth_writemask;
dsa->stencil_enabled = state->stencil[0].enabled;
dsa->stencil_write_enabled =
- state->stencil[0].enabled &&
- (si_dsa_writes_stencil(&state->stencil[0]) || si_dsa_writes_stencil(&state->stencil[1]));
+ (util_writes_stencil(&state->stencil[0]) || util_writes_stencil(&state->stencil[1]));
dsa->db_can_write = dsa->depth_write_enabled || dsa->stencil_write_enabled;
bool zfunc_is_ordered =