mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-08-08 01:32:33 -07:00
Only declare main func out in main Fix simd_ballot Fix thread_index_in_simdgroup outside of compute Fix atomic operations instance_index
22 lines
753 B
C#
22 lines
753 B
C#
using Ryujinx.Graphics.Shader.StructuredIr;
|
|
using Ryujinx.Graphics.Shader.Translation;
|
|
|
|
using static Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions.InstGenHelper;
|
|
using static Ryujinx.Graphics.Shader.StructuredIr.InstructionInfo;
|
|
|
|
namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
|
{
|
|
static class InstGenBallot
|
|
{
|
|
public static string Ballot(CodeGenContext context, AstOperation operation)
|
|
{
|
|
AggregateType dstType = GetSrcVarType(operation.Inst, 0);
|
|
|
|
string arg = GetSourceExpr(context, operation.GetSource(0), dstType);
|
|
char component = "xyzw"[operation.Index];
|
|
|
|
return $"uint4(as_type<uint2>((simd_vote::vote_t)simd_ballot({arg})), 0, 0).{component}";
|
|
}
|
|
}
|
|
}
|