From 04f8aa7c1e780749eebf12068bf6dfc9cfe658d3 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 20 Jan 2021 11:04:09 -0800 Subject: [PATCH] r300: Use util_writes_depth_stencil() helper Signed-off-by: Rob Clark Reviewed-by: Eric Anholt Reviewed-by: Alyssa Rosenzweig Part-of: --- 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;