From 2c1923458c356e536443645882c34bfe97afeb48 Mon Sep 17 00:00:00 2001 From: Patrick Lerda Date: Mon, 27 Apr 2026 13:18:10 +0200 Subject: [PATCH] r600: update memory barrier operations Note: the atomic host-mem-barrier tests assume that the atomic buffer could be shared which is not how the r600 operates. This change was tested on palm and cayman, with the exception of the "atomic counter" tests, it fixes all the other cases: spec/arb_shader_image_load_store/host-mem-barrier/.*: fail pass Signed-off-by: Patrick Lerda Part-of: --- src/gallium/drivers/r600/r600_state_common.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 74ba282bdab..52265d14fa2 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -82,26 +82,27 @@ static void r600_memory_barrier(struct pipe_context *ctx, unsigned flags) { struct r600_context *rctx = (struct r600_context *)ctx; - if (!(flags & ~PIPE_BARRIER_UPDATE)) + if (!(flags & ~PIPE_BARRIER_UPDATE_TEXTURE)) return; - if (flags & PIPE_BARRIER_CONSTANT_BUFFER) - rctx->b.flags |= R600_CONTEXT_INV_CONST_CACHE; - if (flags & (PIPE_BARRIER_VERTEX_BUFFER | PIPE_BARRIER_SHADER_BUFFER | - PIPE_BARRIER_TEXTURE | - PIPE_BARRIER_IMAGE | PIPE_BARRIER_STREAMOUT_BUFFER | PIPE_BARRIER_GLOBAL_BUFFER)) { rctx->b.flags |= R600_CONTEXT_INV_VERTEX_CACHE| R600_CONTEXT_INV_TEX_CACHE; } - if (flags & (PIPE_BARRIER_FRAMEBUFFER| + if (flags & (PIPE_BARRIER_FRAMEBUFFER | PIPE_BARRIER_IMAGE)) rctx->b.flags |= R600_CONTEXT_FLUSH_AND_INV; + if (flags & (PIPE_BARRIER_INDEX_BUFFER | + PIPE_BARRIER_UPDATE_BUFFER | + PIPE_BARRIER_CONSTANT_BUFFER | + PIPE_BARRIER_TEXTURE)) + rctx->b.flags |= R600_CONTEXT_FLUSH_AND_INV_CB; + rctx->b.flags |= R600_CONTEXT_WAIT_3D_IDLE; }