aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2019-12-09 19:23:44 -0300
committerThog <thog@protonmail.com>2020-01-09 02:13:00 +0100
commit3323a3a042c85ce88926771159fc041b5576de60 (patch)
treee5f3540085bee8503b99fc51a213463dd2c7b259
parentad3bc2531ba920d479691e4bd9d9e03373bb28b2 (diff)
Use correct shared memory size (in words, not bytes)
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/Compute.cs2
-rw-r--r--Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs2
2 files changed, 2 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Compute.cs b/Ryujinx.Graphics.Gpu/Engine/Compute.cs
index bbf1eeaa..46857b33 100644
--- a/Ryujinx.Graphics.Gpu/Engine/Compute.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/Compute.cs
@@ -21,7 +21,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
ulong shaderGpuVa = shaderBaseAddress.Pack() + (uint)dispatchParams.ShaderOffset;
// Note: A size of 0 is also invalid, the size must be at least 1.
- int sharedMemorySize = Math.Clamp(dispatchParams.SharedMemorySize & 0xffff, 1, _context.Capabilities.MaximumComputeSharedMemorySize);
+ int sharedMemorySize = Math.Clamp(dispatchParams.SharedMemorySize & 0xffff, 4, _context.Capabilities.MaximumComputeSharedMemorySize);
ComputeShader cs = _shaderCache.GetComputeShader(
shaderGpuVa,
diff --git a/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs b/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs
index 7b9c20eb..d54c1942 100644
--- a/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs
+++ b/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs
@@ -212,7 +212,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
int[] codeCached = MemoryMarshal.Cast<byte, int>(code.Slice(0, program.Size)).ToArray();
- program.Replace(DefineNames.SharedMemorySize, sharedMemorySize.ToString(CultureInfo.InvariantCulture));
+ program.Replace(DefineNames.SharedMemorySize, (sharedMemorySize / 4).ToString(CultureInfo.InvariantCulture));
program.Replace(DefineNames.LocalSizeX, localSizeX.ToString(CultureInfo.InvariantCulture));
program.Replace(DefineNames.LocalSizeY, localSizeY.ToString(CultureInfo.InvariantCulture));