etnaviv: flush destination before executing blit

A blit into a render target may destroy valid TS information, as the
destination TS isn't updated. Flush the blit destination when necessary
to make sure that all pending TS is resolved into the destination before
the blit is executed.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
This commit is contained in:
Lucas Stach
2022-12-07 15:17:32 +01:00
committed by Marge Bot
parent ff3741eee1
commit 87021531a3
2 changed files with 10 additions and 0 deletions

View File

@@ -475,6 +475,11 @@ etna_try_blt_blit(struct pipe_context *pctx,
return true;
}
/* Flush destination, as the blit will invalidate any pending TS changes. */
if (dst != src && etna_resource_level_needs_flush(dst_lev))
etna_copy_resource(pctx, &dst->base, &dst->base,
blit_info->dst.level, blit_info->dst.level);
/* Kick off BLT here */
if (src == dst && src_lev->ts_compress_fmt < 0) {
/* Resolve-in-place */

View File

@@ -720,6 +720,11 @@ etna_try_rs_blit(struct pipe_context *pctx,
width & (w_align - 1) || height & (h_align - 1))
goto manual;
/* Flush destination, as the blit will invalidate any pending TS changes. */
if (dst != src && etna_resource_level_needs_flush(dst_lev))
etna_copy_resource(pctx, &dst->base, &dst->base,
blit_info->dst.level, blit_info->dst.level);
/* Always flush color and depth cache together before resolving. This makes
* sure that all previous cache content written by the PE is flushed out
* before RS uses the pixel pipes, which invalidates those caches. */