aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-01-26 03:38:33 -0300
committerGitHub <noreply@github.com>2021-01-26 17:38:33 +1100
commite453ba69f42057d36559b2c84b6ad9f01eaf4c86 (patch)
treec7c62a2f40a2197bc9e1a41ab1e45a1a5c93a382 /Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs
parentc19cfca183cbbae8091688a292242032c3f337cb (diff)
Add support for shader atomic min/max (S32) (#1948)
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs')
-rw-r--r--Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs14
1 files changed, 9 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs
index 388f0c25..7d0f1aa5 100644
--- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs
+++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs
@@ -42,13 +42,18 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
for (int argIndex = 0; argIndex < arity; argIndex++)
{
+ // For shared memory access, the second argument is unused and should be ignored.
+ // It is there to make both storage and shared access have the same number of arguments.
+ if (argIndex == 1 && (inst & Instruction.MrMask) == Instruction.MrShared)
+ {
+ continue;
+ }
+
if (argIndex != 0)
{
args += ", ";
}
- VariableType dstType = GetSrcVarType(inst, argIndex);
-
if (argIndex == 0 && atomic)
{
Instruction memRegion = inst & Instruction.MrMask;
@@ -60,12 +65,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
default: throw new InvalidOperationException($"Invalid memory region \"{memRegion}\".");
}
-
- // We use the first 2 operands above.
- argIndex++;
}
else
{
+ VariableType dstType = GetSrcVarType(inst, argIndex);
+
args += GetSoureExpr(context, operation.GetSource(argIndex), dstType);
}
}