WIP V2: Experimental: Metal backend #441

Merged
GreemDev merged 369 commits from new-metal into master 2024-12-24 06:55:16 +00:00
2 changed files with 9 additions and 3 deletions
Showing only changes of commit 987a42ce30 - Show all commits

View File

@ -123,7 +123,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
context.AppendLine($"struct VertexIn");
break;
case ShaderStage.Fragment:
context.AppendLine($"struct VertexOut");
context.AppendLine($"struct FragmentIn");
break;
case ShaderStage.Compute:
context.AppendLine($"struct ComputeIn");
@ -136,7 +136,12 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
{
string type = GetVarTypeName(context, context.Definitions.GetUserDefinedType(ioDefinition.Location, isOutput: false));
string name = $"{DefaultNames.IAttributePrefix}{ioDefinition.Location}";
string suffix = context.Definitions.Stage == ShaderStage.Vertex ? $" [[attribute({ioDefinition.Location})]]" : "";
string suffix = context.Definitions.Stage switch
{
ShaderStage.Vertex => $" [[attribute({ioDefinition.Location})]]",
ShaderStage.Fragment => $" [[user(loc{ioDefinition.Location})]]",
_ => ""
};
context.AppendLine($"{type} {name}{suffix};");
}
@ -192,6 +197,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
{
IoVariable.Position => " [[position]]",
IoVariable.PointSize => " [[point_size]]",
IoVariable.UserDefined => $" [[user(loc{ioDefinition.Location})]]",
IoVariable.FragmentOutputColor => $" [[color({ioDefinition.Location})]]",
_ => ""
};

View File

@ -106,7 +106,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
}
else if (stage == ShaderStage.Fragment)
{
args = args.Prepend("VertexOut in").ToArray();
args = args.Prepend("VertexOut in [[stage_in]]").ToArray();
}
else if (stage == ShaderStage.Compute)
{