radeonsi: fix GravityMark corruption when use aco

aco may use smem load for ssbo when possible.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12518
Cc: mesa-stable
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33440>
(cherry picked from commit ee9edd4625)
This commit is contained in:
Qiang Yu 2025-02-07 14:18:16 +08:00 committed by Eric Engestrom
parent a9f218a966
commit 88cd974aae
2 changed files with 6 additions and 1 deletions

View file

@ -4,7 +4,7 @@
"description": "radeonsi: fix GravityMark corruption when use aco",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -677,6 +677,11 @@ static void si_memory_barrier(struct pipe_context *ctx, unsigned flags)
PIPE_BARRIER_IMAGE | PIPE_BARRIER_STREAMOUT_BUFFER | PIPE_BARRIER_GLOBAL_BUFFER))
sctx->barrier_flags |= SI_BARRIER_INV_VMEM;
/* Unlike LLVM, ACO may use SMEM for SSBOs and global access. */
if (sctx->screen->use_aco &&
(flags & (PIPE_BARRIER_SHADER_BUFFER | PIPE_BARRIER_GLOBAL_BUFFER)))
sctx->barrier_flags |= SI_BARRIER_INV_SMEM;
if (flags & (PIPE_BARRIER_INDEX_BUFFER | PIPE_BARRIER_INDIRECT_BUFFER))
sctx->barrier_flags |= SI_BARRIER_PFP_SYNC_ME;