etnaviv: add cleared surfaces to context flush set when necessary

A RS/BLT clear might only clear the TS buffer, so the cleared resources
need to be added to the context flush set when they aren't explicitly
flushed in order to make the effect of the clear visible in the resource
on context flush.

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/20012>
This commit is contained in:
Lucas Stach 2022-11-25 20:26:10 +01:00 committed by Marge Bot
parent cf501a7f34
commit 2d7ea1895e
2 changed files with 10 additions and 0 deletions

View file

@ -365,8 +365,13 @@ etna_clear_blt(struct pipe_context *pctx, unsigned buffers, const struct pipe_sc
if (buffers & PIPE_CLEAR_COLOR) {
for (int idx = 0; idx < ctx->framebuffer_s.nr_cbufs; ++idx) {
struct etna_surface *surf = etna_surface(ctx->framebuffer_s.cbufs[idx]);
etna_blit_clear_color_blt(pctx, ctx->framebuffer_s.cbufs[idx],
&color[idx]);
if (!etna_resource(surf->prsc)->explicit_flush)
etna_context_add_flush_resource(ctx, surf->prsc);
}
}

View file

@ -461,8 +461,13 @@ etna_clear_rs(struct pipe_context *pctx, unsigned buffers, const struct pipe_sci
*/
if (buffers & PIPE_CLEAR_COLOR) {
for (int idx = 0; idx < ctx->framebuffer_s.nr_cbufs; ++idx) {
struct etna_surface *surf = etna_surface(ctx->framebuffer_s.cbufs[idx]);
etna_blit_clear_color_rs(pctx, ctx->framebuffer_s.cbufs[idx],
&color[idx]);
if (!etna_resource(surf->prsc)->explicit_flush)
etna_context_add_flush_resource(ctx, surf->prsc);
}
}