diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2021-01-27 05:19:30 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-27 09:19:30 +0100 |
| commit | 98d0240ce66f682e10efc3f826a61fc22b633183 (patch) | |
| tree | e4283164ae7365856bc9a0d56eca0a0a9936478f /Ryujinx.Graphics.Shader/CodeGen | |
| parent | a8e9dd2f839bdcd20ec9b32b8647ce2a83e50ecb (diff) | |
Support shader F32 to Bool reinterpretation (#1969)
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen')
| -rw-r--r-- | Ryujinx.Graphics.Shader/CodeGen/Glsl/TypeConversion.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/TypeConversion.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/TypeConversion.cs index 7adc5ad3..b13a74f4 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/TypeConversion.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/TypeConversion.cs @@ -37,8 +37,9 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl { switch (dstType) { - case VariableType.S32: return $"floatBitsToInt({expr})"; - case VariableType.U32: return $"floatBitsToUint({expr})"; + case VariableType.Bool: return $"(floatBitsToInt({expr}) != 0)"; + case VariableType.S32: return $"floatBitsToInt({expr})"; + case VariableType.U32: return $"floatBitsToUint({expr})"; } } else if (dstType == VariableType.F32) |
