From 9df5a2bd627beea465f7968e0fd2ead6a0052cd0 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Fri, 17 Mar 2023 17:25:11 +0100 Subject: [PATCH] etnaviv: fix texture barrier implementation The current implementation has a number of issues: - it doesn't flush the depth cache, even though this can also be changed due to fragment shader operations and thus is included in the definition of glTextureBarrier - it doesn't flush the vertex sampler cache - it doesn't stall the pipeline until the flushes are done Fix those issues and drop the comment, as it's pretty clear from the code what is being done. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_texture.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture.c b/src/gallium/drivers/etnaviv/etnaviv_texture.c index 5797412f34f..c629bdab3f6 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_texture.c +++ b/src/gallium/drivers/etnaviv/etnaviv_texture.c @@ -337,9 +337,13 @@ static void etna_texture_barrier(struct pipe_context *pctx, unsigned flags) { struct etna_context *ctx = etna_context(pctx); - /* clear color and texture cache to make sure that texture unit reads - * what has been written */ - etna_set_state(ctx->stream, VIVS_GL_FLUSH_CACHE, VIVS_GL_FLUSH_CACHE_COLOR | VIVS_GL_FLUSH_CACHE_TEXTURE); + + etna_set_state(ctx->stream, VIVS_GL_FLUSH_CACHE, + VIVS_GL_FLUSH_CACHE_COLOR | VIVS_GL_FLUSH_CACHE_DEPTH | + VIVS_GL_FLUSH_CACHE_TEXTURE); + etna_set_state(ctx->stream, VIVS_GL_FLUSH_CACHE, + VIVS_GL_FLUSH_CACHE_TEXTUREVS); + etna_stall(ctx->stream, SYNC_RECIPIENT_RA, SYNC_RECIPIENT_PE); } uint32_t