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>
This commit is contained in:
Rob Clark 2021-01-20 11:04:31 -08:00 committed by Marge Bot
parent 04f8aa7c1e
commit 77398a9e41

View file

@ -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 =