instance_index

This commit is contained in:
Isaac Marovitz 2024-06-22 14:05:54 +01:00
parent d6fd565492
commit 4abe554188
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1
2 changed files with 3 additions and 0 deletions

View file

@ -75,6 +75,8 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
{
case ShaderStage.Vertex:
context.AppendLine("VertexOut out;");
// TODO: Only add if necessary
context.AppendLine("uint instance_index = instance_id + base_instance;");
break;
case ShaderStage.Fragment:
context.AppendLine("FragmentOut out;");

View file

@ -26,6 +26,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
IoVariable.FrontFacing => ("in.front_facing", AggregateType.Bool),
IoVariable.GlobalId => ("thread_position_in_grid", AggregateType.Vector3 | AggregateType.U32),
IoVariable.InstanceId => ("instance_id", AggregateType.U32),
IoVariable.InstanceIndex => ("instance_index", AggregateType.U32),
IoVariable.InvocationId => ("INVOCATION_ID", AggregateType.S32),
IoVariable.PointCoord => ("point_coord", AggregateType.Vector2 | AggregateType.FP32),
IoVariable.PointSize => ("out.point_size", AggregateType.FP32),