etnaviv: switch to late Z when linear PE is used
authorLucas Stach <l.stach@pengutronix.de>
Fri, 11 Nov 2022 16:20:41 +0000 (17:20 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 15 Nov 2022 09:51:56 +0000 (09:51 +0000)
commit7fe91c9f660f3b76e2c08c0824d226417231c822
tree1b15f4bbb8933cd8e8fba6f55e6d996d8c4be962
parente65d266529f1e95252bacd529a830b9d4d50000f
etnaviv: switch to late Z when linear PE is used

In linear PE mode the early and late depth stage do not only disagree
about the cache layout, but they seem to fundamentally disagree about
the buffer layout. When Z was written via the late stage, early tests
always show spurious zfails, even if they are not in the same draw
call. Cache flushing and pipe stalls don't help in that case.

The only option to get reliable Z tests with linear render targets is
to move all Z handling into the PE stage. Even when early Z writes
are possible, we don't know if any other draw to the same surface
needs late Z handling, so we must never use the early stage.

Fixes: 53445284a427 ("etnaviv: add linear PE support")
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_state.c