From aacf29368159ea3029b58b2bf60b3afbb3527138 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 18 Sep 2024 00:43:03 -0300 Subject: [PATCH] Check type --- .../Instructions/InstEmitMemory.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs b/src/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs index 596c7950bb..3fcb821d34 100644 --- a/src/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs +++ b/src/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs @@ -281,7 +281,14 @@ namespace Ryujinx.Graphics.Shader.Instructions } break; case AtomOp.Exch: - res = context.AtomicSwap(storageKind, e0, e1, value); + if (type == AtomSize.S32 || type == AtomSize.U32) + { + res = context.AtomicSwap(storageKind, e0, e1, value); + } + else + { + context.TranslatorContext.GpuAccessor.Log($"Invalid reduction type: {type}."); + } break; default: context.TranslatorContext.GpuAccessor.Log($"Invalid atomic operation: {op}.");