Fragment input interpolation qualifiers

Fixes Mario’s shadow in SMO
This commit is contained in:
Isaac Marovitz 2024-06-28 21:13:59 +01:00
parent b950e12ab8
commit 88ce186191
No known key found for this signature in database
GPG Key ID: 97250B2B09A132E1
1 changed files with 13 additions and 1 deletions

View File

@ -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(";");