Warn when generating unsupported shader

This commit is contained in:
Isaac Marovitz 2023-08-03 09:21:32 -04:00
parent 288cc5bc04
commit 9bff5bcaf6
No known key found for this signature in database
GPG Key ID: 97250B2B09A132E1
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);