From 84a8edf675e991c1b396f5353032483c1f6b0ef5 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Tue, 19 Mar 2024 16:14:37 -0400 Subject: [PATCH] Fix MSL Reinterpret Casts --- .../CodeGen/Msl/TypeConversion.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/TypeConversion.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/TypeConversion.cs index 44666c323..cb1075d08 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/TypeConversion.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/TypeConversion.cs @@ -3,6 +3,7 @@ using Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions; using Ryujinx.Graphics.Shader.IntermediateRepresentation; using Ryujinx.Graphics.Shader.StructuredIr; using Ryujinx.Graphics.Shader.Translation; +using System; namespace Ryujinx.Graphics.Shader.CodeGen.Msl { @@ -39,11 +40,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl switch (dstType) { case AggregateType.Bool: - return $"(floatBitsToInt({expr}) != 0)"; + return $"(as_type({expr}) != 0)"; case AggregateType.S32: - return $"floatBitsToInt({expr})"; + return $"as_type({expr})"; case AggregateType.U32: - return $"floatBitsToUint({expr})"; + return $"as_type({expr})"; } } else if (dstType == AggregateType.FP32) @@ -51,11 +52,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl switch (srcType) { case AggregateType.Bool: - return $"intBitsToFloat({ReinterpretBoolToInt(expr, node, AggregateType.S32)})"; + return $"as_type({ReinterpretBoolToInt(expr, node, AggregateType.S32)})"; case AggregateType.S32: - return $"intBitsToFloat({expr})"; + return $"as_type({expr})"; case AggregateType.U32: - return $"uintBitsToFloat({expr})"; + return $"as_type({expr})"; } } else if (srcType == AggregateType.Bool)