mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-10-02 16:50:20 -07:00

* Move shuffle handling out of the backend to a transform pass * Handle subgroup sizes higher than 32 * Stop using the subgroup size control extension * Make GenerateShuffleFunction static * Shader cache version bump
26 lines
828 B
C#
26 lines
828 B
C#
using Ryujinx.Graphics.Shader.StructuredIr;
|
|
using Ryujinx.Graphics.Shader.Translation;
|
|
|
|
using static Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions.InstGenHelper;
|
|
|
|
namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
|
|
{
|
|
static class InstGenShuffle
|
|
{
|
|
public static string Shuffle(CodeGenContext context, AstOperation operation)
|
|
{
|
|
string value = GetSoureExpr(context, operation.GetSource(0), AggregateType.FP32);
|
|
string index = GetSoureExpr(context, operation.GetSource(1), AggregateType.U32);
|
|
|
|
if (context.HostCapabilities.SupportsShaderBallot)
|
|
{
|
|
return $"readInvocationARB({value}, {index})";
|
|
}
|
|
else
|
|
{
|
|
return $"subgroupShuffle({value}, {index})";
|
|
}
|
|
}
|
|
}
|
|
}
|