diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-05-17 15:25:42 -0300 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-05-17 15:25:42 -0300 |
| commit | b19c4740823ed8fcebf62bf5741a7614a2ac0aa0 (patch) | |
| tree | 8cdede3fdb90aa35ffe50c004559b80d4704bea3 /Ryujinx.Graphics/Gal/Shader/ShaderDecodeMem.cs | |
| parent | 9b9ead94cd2f25a85468ecf91b7898bf34e10825 (diff) | |
Added more shader instructions, including BFE, BRA (partial), FMNMX, ISCADD, SHL, LD_C, some shader related fixes, added support for texture component selection
Diffstat (limited to 'Ryujinx.Graphics/Gal/Shader/ShaderDecodeMem.cs')
| -rw-r--r-- | Ryujinx.Graphics/Gal/Shader/ShaderDecodeMem.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Ryujinx.Graphics/Gal/Shader/ShaderDecodeMem.cs b/Ryujinx.Graphics/Gal/Shader/ShaderDecodeMem.cs index 24a61c0c..5ca485a3 100644 --- a/Ryujinx.Graphics/Gal/Shader/ShaderDecodeMem.cs +++ b/Ryujinx.Graphics/Gal/Shader/ShaderDecodeMem.cs @@ -1,3 +1,5 @@ +using System; + using static Ryujinx.Graphics.Gal.Shader.ShaderDecodeHelper; namespace Ryujinx.Graphics.Gal.Shader @@ -20,6 +22,41 @@ namespace Ryujinx.Graphics.Gal.Shader } } + public static void Ld_C(ShaderIrBlock Block, long OpCode) + { + int Type = (int)(OpCode >> 48) & 7; + + if (Type > 5) + { + throw new InvalidOperationException(); + } + + int Count = Type == 5 ? 2 : 1; + + for (int Index = 0; Index < Count; Index++) + { + ShaderIrOperCbuf OperA = GetOperCbuf36(OpCode); + ShaderIrOperGpr OperD = GetOperGpr0 (OpCode); + + OperA.Pos += Index; + OperD.Index += Index; + + ShaderIrNode Node = OperA; + + if (Type < 4) + { + //This is a 8 or 16 bits type. + bool Signed = (Type & 1) != 0; + + int Size = 8 << (Type >> 1); + + Node = ExtendTo32(Node, Signed, Size); + } + + Block.AddNode(GetPredNode(new ShaderIrAsg(OperD, Node), OpCode)); + } + } + public static void St_A(ShaderIrBlock Block, long OpCode) { ShaderIrNode[] Opers = GetOperAbuf20(OpCode); |
