Add ATOMS, LDS, POPC, RED, STS and VOTE shader instructions, start changing the way how global memory is handled
This commit is contained in:
parent
1e8bc29f32
commit
769c02235f
44 changed files with 949 additions and 242 deletions
48
Ryujinx.Graphics.Shader/Instructions/InstEmitVote.cs
Normal file
48
Ryujinx.Graphics.Shader/Instructions/InstEmitVote.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using Ryujinx.Graphics.Shader.Decoders;
|
||||
using Ryujinx.Graphics.Shader.IntermediateRepresentation;
|
||||
using Ryujinx.Graphics.Shader.Translation;
|
||||
|
||||
using static Ryujinx.Graphics.Shader.Instructions.InstEmitHelper;
|
||||
using static Ryujinx.Graphics.Shader.IntermediateRepresentation.OperandHelper;
|
||||
|
||||
namespace Ryujinx.Graphics.Shader.Instructions
|
||||
{
|
||||
static partial class InstEmit
|
||||
{
|
||||
public static void Vote(EmitterContext context)
|
||||
{
|
||||
OpCodeVote op = (OpCodeVote)context.CurrOp;
|
||||
|
||||
Operand pred = GetPredicate39(context);
|
||||
|
||||
Operand res = null;
|
||||
|
||||
switch (op.VoteOp)
|
||||
{
|
||||
case VoteOp.All:
|
||||
res = context.VoteAll(pred);
|
||||
break;
|
||||
case VoteOp.Any:
|
||||
res = context.VoteAny(pred);
|
||||
break;
|
||||
case VoteOp.AllEqual:
|
||||
res = context.VoteAllEqual(pred);
|
||||
break;
|
||||
}
|
||||
|
||||
if (res != null)
|
||||
{
|
||||
context.Copy(Register(op.Predicate45), res);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Invalid.
|
||||
}
|
||||
|
||||
if (!op.Rd.IsRZ)
|
||||
{
|
||||
context.Copy(Register(op.Rd), context.Ballot(pred));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue