From 98d0240ce66f682e10efc3f826a61fc22b633183 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 27 Jan 2021 05:19:30 -0300 Subject: [PATCH] Support shader F32 to Bool reinterpretation (#1969) --- Ryujinx.Graphics.Shader/CodeGen/Glsl/TypeConversion.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/TypeConversion.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/TypeConversion.cs index 7adc5ad33..b13a74f45 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)