From 2dc5db625b2b224e609e7f7343aef7af4b485cec Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Mon, 23 Jun 2025 23:32:30 +0200 Subject: [PATCH] etnaviv: simplify stencil ref front/back selection condition Drop the check for front stencil enable when selecting which stencil ref value to put into the back stencil state. If the front stencil isn't enabled then stencil operations as a whole aren't enabled and we don't care which value ends up in the state. While at it fix indentation. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_emit.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_emit.c b/src/gallium/drivers/etnaviv/etnaviv_emit.c index 97b214ca59e..2c95464455e 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_emit.c +++ b/src/gallium/drivers/etnaviv/etnaviv_emit.c @@ -532,12 +532,10 @@ etna_emit_state(struct etna_context *ctx) } if (unlikely(dirty & (ETNA_DIRTY_STENCIL_REF | ETNA_DIRTY_RASTERIZER | ETNA_DIRTY_ZSA))) { uint32_t val = etna_zsa_state(ctx->zsa)->PE_STENCIL_CONFIG_EXT; - if (!ctx->zsa->stencil[1].enabled && - ctx->zsa->stencil[0].enabled && - ctx->zsa->stencil[0].valuemask) - val |= ctx->stencil_ref.PE_STENCIL_CONFIG_EXT[!ccw]; + if (!ctx->zsa->stencil[1].enabled && ctx->zsa->stencil[0].valuemask) + val |= ctx->stencil_ref.PE_STENCIL_CONFIG_EXT[!ccw]; else - val |= ctx->stencil_ref.PE_STENCIL_CONFIG_EXT[ccw]; + val |= ctx->stencil_ref.PE_STENCIL_CONFIG_EXT[ccw]; /*014A0*/ EMIT_STATE(PE_STENCIL_CONFIG_EXT, val); } if (unlikely(dirty & (ETNA_DIRTY_BLEND | ETNA_DIRTY_FRAMEBUFFER))) {