etnaviv: mark texture caches as dirty when blitting into a sampler resource
authorLucas Stach <l.stach@pengutronix.de>
Wed, 16 Nov 2022 16:27:38 +0000 (17:27 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 22 Nov 2022 13:55:29 +0000 (13:55 +0000)
Same as with resource mappings the blit can target a resource that may be
cached in the texture cache. Mark the cache as dirty to make sure it is
invalidated before the next draw.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19800>

src/gallium/drivers/etnaviv/etnaviv_clear_blit.c

index 7a6591e..00ff211 100644 (file)
@@ -97,11 +97,12 @@ etna_blit(struct pipe_context *pctx, const struct pipe_blit_info *blit_info)
    struct etna_context *ctx = etna_context(pctx);
    struct pipe_blit_info info = *blit_info;
 
+
    if (ctx->blit(pctx, &info))
-      return;
+      goto success;
 
    if (util_try_blit_via_copy_region(pctx, &info, false))
-      return;
+      goto success;
 
    if (info.mask & PIPE_MASK_S) {
       DBG("cannot blit stencil, skipping");
@@ -117,6 +118,10 @@ etna_blit(struct pipe_context *pctx, const struct pipe_blit_info *blit_info)
 
    etna_blit_save_state(ctx);
    util_blitter_blit(ctx->blitter, &info);
+
+success:
+   if (info.dst.resource->bind & PIPE_BIND_SAMPLER_VIEW)
+      ctx->dirty |= ETNA_DIRTY_TEXTURE_CACHES;
 }
 
 static void