Merge shader branch, adding support for GLSL decompilation, a macro
interpreter, and a rewrite of the GPU code.
This commit is contained in:
parent
7acd0e0122
commit
b9aa3966c0
77 changed files with 5301 additions and 766 deletions
59
Ryujinx.Graphics/Gal/Shader/ShaderDecodeMem.cs
Normal file
59
Ryujinx.Graphics/Gal/Shader/ShaderDecodeMem.cs
Normal file
|
@ -0,0 +1,59 @@
|
|||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue