Fix IoMap variable names

Output struct

Lazy Vertex IO

Output fixes

Fix output struct definition

MSL Binding Model description

Might need tweaks/adjustments

Cleanup

Typo + Format
This commit is contained in:
Isaac Marovitz 2023-10-09 11:33:28 -04:00 committed by Isaac Marovitz
parent d5758cb310
commit 98e2ab5a49
4 changed files with 90 additions and 21 deletions

View file

@ -51,7 +51,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
context.AppendLine(GetFunctionSignature(context, function, stage, isMainFunc));
context.EnterScope();
Declarations.DeclareLocals(context, function);
Declarations.DeclareLocals(context, function, stage);
PrintBlock(context, function.MainBlock, isMainFunc);
@ -77,6 +77,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
string funcKeyword = "inline";
string funcName = null;
string returnType = Declarations.GetVarTypeName(context, function.ReturnType);
if (isMainFunc)
{
@ -84,6 +85,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
{
funcKeyword = "vertex";
funcName = "vertexMain";
returnType = "VertexOutput";
}
else if (stage == ShaderStage.Fragment)
{
@ -112,7 +114,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
}
}
return $"{funcKeyword} {Declarations.GetVarTypeName(context, function.ReturnType)} {funcName ?? function.Name}({string.Join(", ", args)})";
return $"{funcKeyword} {returnType} {funcName ?? function.Name}({string.Join(", ", args)})";
}
private static void PrintBlock(CodeGenContext context, AstBlock block, bool isMainFunction)