mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-15 09:41:15 +01:00
f08a280ade
* Use shader subgroup extensions if shader ballot is not supported * Shader cache version bump + cleanup * The type is still required on the table
26 lines
815 B
C#
26 lines
815 B
C#
using Ryujinx.Graphics.Shader.StructuredIr;
|
|
|
|
using static Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions.InstGenHelper;
|
|
using static Ryujinx.Graphics.Shader.StructuredIr.InstructionInfo;
|
|
|
|
namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
|
|
{
|
|
static class InstGenBallot
|
|
{
|
|
public static string Ballot(CodeGenContext context, AstOperation operation)
|
|
{
|
|
VariableType dstType = GetSrcVarType(operation.Inst, 0);
|
|
|
|
string arg = GetSoureExpr(context, operation.GetSource(0), dstType);
|
|
|
|
if (context.Config.GpuAccessor.QueryHostSupportsShaderBallot())
|
|
{
|
|
return $"unpackUint2x32(ballotARB({arg})).x";
|
|
}
|
|
else
|
|
{
|
|
return $"subgroupBallot({arg}).x";
|
|
}
|
|
}
|
|
}
|
|
} |