From aff8fdb2f8a72e64994ce597cb281359524aa08b Mon Sep 17 00:00:00 2001 From: Samuliak Date: Thu, 16 May 2024 15:55:03 +0200 Subject: [PATCH] add: vertex and instance id arguments --- src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs index 0d0d7470d..745723f6d 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs @@ -113,6 +113,13 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl } } + // TODO: add these only if they are used + if (stage == ShaderStage.Vertex) + { + args = args.Append("uint vertex_id [[vertex_id]]").ToArray(); + args = args.Append("uint instance_id [[instance_id]]").ToArray(); + } + foreach (var constantBuffer in context.Properties.ConstantBuffers.Values) { var varType = constantBuffer.Type.Fields[0].Type & ~AggregateType.Array;