From 9d26aa8d0697e75eabbc8d1edc58579b8a31c3b0 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 28 Jun 2024 21:13:59 +0100 Subject: [PATCH] Fragment input interpolation qualifiers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes Mario’s shadow in SMO --- .../CodeGen/Msl/Declarations.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs index b15b482db..3179c80a2 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs @@ -299,6 +299,18 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl foreach (var ioDefinition in inputs.OrderBy(x => x.Location)) { + string iq = string.Empty; + + if (context.Definitions.Stage == ShaderStage.Fragment) + { + iq = context.Definitions.ImapTypes[ioDefinition.Location].GetFirstUsedType() switch + { + PixelImap.Constant => "[[flat]] ", + PixelImap.ScreenLinear => "[[center_no_perspective]] ", + _ => string.Empty, + }; + } + string type = ioDefinition.IoVariable switch { // IoVariable.Position => "float4", @@ -329,7 +341,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl _ => "" }; - context.AppendLine($"{type} {name} {suffix};"); + context.AppendLine($"{type} {name} {iq}{suffix};"); } context.LeaveScope(";");