etnaviv: remove use of flush_seqno as trigger for texture cache invalidate
authorLucas Stach <l.stach@pengutronix.de>
Wed, 16 Nov 2022 16:15:07 +0000 (17:15 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 22 Nov 2022 13:55:29 +0000 (13:55 +0000)
The flush_seqno is only to be used/updated when a dirty tile status has
been written back to the resource. Using it as a marker to trigger a
texture cache invalidation is bogus and not actually needed. When the
texture resource is updated via a mapping or blit the texture cache
invalidation is already triggered by marking the caches as dirty. If the
resource is updated by fragment output, OpenGL explicitly defines the
result of a later texture read as undefined unless a TextureBarrier is
inserted, which also properly triggers the texture cache invalidate.

Also the current check is bogus as it doesn't handle seqno wraparound.

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_texture.c

index e5857f3..73144bd 100644 (file)
@@ -186,10 +186,8 @@ etna_update_sampler_source(struct pipe_sampler_view *view, int num)
          to->flush_seqno = from->seqno;
          ctx->dirty |= ETNA_DIRTY_TEXTURE_CACHES;
       }
-  } else if ((to == from) && (to->flush_seqno < from->seqno)) {
-      to->flush_seqno = from->seqno;
-      ctx->dirty |= ETNA_DIRTY_TEXTURE_CACHES;
    }
+
    if (etna_configure_sampler_ts(ctx->ts_for_sampler_view(view), view, enable_sampler_ts)) {
       ctx->dirty |= ETNA_DIRTY_SAMPLER_VIEWS | ETNA_DIRTY_TEXTURE_CACHES;
       ctx->dirty_sampler_views |= (1 << num);