2023-08-03 13:21:32 +00:00
|
|
|
using Ryujinx.Common.Logging;
|
2024-08-31 20:42:56 +00:00
|
|
|
using Ryujinx.Graphics.Shader.StructuredIr;
|
|
|
|
using Ryujinx.Graphics.Shader.Translation;
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
|
|
|
{
|
|
|
|
static class MslGenerator
|
|
|
|
{
|
|
|
|
public static string Generate(StructuredProgramInfo info, ShaderConfig config)
|
|
|
|
{
|
2023-08-03 13:21:32 +00:00
|
|
|
if (config.Stage is not (ShaderStage.Vertex or ShaderStage.Fragment or ShaderStage.Compute))
|
|
|
|
{
|
|
|
|
Logger.Warning?.Print(LogClass.Gpu, $"Attempted to generate unsupported shader type {config.Stage}!");
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
CodeGenContext context = new(info, config);
|
2024-08-31 20:42:56 +00:00
|
|
|
|
|
|
|
Declarations.Declare(context, info);
|
|
|
|
|
|
|
|
return context.GetCode();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|