Fix stage input struct names
This commit is contained in:
parent
cb971781d8
commit
e2ded6bc4f
2 changed files with 32 additions and 2 deletions
|
@ -77,7 +77,22 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
{
|
{
|
||||||
if (inputs.Any())
|
if (inputs.Any())
|
||||||
{
|
{
|
||||||
context.AppendLine("struct VertexIn");
|
string prefix = "";
|
||||||
|
|
||||||
|
switch (context.Definitions.Stage)
|
||||||
|
{
|
||||||
|
case ShaderStage.Vertex:
|
||||||
|
prefix = "Vertex";
|
||||||
|
break;
|
||||||
|
case ShaderStage.Fragment:
|
||||||
|
prefix = "Fragment";
|
||||||
|
break;
|
||||||
|
case ShaderStage.Compute:
|
||||||
|
prefix = "Compute";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
context.AppendLine($"struct {prefix}In");
|
||||||
context.EnterScope();
|
context.EnterScope();
|
||||||
|
|
||||||
foreach (var ioDefinition in inputs.OrderBy(x => x.Location))
|
foreach (var ioDefinition in inputs.OrderBy(x => x.Location))
|
||||||
|
|
|
@ -90,10 +90,25 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
funcKeyword = "fragment";
|
funcKeyword = "fragment";
|
||||||
funcName = "fragmentMain";
|
funcName = "fragmentMain";
|
||||||
}
|
}
|
||||||
|
else if (stage == ShaderStage.Compute)
|
||||||
|
{
|
||||||
|
// TODO: Compute main
|
||||||
|
}
|
||||||
|
|
||||||
if (context.AttributeUsage.UsedInputAttributes != 0)
|
if (context.AttributeUsage.UsedInputAttributes != 0)
|
||||||
{
|
{
|
||||||
args = args.Prepend("VertexIn in [[stage_in]]").ToArray();
|
if (stage == ShaderStage.Vertex)
|
||||||
|
{
|
||||||
|
args = args.Prepend("VertexIn in [[stage_in]]").ToArray();
|
||||||
|
}
|
||||||
|
else if (stage == ShaderStage.Fragment)
|
||||||
|
{
|
||||||
|
args = args.Prepend("FragmentIn in [[stage_in]]").ToArray();
|
||||||
|
}
|
||||||
|
else if (stage == ShaderStage.Compute)
|
||||||
|
{
|
||||||
|
// TODO: Compute input
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue