etnaviv: don't always emit PE_DEPTH_CONFIG on shader changes
authorLucas Stach <l.stach@pengutronix.de>
Fri, 11 Nov 2022 16:29:18 +0000 (17:29 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 15 Nov 2022 09:51:56 +0000 (09:51 +0000)
Since b29fe26d4387 ("etnaviv: rework ZSA into a derived state") the PE
depth config is adjusted by etna_update_zsa() when the shader is changed.
When the PE depth config is actually changing as a result of this
adjustment the ZSA state is dirtied, so there is no need to emit the
state unconditionally when the shader is changed.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19686>

src/gallium/drivers/etnaviv/etnaviv_emit.c

index ccb2b8c..ddf1397 100644 (file)
@@ -429,7 +429,7 @@ etna_emit_state(struct etna_context *ctx)
       /*01010*/ EMIT_STATE(PS_CONTROL, ctx->framebuffer.PS_CONTROL);
       /*01030*/ EMIT_STATE(PS_CONTROL_EXT, ctx->framebuffer.PS_CONTROL_EXT);
    }
-   if (unlikely(dirty & (ETNA_DIRTY_ZSA | ETNA_DIRTY_FRAMEBUFFER | ETNA_DIRTY_SHADER))) {
+   if (unlikely(dirty & (ETNA_DIRTY_ZSA | ETNA_DIRTY_FRAMEBUFFER))) {
       /*01400*/ EMIT_STATE(PE_DEPTH_CONFIG, (etna_zsa_state(ctx->zsa)->PE_DEPTH_CONFIG |
                                              ctx->framebuffer.PE_DEPTH_CONFIG));
    }