WIP V2: Experimental: Metal backend #441

Merged
GreemDev merged 369 commits from new-metal into master 2024-12-24 06:55:16 +00:00
Showing only changes of commit c160810bfc - Show all commits

View File

@ -299,6 +299,18 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
foreach (var ioDefinition in inputs.OrderBy(x => x.Location)) 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 string type = ioDefinition.IoVariable switch
{ {
// IoVariable.Position => "float4", // 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(";"); context.LeaveScope(";");