From a6ff9be85f3c4f3f852d85a797643f848ec58911 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 21 Jun 2024 16:58:58 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20vertex=20=E2=80=9Cbuilt-ins=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CodeGen/Msl/Instructions/IoMap.cs | 6 +++--- src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/IoMap.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/IoMap.cs index 1561271d0c..38b9fff0df 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/IoMap.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/IoMap.cs @@ -17,15 +17,15 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions { var returnValue = ioVariable switch { - IoVariable.BaseInstance => ("base_instance", AggregateType.S32), - IoVariable.BaseVertex => ("base_vertex", AggregateType.S32), + IoVariable.BaseInstance => ("base_instance", AggregateType.U32), + IoVariable.BaseVertex => ("base_vertex", AggregateType.U32), IoVariable.CtaId => ("threadgroup_position_in_grid", AggregateType.Vector3 | AggregateType.U32), IoVariable.ClipDistance => ("clip_distance", AggregateType.Array | AggregateType.FP32), IoVariable.FragmentOutputColor => ($"out.color{location}", AggregateType.Vector4 | AggregateType.FP32), IoVariable.FragmentOutputDepth => ("out.depth", AggregateType.FP32), IoVariable.FrontFacing => ("in.front_facing", AggregateType.Bool), IoVariable.GlobalId => ("thread_position_in_grid", AggregateType.Vector3 | AggregateType.U32), - IoVariable.InstanceId => ("instance_id", AggregateType.S32), + IoVariable.InstanceId => ("instance_id", AggregateType.U32), IoVariable.InvocationId => ("INVOCATION_ID", AggregateType.S32), IoVariable.PointCoord => ("point_coord", AggregateType.Vector2 | AggregateType.FP32), IoVariable.PointSize => ("out.point_size", AggregateType.FP32), diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs index bb5ea5f6f6..a3e09d3cb6 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs @@ -137,6 +137,8 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl { args = args.Append("uint vertex_id [[vertex_id]]").ToArray(); args = args.Append("uint instance_id [[instance_id]]").ToArray(); + args = args.Append("uint base_instance [[base_instance]]").ToArray(); + args = args.Append("uint base_vertex [[base_vertex]]").ToArray(); } else if (stage == ShaderStage.Compute) {