From 6c5bf8cb80b335dd239e2fec5a0d2c93dbfe6a02 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 15 Feb 2025 21:22:17 +0900 Subject: [PATCH] [qfcc] Use correct memory semantics for atomic ops It seems it's supposed to be Relaxed, and there is no None anyway (and checks aren't done until the intrinsic is instantiated). --- tools/qfcc/source/glsl-builtins.c | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tools/qfcc/source/glsl-builtins.c b/tools/qfcc/source/glsl-builtins.c index 7b4ff1441..c6779f21e 100644 --- a/tools/qfcc/source/glsl-builtins.c +++ b/tools/qfcc/source/glsl-builtins.c @@ -992,54 +992,54 @@ SRC_LINE "#define inout @inout" "\n" "@overload uint atomicAdd(uintr mem, const uint data)" "\n" "= " SPV(OpAtomicIAdd) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload int atomicAdd(intr mem, const int data)" "\n" "= " SPV(OpAtomicIAdd) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload uint atomicMin(uintr mem, const uint data)" "\n" "= " SPV(OpAtomicUMin) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload int atomicMin(intr mem, const int data)" "\n" "= " SPV(OpAtomicSMin) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload uint atomicMax(uintr mem, const uint data)" "\n" "= " SPV(OpAtomicUMax) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload int atomicMax(intr mem, const int data)" "\n" "= " SPV(OpAtomicUMax) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload uint atomicAnd(uintr mem, const uint data)" "\n" "= " SPV(OpAtomicAnd) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload int atomicAnd(intr mem, const int data)" "\n" "= " SPV(OpAtomicAnd) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload uint atomicOr(uintr mem, const uint data)" "\n" "= " SPV(OpAtomicOr) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload int atomicOr(intr mem, const int data)" "\n" "= " SPV(OpAtomicOr) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload uint atomicXor(uintr mem, const uint data)" "\n" "= " SPV(OpAtomicXor) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload int atomicXor(intr mem, const int data)" "\n" "= " SPV(OpAtomicXor) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload uint atomicExchange(uintr mem, const uint data)" "\n" "= " SPV(OpAtomicExchange) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload int atomicExchange(intr mem, const int data)" "\n" "= " SPV(OpAtomicExchange) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];" "\n" "@overload uint atomicCompSwap(uintr mem, const uint compare," "\n" "const uint data)" "\n" "= " SPV(OpAtomicCompareExchange) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];""\n" "@overload int atomicCompSwap(intr mem, const int compare," "\n" "const int data)" "\n" "= " SPV(OpAtomicCompareExchange) "[mem, Scope.Device," "\n" - "MemorySemantics.None, data];" "\n" + "MemorySemantics.Relaxed, data];""\n" "#undef intr" "\n" "#undef uintr" "\n" "#undef uint" "\n"