diff options
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen')
| -rw-r--r-- | Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs | 10 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Shader/CodeGen/Glsl/NumberFormatter.cs | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs index 1acac745..388285a8 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs @@ -35,8 +35,16 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions VariableType type = GetSrcVarType(operation.Inst, 0); string srcExpr = GetSoureExpr(context, src, type); + string zero; - NumberFormatter.TryFormat(0, type, out string zero); + if (type == VariableType.F64) + { + zero = "0.0"; + } + else + { + NumberFormatter.TryFormat(0, type, out zero); + } // Starting in the 496.13 NVIDIA driver, there's an issue with assigning variables to negated expressions. // (-expr) does not work, but (0.0 - expr) does. This should be removed once the issue is resolved. diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/NumberFormatter.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/NumberFormatter.cs index 6d43ed0e..2ec44277 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/NumberFormatter.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/NumberFormatter.cs @@ -10,7 +10,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl public static bool TryFormat(int value, VariableType dstType, out string formatted) { - if (dstType == VariableType.F32 || dstType == VariableType.F64) + if (dstType == VariableType.F32) { return TryFormatFloat(BitConverter.Int32BitsToSingle(value), out formatted); } |
