|
@@ -222,20 +222,38 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|
|
context.TranslatorContext.GpuAccessor.Log($"Invalid reduction type: {type}.");
|
|
context.TranslatorContext.GpuAccessor.Log($"Invalid reduction type: {type}.");
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
- case AtomOp.And:
|
|
|
|
|
- if (type == AtomSize.S32 || type == AtomSize.U32)
|
|
|
|
|
|
|
+ case AtomOp.Min:
|
|
|
|
|
+ if (type == AtomSize.S32)
|
|
|
{
|
|
{
|
|
|
- res = context.AtomicAnd(storageKind, e0, e1, value);
|
|
|
|
|
|
|
+ res = context.AtomicMinS32(storageKind, e0, e1, value);
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (type == AtomSize.U32)
|
|
|
|
|
+ {
|
|
|
|
|
+ res = context.AtomicMinU32(storageKind, e0, e1, value);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
context.TranslatorContext.GpuAccessor.Log($"Invalid reduction type: {type}.");
|
|
context.TranslatorContext.GpuAccessor.Log($"Invalid reduction type: {type}.");
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
- case AtomOp.Xor:
|
|
|
|
|
|
|
+ case AtomOp.Max:
|
|
|
|
|
+ if (type == AtomSize.S32)
|
|
|
|
|
+ {
|
|
|
|
|
+ res = context.AtomicMaxS32(storageKind, e0, e1, value);
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (type == AtomSize.U32)
|
|
|
|
|
+ {
|
|
|
|
|
+ res = context.AtomicMaxU32(storageKind, e0, e1, value);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ context.TranslatorContext.GpuAccessor.Log($"Invalid reduction type: {type}.");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case AtomOp.And:
|
|
|
if (type == AtomSize.S32 || type == AtomSize.U32)
|
|
if (type == AtomSize.S32 || type == AtomSize.U32)
|
|
|
{
|
|
{
|
|
|
- res = context.AtomicXor(storageKind, e0, e1, value);
|
|
|
|
|
|
|
+ res = context.AtomicAnd(storageKind, e0, e1, value);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -252,34 +270,29 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|
|
context.TranslatorContext.GpuAccessor.Log($"Invalid reduction type: {type}.");
|
|
context.TranslatorContext.GpuAccessor.Log($"Invalid reduction type: {type}.");
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
- case AtomOp.Max:
|
|
|
|
|
- if (type == AtomSize.S32)
|
|
|
|
|
- {
|
|
|
|
|
- res = context.AtomicMaxS32(storageKind, e0, e1, value);
|
|
|
|
|
- }
|
|
|
|
|
- else if (type == AtomSize.U32)
|
|
|
|
|
|
|
+ case AtomOp.Xor:
|
|
|
|
|
+ if (type == AtomSize.S32 || type == AtomSize.U32)
|
|
|
{
|
|
{
|
|
|
- res = context.AtomicMaxU32(storageKind, e0, e1, value);
|
|
|
|
|
|
|
+ res = context.AtomicXor(storageKind, e0, e1, value);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
context.TranslatorContext.GpuAccessor.Log($"Invalid reduction type: {type}.");
|
|
context.TranslatorContext.GpuAccessor.Log($"Invalid reduction type: {type}.");
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
- case AtomOp.Min:
|
|
|
|
|
- if (type == AtomSize.S32)
|
|
|
|
|
- {
|
|
|
|
|
- res = context.AtomicMinS32(storageKind, e0, e1, value);
|
|
|
|
|
- }
|
|
|
|
|
- else if (type == AtomSize.U32)
|
|
|
|
|
|
|
+ case AtomOp.Exch:
|
|
|
|
|
+ if (type == AtomSize.S32 || type == AtomSize.U32)
|
|
|
{
|
|
{
|
|
|
- res = context.AtomicMinU32(storageKind, e0, e1, value);
|
|
|
|
|
|
|
+ res = context.AtomicSwap(storageKind, e0, e1, value);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
context.TranslatorContext.GpuAccessor.Log($"Invalid reduction type: {type}.");
|
|
context.TranslatorContext.GpuAccessor.Log($"Invalid reduction type: {type}.");
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ context.TranslatorContext.GpuAccessor.Log($"Invalid atomic operation: {op}.");
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
return res;
|