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/ShuffleDown.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/ShuffleDown.glsl') diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/ShuffleDown.glsl b/Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/ShuffleDown.glsl index a79b90e2..45012550 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/ShuffleDown.glsl +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/ShuffleDown.glsl @@ -6,5 +6,6 @@ float Helper_ShuffleDown(float x, uint index, uint mask, out bool valid) uint maxThreadId = minThreadId | (clamp & ~segMask); uint srcThreadId = gl_SubGroupInvocationARB + index; valid = srcThreadId <= maxThreadId; - return valid ? readInvocationARB(x, srcThreadId) : x; + float v = readInvocationARB(x, srcThreadId); + return valid ? v : x; } \ No newline at end of file -- cgit v1.2.3