Add support for shader atomic min/max (S32) (#1948)
This commit is contained in:
parent
c19cfca183
commit
e453ba69f4
11 changed files with 103 additions and 21 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue