From 416dc8fde49f8eb42d47b1ab606028a5cabe8f90 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 30 Aug 2021 14:02:40 -0300 Subject: Fix out-of-bounds shader thread shuffle (#2605) * Fix out-of-bounds shader thread shuffle * Shader cache version bump --- Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/ShuffleUp.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/ShuffleUp.glsl') diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/ShuffleUp.glsl b/Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/ShuffleUp.glsl index 4e74f217..0781678a 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/ShuffleUp.glsl +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/ShuffleUp.glsl @@ -1,9 +1,9 @@ float Helper_ShuffleUp(float x, uint index, uint mask, out bool valid) { - uint clamp = mask & 0x1fu; uint segMask = (mask >> 8) & 0x1fu; uint minThreadId = gl_SubGroupInvocationARB & segMask; uint srcThreadId = gl_SubGroupInvocationARB - index; - valid = srcThreadId >= minThreadId; - return valid ? readInvocationARB(x, srcThreadId) : x; + valid = int(srcThreadId) >= int(minThreadId); + float v = readInvocationARB(x, srcThreadId); + return valid ? v : x; } \ No newline at end of file -- cgit v1.2.3