Warn when generating unsupported shader

This commit is contained in:
Isaac Marovitz 2023-08-03 09:21:32 -04:00 committed by Isaac Marovitz
parent d0d5c76f06
commit 27effab989
3 changed files with 9 additions and 3 deletions

View file

@ -20,7 +20,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
public CodeGenContext(StructuredProgramInfo info, ShaderConfig config)
{
Info = info;
Config = Config;
Config = config;
_sb = new StringBuilder();
}

View file

@ -1,4 +1,3 @@
using Ryujinx.Graphics.Shader.CodeGen.Glsl;
using Ryujinx.Graphics.Shader.StructuredIr;
namespace Ryujinx.Graphics.Shader.CodeGen.Msl

View file

@ -1,3 +1,4 @@
using Ryujinx.Common.Logging;
using Ryujinx.Graphics.Shader.StructuredIr;
using Ryujinx.Graphics.Shader.Translation;
@ -7,7 +8,13 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
{
public static string Generate(StructuredProgramInfo info, ShaderConfig config)
{
CodeGenContext context = new CodeGenContext(info, config);
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);
Declarations.Declare(context, info);