Back to where we were

First special instruction

Start Load/Store implementation

Start TextureSample

Sample progress

I/O Load/Store Progress

Rest of load/store

TODO: Currently, the generator still assumes the GLSL style of I/O attributres. On MSL, the vertex function should output a struct which contains a float4 with the required position attribute.

TextureSize and VectorExtract

Fix UserDefined IO Vars

Fix stage input struct names
This commit is contained in:
Isaac Marovitz 2023-08-15 14:17:00 +01:00 committed by Isaac Marovitz
parent 5198fcb881
commit a1b314acd2
10 changed files with 507 additions and 43 deletions

View file

@ -3,7 +3,10 @@ using Ryujinx.Graphics.Shader.StructuredIr;
using Ryujinx.Graphics.Shader.Translation;
using System;
using static Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions.InstGenCall;
using static Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions.InstGenHelper;
using static Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions.InstGenMemory;
using static Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions.InstGenVector;
using static Ryujinx.Graphics.Shader.StructuredIr.InstructionInfo;
namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
@ -105,7 +108,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
case Instruction.Barrier:
return "|| BARRIER ||";
case Instruction.Call:
return "|| CALL ||";
return Call(context, operation);
case Instruction.FSIBegin:
return "|| FSI BEGIN ||";
case Instruction.FSIEnd:
@ -125,25 +128,26 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
case Instruction.ImageAtomic:
return "|| IMAGE ATOMIC ||";
case Instruction.Load:
return "|| LOAD ||";
return Load(context, operation);
case Instruction.Lod:
return "|| LOD ||";
case Instruction.MemoryBarrier:
return "|| MEMORY BARRIER ||";
case Instruction.Store:
return "|| STORE ||";
return Store(context, operation);
case Instruction.TextureSample:
return "|| TEXTURE SAMPLE ||";
return TextureSample(context, operation);
case Instruction.TextureSize:
return "|| TEXTURE SIZE ||";
return TextureSize(context, operation);
case Instruction.VectorExtract:
return "|| VECTOR EXTRACT ||";
return VectorExtract(context, operation);
case Instruction.VoteAllEqual:
return "|| VOTE ALL EQUAL ||";
}
}
throw new InvalidOperationException($"Unexpected instruction type \"{info.Type}\".");
// TODO: Return this to being an error
return $"Unexpected instruction type \"{info.Type}\".";
}
}
}