From 21f8410191378165219b3dbd6374064fc18a625c Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 14 Jun 2024 18:02:58 +0100 Subject: [PATCH] vtn: ensure TCS control barriers have a large enough memory scope A workgroup or larger scope is necessary for writes to be visible to other invocations. Fixes incorrect snow rendering in Indika. Signed-off-by: Rhys Perry Reviewed-by: Alyssa Rosenzweig Reviewed-by: Faith Ekstrand Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11299 Cc: mesa-stable Part-of: --- src/compiler/spirv/spirv_to_nir.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 9c66641c7a7..34e27dbaeca 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -4709,6 +4709,8 @@ vtn_handle_barrier(struct vtn_builder *b, SpvOp opcode, SpvMemorySemanticsSequentiallyConsistentMask); memory_semantics |= SpvMemorySemanticsAcquireReleaseMask | SpvMemorySemanticsOutputMemoryMask; + if (memory_scope == SpvScopeSubgroup || memory_scope == SpvScopeInvocation) + memory_scope = SpvScopeWorkgroup; } vtn_emit_scoped_control_barrier(b, execution_scope, memory_scope,