mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-12-24 13:15:47 +00:00
b9aa3966c0
interpreter, and a rewrite of the GPU code.
59 lines
No EOL
1.7 KiB
C#
59 lines
No EOL
1.7 KiB
C#
using static Ryujinx.Graphics.Gal.Shader.ShaderDecodeHelper;
|
|
|
|
namespace Ryujinx.Graphics.Gal.Shader
|
|
{
|
|
static partial class ShaderDecode
|
|
{
|
|
public static void Ld_A(ShaderIrBlock Block, long OpCode)
|
|
{
|
|
ShaderIrNode[] Opers = GetOperAbuf20(OpCode);
|
|
|
|
int Index = 0;
|
|
|
|
foreach (ShaderIrNode OperA in Opers)
|
|
{
|
|
ShaderIrOperGpr OperD = GetOperGpr0(OpCode);
|
|
|
|
OperD.Index += Index++;
|
|
|
|
Block.AddNode(GetPredNode(new ShaderIrAsg(OperD, OperA), OpCode));
|
|
}
|
|
}
|
|
|
|
public static void St_A(ShaderIrBlock Block, long OpCode)
|
|
{
|
|
ShaderIrNode[] Opers = GetOperAbuf20(OpCode);
|
|
|
|
int Index = 0;
|
|
|
|
foreach (ShaderIrNode OperA in Opers)
|
|
{
|
|
ShaderIrOperGpr OperD = GetOperGpr0(OpCode);
|
|
|
|
OperD.Index += Index++;
|
|
|
|
Block.AddNode(GetPredNode(new ShaderIrAsg(OperA, OperD), OpCode));
|
|
}
|
|
}
|
|
|
|
public static void Texs(ShaderIrBlock Block, long OpCode)
|
|
{
|
|
//TODO: Support other formats.
|
|
ShaderIrNode OperA = GetOperGpr8 (OpCode);
|
|
ShaderIrNode OperB = GetOperGpr20 (OpCode);
|
|
ShaderIrNode OperC = GetOperGpr28 (OpCode);
|
|
ShaderIrNode OperD = GetOperImm13_36(OpCode);
|
|
|
|
for (int Ch = 0; Ch < 4; Ch++)
|
|
{
|
|
ShaderIrOp Op = new ShaderIrOp(ShaderIrInst.Texr + Ch, OperA, OperB, OperD);
|
|
|
|
ShaderIrOperGpr Dst = GetOperGpr0(OpCode);
|
|
|
|
Dst.Index += Ch;
|
|
|
|
Block.AddNode(new ShaderIrAsg(Dst, Op));
|
|
}
|
|
}
|
|
}
|
|
} |