Add support for shader atomic min/max (S32) (#1948)

This commit is contained in:
gdkchan 2021-01-26 03:38:33 -03:00 committed by GitHub
parent c19cfca183
commit e453ba69f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 103 additions and 21 deletions

View file

@ -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);
}
}