mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-14 14:49:12 +00:00
Cleanup Shader I/O
This commit is contained in:
parent
35cc208435
commit
70ba3506b0
2 changed files with 14 additions and 11 deletions
|
@ -63,13 +63,14 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
|
|
||||||
public static void DeclareLocals(CodeGenContext context, StructuredFunction function, ShaderStage stage)
|
public static void DeclareLocals(CodeGenContext context, StructuredFunction function, ShaderStage stage)
|
||||||
{
|
{
|
||||||
if (stage == ShaderStage.Vertex)
|
switch (stage)
|
||||||
{
|
{
|
||||||
context.AppendLine("VertexOut out;");
|
case ShaderStage.Vertex:
|
||||||
}
|
context.AppendLine("VertexOut out;");
|
||||||
else if (stage == ShaderStage.Fragment)
|
break;
|
||||||
{
|
case ShaderStage.Fragment:
|
||||||
context.AppendLine("FragmentOut out;");
|
context.AppendLine("FragmentOut out;");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (AstOperand decl in function.Locals)
|
foreach (AstOperand decl in function.Locals)
|
||||||
|
@ -126,7 +127,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
context.AppendLine($"struct FragmentIn");
|
context.AppendLine($"struct FragmentIn");
|
||||||
break;
|
break;
|
||||||
case ShaderStage.Compute:
|
case ShaderStage.Compute:
|
||||||
context.AppendLine($"struct ComputeIn");
|
context.AppendLine($"struct KernelIn");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +173,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
context.AppendLine($"struct FragmentOut");
|
context.AppendLine($"struct FragmentOut");
|
||||||
break;
|
break;
|
||||||
case ShaderStage.Compute:
|
case ShaderStage.Compute:
|
||||||
context.AppendLine($"struct ComputeOut");
|
context.AppendLine($"struct KernelOut");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,9 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
}
|
}
|
||||||
else if (stage == ShaderStage.Compute)
|
else if (stage == ShaderStage.Compute)
|
||||||
{
|
{
|
||||||
// TODO: Compute main
|
funcKeyword = "kernel";
|
||||||
|
funcName = "kernelMain";
|
||||||
|
returnType = "void";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context.AttributeUsage.UsedInputAttributes != 0)
|
if (context.AttributeUsage.UsedInputAttributes != 0)
|
||||||
|
@ -106,11 +108,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
}
|
}
|
||||||
else if (stage == ShaderStage.Fragment)
|
else if (stage == ShaderStage.Fragment)
|
||||||
{
|
{
|
||||||
args = args.Prepend("VertexOut in [[stage_in]]").ToArray();
|
args = args.Prepend("FragmentIn in [[stage_in]]").ToArray();
|
||||||
}
|
}
|
||||||
else if (stage == ShaderStage.Compute)
|
else if (stage == ShaderStage.Compute)
|
||||||
{
|
{
|
||||||
// TODO: Compute input
|
args = args.Prepend("KernelIn in [[stage_in]]").ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue