From 4e9d913f8149b4615342b4d56a6ec591cce7c072 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 12 Nov 2022 12:49:15 -0800 Subject: [PATCH] freedreno/a6xx: Improve LRZ test for stencil write If all the ops are KEEP, we don't actually write the stencil, and can avoid falling off the LRZ fastpath. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/a6xx/fd6_zsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_zsa.c b/src/gallium/drivers/freedreno/a6xx/fd6_zsa.c index 4443754..204bab6 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_zsa.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_zsa.c @@ -166,7 +166,7 @@ fd6_zsa_state_create(struct pipe_context *pctx, * stencil test we don't really know what the updates to the * depth buffer will be. */ - update_lrz_stencil(so, s->func, !!s->writemask); + update_lrz_stencil(so, s->func, util_writes_stencil(s)); so->rb_stencil_control |= A6XX_RB_STENCIL_CONTROL_STENCIL_READ | @@ -182,7 +182,7 @@ fd6_zsa_state_create(struct pipe_context *pctx, if (cso->stencil[1].enabled) { const struct pipe_stencil_state *bs = &cso->stencil[1]; - update_lrz_stencil(so, bs->func, !!bs->writemask); + update_lrz_stencil(so, bs->func, util_writes_stencil(bs)); so->rb_stencil_control |= A6XX_RB_STENCIL_CONTROL_STENCIL_ENABLE_BF | -- 2.7.4