diff options
Diffstat (limited to 'Ryujinx.Graphics')
| -rw-r--r-- | Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs | 3 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Gal/Shader/ShaderDecodeAlu.cs | 15 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Gal/Shader/ShaderIrInst.cs | 1 |
3 files changed, 12 insertions, 7 deletions
diff --git a/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs b/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs index 1bcedacb..77f16b81 100644 --- a/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs +++ b/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs @@ -80,6 +80,7 @@ namespace Ryujinx.Graphics.Gal.Shader { ShaderIrInst.Frcp, GetFrcpExpr }, { ShaderIrInst.Frsq, GetFrsqExpr }, { ShaderIrInst.Fsin, GetFsinExpr }, + { ShaderIrInst.Fsqrt, GetFsqrtExpr }, { ShaderIrInst.Ftos, GetFtosExpr }, { ShaderIrInst.Ftou, GetFtouExpr }, { ShaderIrInst.Ipa, GetIpaExpr }, @@ -716,6 +717,8 @@ namespace Ryujinx.Graphics.Gal.Shader private string GetFsinExpr(ShaderIrOp Op) => GetUnaryCall(Op, "sin"); + private string GetFsqrtExpr(ShaderIrOp Op) => GetUnaryCall(Op, "sqrt"); + private string GetFtosExpr(ShaderIrOp Op) { return "int(" + GetOperExpr(Op, Op.OperandA) + ")"; diff --git a/Ryujinx.Graphics/Gal/Shader/ShaderDecodeAlu.cs b/Ryujinx.Graphics/Gal/Shader/ShaderDecodeAlu.cs index 065ab344..0763d3ca 100644 --- a/Ryujinx.Graphics/Gal/Shader/ShaderDecodeAlu.cs +++ b/Ryujinx.Graphics/Gal/Shader/ShaderDecodeAlu.cs @@ -217,7 +217,7 @@ namespace Ryujinx.Graphics.Gal.Shader public static void Mufu(ShaderIrBlock Block, long OpCode) { - int SubOp = (int)(OpCode >> 20) & 7; + int SubOp = (int)(OpCode >> 20) & 0xf; bool AbsA = ((OpCode >> 46) & 1) != 0; bool NegA = ((OpCode >> 48) & 1) != 0; @@ -226,12 +226,13 @@ namespace Ryujinx.Graphics.Gal.Shader switch (SubOp) { - case 0: Inst = ShaderIrInst.Fcos; break; - case 1: Inst = ShaderIrInst.Fsin; break; - case 2: Inst = ShaderIrInst.Fex2; break; - case 3: Inst = ShaderIrInst.Flg2; break; - case 4: Inst = ShaderIrInst.Frcp; break; - case 5: Inst = ShaderIrInst.Frsq; break; + case 0: Inst = ShaderIrInst.Fcos; break; + case 1: Inst = ShaderIrInst.Fsin; break; + case 2: Inst = ShaderIrInst.Fex2; break; + case 3: Inst = ShaderIrInst.Flg2; break; + case 4: Inst = ShaderIrInst.Frcp; break; + case 5: Inst = ShaderIrInst.Frsq; break; + case 8: Inst = ShaderIrInst.Fsqrt; break; default: throw new NotImplementedException(SubOp.ToString()); } diff --git a/Ryujinx.Graphics/Gal/Shader/ShaderIrInst.cs b/Ryujinx.Graphics/Gal/Shader/ShaderIrInst.cs index 2de50a4a..9841f58f 100644 --- a/Ryujinx.Graphics/Gal/Shader/ShaderIrInst.cs +++ b/Ryujinx.Graphics/Gal/Shader/ShaderIrInst.cs @@ -43,6 +43,7 @@ namespace Ryujinx.Graphics.Gal.Shader Frcp, Frsq, Fsin, + Fsqrt, Ftos, Ftou, Ipa, |
