Transition to use ShadingLanguage name

This commit is contained in:
sunshineinabox 2024-02-05 08:26:32 -08:00
parent 7c8245679c
commit c77ab1d97f
9 changed files with 8 additions and 30 deletions

View file

@ -414,7 +414,7 @@ namespace Ryujinx.Ava.UI.Windows
GraphicsConfig.MaxAnisotropy = ConfigurationState.Instance.Graphics.MaxAnisotropy; GraphicsConfig.MaxAnisotropy = ConfigurationState.Instance.Graphics.MaxAnisotropy;
GraphicsConfig.ShadersDumpPath = ConfigurationState.Instance.Graphics.ShadersDumpPath; GraphicsConfig.ShadersDumpPath = ConfigurationState.Instance.Graphics.ShadersDumpPath;
GraphicsConfig.EnableShaderCache = ConfigurationState.Instance.Graphics.EnableShaderCache; GraphicsConfig.EnableShaderCache = ConfigurationState.Instance.Graphics.EnableShaderCache;
GraphicsConfig.EnableOGLSpirV = ConfigurationState.Instance.Graphics.ShadingLanguage; GraphicsConfig.ShadingLanguage = ConfigurationState.Instance.Graphics.ShadingLanguage;
GraphicsConfig.EnableTextureRecompression = ConfigurationState.Instance.Graphics.EnableTextureRecompression; GraphicsConfig.EnableTextureRecompression = ConfigurationState.Instance.Graphics.EnableTextureRecompression;
GraphicsConfig.EnableMacroHLE = ConfigurationState.Instance.Graphics.EnableMacroHLE; GraphicsConfig.EnableMacroHLE = ConfigurationState.Instance.Graphics.EnableMacroHLE;
#pragma warning restore IDE0055 #pragma warning restore IDE0055

View file

@ -61,9 +61,9 @@ namespace Ryujinx.Graphics.Gpu
public static bool EnableShaderCache; public static bool EnableShaderCache;
/// <summary> /// <summary>
/// Enables or disables Spir-V on OpenGL. /// Select Shading Language to use.
/// </summary> /// </summary>
public static ShadingLanguage EnableOGLSpirV = ShadingLanguage.SPIRV; public static ShadingLanguage ShadingLanguage = ShadingLanguage.SPIRV;
/// <summary> /// <summary>
/// Enables or disables shader SPIR-V compilation. /// Enables or disables shader SPIR-V compilation.

View file

@ -397,7 +397,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
IProgram hostProgram; IProgram hostProgram;
if (context.Capabilities.Api == TargetApi.Vulkan || (GraphicsConfig.EnableOGLSpirV == ShadingLanguage.SPIRV)) if (context.Capabilities.Api == TargetApi.Vulkan || (GraphicsConfig.ShadingLanguage == ShadingLanguage.SPIRV))
{ {
ShaderSource[] shaderSources = ShaderBinarySerializer.Unpack(shaders, hostCode); ShaderSource[] shaderSources = ShaderBinarySerializer.Unpack(shaders, hostCode);

View file

@ -505,7 +505,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
CachedShaderProgram program = new(hostProgram, compilation.SpecializationState, compilation.Shaders); CachedShaderProgram program = new(hostProgram, compilation.SpecializationState, compilation.Shaders);
// Vulkan's binary code is the SPIR-V used for compilation, so it is ready immediately. Other APIs get this after compilation. // Vulkan's binary code is the SPIR-V used for compilation, so it is ready immediately. Other APIs get this after compilation.
byte[] binaryCode = (_context.Capabilities.Api == TargetApi.Vulkan || (GraphicsConfig.EnableOGLSpirV == ShadingLanguage.SPIRV)) ? ShaderBinarySerializer.Pack(shaderSources) : null; byte[] binaryCode = (_context.Capabilities.Api == TargetApi.Vulkan || (GraphicsConfig.ShadingLanguage == ShadingLanguage.SPIRV)) ? ShaderBinarySerializer.Pack(shaderSources) : null;
EnqueueForValidation(new ProgramEntry(program, binaryCode, compilation.ProgramIndex, compilation.IsCompute, isBinary: false)); EnqueueForValidation(new ProgramEntry(program, binaryCode, compilation.ProgramIndex, compilation.IsCompute, isBinary: false));
} }

View file

@ -561,7 +561,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
{ {
if (_diskCacheHostStorage.CacheEnabled) if (_diskCacheHostStorage.CacheEnabled)
{ {
byte[] binaryCode = (_context.Capabilities.Api == TargetApi.Vulkan || (GraphicsConfig.EnableOGLSpirV == ShadingLanguage.SPIRV)) ? ShaderBinarySerializer.Pack(sources) : null; byte[] binaryCode = (_context.Capabilities.Api == TargetApi.Vulkan || (GraphicsConfig.ShadingLanguage == ShadingLanguage.SPIRV)) ? ShaderBinarySerializer.Pack(sources) : null;
ProgramToSave programToSave = new(program, hostProgram, binaryCode); ProgramToSave programToSave = new(program, hostProgram, binaryCode);
_programsToSaveQueue.Enqueue(programToSave); _programsToSaveQueue.Enqueue(programToSave);
@ -832,7 +832,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <returns>Translation options</returns> /// <returns>Translation options</returns>
private static TranslationOptions CreateTranslationOptions(TargetApi api, TranslationFlags flags) private static TranslationOptions CreateTranslationOptions(TargetApi api, TranslationFlags flags)
{ {
TargetLanguage lang = (GraphicsConfig.EnableSpirvCompilationOnVulkan && api == TargetApi.Vulkan) || ((GraphicsConfig.EnableOGLSpirV == ShadingLanguage.SPIRV) && _isSpirVCapable) TargetLanguage lang = (GraphicsConfig.EnableSpirvCompilationOnVulkan && api == TargetApi.Vulkan) || ((GraphicsConfig.ShadingLanguage == ShadingLanguage.SPIRV) && _isSpirVCapable)
? TargetLanguage.Spirv ? TargetLanguage.Spirv
: TargetLanguage.Glsl; : TargetLanguage.Glsl;

View file

@ -177,11 +177,6 @@ namespace Ryujinx.Ui.Common.Configuration
/// </summary> /// </summary>
public bool EnableShaderCache { get; set; } public bool EnableShaderCache { get; set; }
/// <summary>
/// Enables or disables Spir-V Shaders on OpenGL
/// </summary>
public bool EnableOGLSpirV { get; set; }
/// <summary> /// <summary>
/// Enables or disables texture recompression /// Enables or disables texture recompression
/// </summary> /// </summary>

View file

@ -477,11 +477,6 @@ namespace Ryujinx.Ui.Common.Configuration
/// </summary> /// </summary>
public ReactiveObject<bool> EnableShaderCache { get; private set; } public ReactiveObject<bool> EnableShaderCache { get; private set; }
/// <summary>
/// Enables or disables Spir-V Shaders on OpenGL
/// </summary>
public ReactiveObject<bool> EnableOGLSpirV { get; private set; }
/// <summary> /// <summary>
/// Enables or disables texture recompression /// Enables or disables texture recompression
/// </summary> /// </summary>
@ -544,8 +539,6 @@ namespace Ryujinx.Ui.Common.Configuration
EnableVsync.Event += static (sender, e) => LogValueChange(e, nameof(EnableVsync)); EnableVsync.Event += static (sender, e) => LogValueChange(e, nameof(EnableVsync));
EnableShaderCache = new ReactiveObject<bool>(); EnableShaderCache = new ReactiveObject<bool>();
EnableShaderCache.Event += static (sender, e) => LogValueChange(e, nameof(EnableShaderCache)); EnableShaderCache.Event += static (sender, e) => LogValueChange(e, nameof(EnableShaderCache));
EnableOGLSpirV = new ReactiveObject<bool>();
EnableOGLSpirV.Event += static (sender, e) => LogValueChange(e, nameof(EnableOGLSpirV));
EnableTextureRecompression = new ReactiveObject<bool>(); EnableTextureRecompression = new ReactiveObject<bool>();
EnableTextureRecompression.Event += static (sender, e) => LogValueChange(e, nameof(EnableTextureRecompression)); EnableTextureRecompression.Event += static (sender, e) => LogValueChange(e, nameof(EnableTextureRecompression));
GraphicsBackend = new ReactiveObject<GraphicsBackend>(); GraphicsBackend = new ReactiveObject<GraphicsBackend>();
@ -695,7 +688,6 @@ namespace Ryujinx.Ui.Common.Configuration
HideCursor = HideCursor, HideCursor = HideCursor,
EnableVsync = Graphics.EnableVsync, EnableVsync = Graphics.EnableVsync,
EnableShaderCache = Graphics.EnableShaderCache, EnableShaderCache = Graphics.EnableShaderCache,
EnableOGLSpirV = Graphics.EnableOGLSpirV,
EnableTextureRecompression = Graphics.EnableTextureRecompression, EnableTextureRecompression = Graphics.EnableTextureRecompression,
EnableMacroHLE = Graphics.EnableMacroHLE, EnableMacroHLE = Graphics.EnableMacroHLE,
EnableColorSpacePassthrough = Graphics.EnableColorSpacePassthrough, EnableColorSpacePassthrough = Graphics.EnableColorSpacePassthrough,
@ -805,7 +797,6 @@ namespace Ryujinx.Ui.Common.Configuration
HideCursor.Value = HideCursorMode.OnIdle; HideCursor.Value = HideCursorMode.OnIdle;
Graphics.EnableVsync.Value = true; Graphics.EnableVsync.Value = true;
Graphics.EnableShaderCache.Value = true; Graphics.EnableShaderCache.Value = true;
Graphics.EnableOGLSpirV.Value = false;
Graphics.EnableTextureRecompression.Value = false; Graphics.EnableTextureRecompression.Value = false;
Graphics.EnableMacroHLE.Value = true; Graphics.EnableMacroHLE.Value = true;
Graphics.EnableColorSpacePassthrough.Value = false; Graphics.EnableColorSpacePassthrough.Value = false;
@ -1491,7 +1482,6 @@ namespace Ryujinx.Ui.Common.Configuration
HideCursor.Value = configurationFileFormat.HideCursor; HideCursor.Value = configurationFileFormat.HideCursor;
Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync; Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache; Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache;
Graphics.EnableOGLSpirV.Value = configurationFileFormat.EnableOGLSpirV;
Graphics.EnableTextureRecompression.Value = configurationFileFormat.EnableTextureRecompression; Graphics.EnableTextureRecompression.Value = configurationFileFormat.EnableTextureRecompression;
Graphics.EnableMacroHLE.Value = configurationFileFormat.EnableMacroHLE; Graphics.EnableMacroHLE.Value = configurationFileFormat.EnableMacroHLE;
Graphics.EnableColorSpacePassthrough.Value = configurationFileFormat.EnableColorSpacePassthrough; Graphics.EnableColorSpacePassthrough.Value = configurationFileFormat.EnableColorSpacePassthrough;

View file

@ -1108,7 +1108,7 @@ namespace Ryujinx.Ui
Graphics.Gpu.GraphicsConfig.MaxAnisotropy = ConfigurationState.Instance.Graphics.MaxAnisotropy; Graphics.Gpu.GraphicsConfig.MaxAnisotropy = ConfigurationState.Instance.Graphics.MaxAnisotropy;
Graphics.Gpu.GraphicsConfig.ShadersDumpPath = ConfigurationState.Instance.Graphics.ShadersDumpPath; Graphics.Gpu.GraphicsConfig.ShadersDumpPath = ConfigurationState.Instance.Graphics.ShadersDumpPath;
Graphics.Gpu.GraphicsConfig.EnableShaderCache = ConfigurationState.Instance.Graphics.EnableShaderCache; Graphics.Gpu.GraphicsConfig.EnableShaderCache = ConfigurationState.Instance.Graphics.EnableShaderCache;
Graphics.Gpu.GraphicsConfig.EnableOGLSpirV = ConfigurationState.Instance.Graphics.ShadingLanguage; Graphics.Gpu.GraphicsConfig.ShadingLanguage = ConfigurationState.Instance.Graphics.ShadingLanguage;
Graphics.Gpu.GraphicsConfig.EnableTextureRecompression = ConfigurationState.Instance.Graphics.EnableTextureRecompression; Graphics.Gpu.GraphicsConfig.EnableTextureRecompression = ConfigurationState.Instance.Graphics.EnableTextureRecompression;
Graphics.Gpu.GraphicsConfig.EnableMacroHLE = ConfigurationState.Instance.Graphics.EnableMacroHLE; Graphics.Gpu.GraphicsConfig.EnableMacroHLE = ConfigurationState.Instance.Graphics.EnableMacroHLE;
} }

View file

@ -58,7 +58,6 @@ namespace Ryujinx.Ui.Windows
[GUI] RadioButton _hideCursorAlways; [GUI] RadioButton _hideCursorAlways;
[GUI] CheckButton _vSyncToggle; [GUI] CheckButton _vSyncToggle;
[GUI] CheckButton _shaderCacheToggle; [GUI] CheckButton _shaderCacheToggle;
[GUI] CheckButton _enableOGLSpirV;
[GUI] CheckButton _textureRecompressionToggle; [GUI] CheckButton _textureRecompressionToggle;
[GUI] CheckButton _macroHLEToggle; [GUI] CheckButton _macroHLEToggle;
[GUI] CheckButton _ptcToggle; [GUI] CheckButton _ptcToggle;
@ -255,11 +254,6 @@ namespace Ryujinx.Ui.Windows
_shaderCacheToggle.Click(); _shaderCacheToggle.Click();
} }
if (ConfigurationState.Instance.Graphics.EnableOGLSpirV)
{
_enableOGLSpirV.Click();
}
if (ConfigurationState.Instance.Graphics.EnableTextureRecompression) if (ConfigurationState.Instance.Graphics.EnableTextureRecompression)
{ {
_textureRecompressionToggle.Click(); _textureRecompressionToggle.Click();
@ -638,7 +632,6 @@ namespace Ryujinx.Ui.Windows
ConfigurationState.Instance.HideCursor.Value = hideCursor; ConfigurationState.Instance.HideCursor.Value = hideCursor;
ConfigurationState.Instance.Graphics.EnableVsync.Value = _vSyncToggle.Active; ConfigurationState.Instance.Graphics.EnableVsync.Value = _vSyncToggle.Active;
ConfigurationState.Instance.Graphics.EnableShaderCache.Value = _shaderCacheToggle.Active; ConfigurationState.Instance.Graphics.EnableShaderCache.Value = _shaderCacheToggle.Active;
ConfigurationState.Instance.Graphics.EnableOGLSpirV.Value = _enableOGLSpirV.Active;
ConfigurationState.Instance.Graphics.EnableTextureRecompression.Value = _textureRecompressionToggle.Active; ConfigurationState.Instance.Graphics.EnableTextureRecompression.Value = _textureRecompressionToggle.Active;
ConfigurationState.Instance.Graphics.EnableMacroHLE.Value = _macroHLEToggle.Active; ConfigurationState.Instance.Graphics.EnableMacroHLE.Value = _macroHLEToggle.Active;
ConfigurationState.Instance.System.EnablePtc.Value = _ptcToggle.Active; ConfigurationState.Instance.System.EnablePtc.Value = _ptcToggle.Active;