From 335c32a168baa78f2099d5fa50fdc0d87d9880ce Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 16 Feb 2024 11:54:32 -0500 Subject: [PATCH] zink: apply all storage memory masks to control barriers if no modes are specified fixes VUID-StandaloneSpirv-OpControlBarrier-04650 errors cc: mesa-stable Part-of: (cherry picked from commit 701ee4be913a98569a5ba2e0d4d4d8888c35249e) --- .pick_status.json | 2 +- src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 473b244128c..c4e57e7f1fa 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4414,7 +4414,7 @@ "description": "zink: apply all storage memory masks to control barriers if no modes are specified", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index 5bcc6d6adeb..fed74012475 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -3208,6 +3208,11 @@ emit_barrier(struct ntv_context *ctx, nir_intrinsic_instr *intr) if (modes & (nir_var_shader_out | nir_var_mem_task_payload)) semantics |= SpvMemorySemanticsOutputMemoryMask; + if (!modes) + semantics = SpvMemorySemanticsWorkgroupMemoryMask | + SpvMemorySemanticsUniformMemoryMask | + SpvMemorySemanticsImageMemoryMask | + SpvMemorySemanticsCrossWorkgroupMemoryMask; semantics |= SpvMemorySemanticsAcquireReleaseMask; }