aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-06-23 02:00:44 -0300
committerGitHub <noreply@github.com>2018-06-23 02:00:44 -0300
commitc26ddd6259796e5b0b187989ce3e21b52edb00a8 (patch)
treeff4decb3f102b07a832e7a5d24fa8ba702126906 /Ryujinx.Graphics
parent5182361f4b59069af1f185db73f7569d3031558a (diff)
Fix 3 graphics related issues (#180)
* Fix 3 graphics related bugs * OGLShader shouldn't be public (yet)
Diffstat (limited to 'Ryujinx.Graphics')
-rw-r--r--Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs3
-rw-r--r--Ryujinx.Graphics/Gal/Shader/ShaderDecodeAlu.cs15
-rw-r--r--Ryujinx.Graphics/Gal/Shader/ShaderIrInst.cs1
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,