From 8b2cc4ccf1703c144a5d3f058ecfb19621ba5088 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Wed, 22 May 2024 15:07:12 -0400 Subject: [PATCH] Revert position changes --- .../CodeGen/Msl/Declarations.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs index e87faef78..c2d5e5976 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs @@ -143,11 +143,18 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl context.EnterScope(); + if (context.Definitions.Stage == ShaderStage.Fragment) + { + // TODO: check if it's needed + context.AppendLine("float4 position [[position]];"); + } + + foreach (var ioDefinition in inputs.OrderBy(x => x.Location)) { string type = ioDefinition.IoVariable switch { - IoVariable.Position => "float4", + // IoVariable.Position => "float4", IoVariable.GlobalId => "uint3", IoVariable.VertexId => "uint", IoVariable.VertexIndex => "uint", @@ -155,7 +162,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl }; string name = ioDefinition.IoVariable switch { - IoVariable.Position => "position", + // IoVariable.Position => "position", IoVariable.GlobalId => "global_id", IoVariable.VertexId => "vertex_id", IoVariable.VertexIndex => "vertex_index", @@ -163,7 +170,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl }; string suffix = ioDefinition.IoVariable switch { - IoVariable.Position => "[[position]]", + // IoVariable.Position => "[[position]]", IoVariable.GlobalId => "[[thread_position_in_grid]]", IoVariable.VertexId => "[[vertex_id]]", // TODO: Avoid potential redeclaration