mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-12-23 05:45:47 +00:00
Fix fragment shader bindings
This commit is contained in:
parent
8dca53685a
commit
35cc208435
2 changed files with 9 additions and 3 deletions
|
@ -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})]]",
|
||||
_ => ""
|
||||
};
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue