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)
committerEric Engestrom <eric@engestrom.ch>
Thu, 17 Nov 2022 14:05:04 +0000 (14:05 +0000)
commit2aae392bba3bf71838278e078bef4919cfd5baf7
tree96abc8bfa3c462ab40300ff693dd21e608b4b05d
parentf55b090c84ee158d8cb9d535d8be6a068e731593
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>
(cherry picked from commit 7fe91c9f660f3b76e2c08c0824d226417231c822)
.pick_status.json
src/gallium/drivers/etnaviv/etnaviv_state.c