diff options
author | Mary <me@thog.eu> | 2020-11-13 00:15:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-13 00:15:34 +0100 |
commit | 48f6570557fc76496936514d94e3ccddf55ec633 (patch) | |
tree | ce455833899cb33a312e5853a7a3d191bb5d18d9 /Ryujinx.Common/Configuration/ConfigurationState.cs | |
parent | 7166e82c3cf1fd8cf2fce3281017ee88122684d8 (diff) |
Salieri: shader cache (#1701)
Here come Salieri, my implementation of a disk shader cache!
"I'm sure you know why I named it that."
"It doesn't really mean anything."
This implementation collects shaders at runtime and cache them to be later compiled when starting a game.
Diffstat (limited to 'Ryujinx.Common/Configuration/ConfigurationState.cs')
-rw-r--r-- | Ryujinx.Common/Configuration/ConfigurationState.cs | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/Ryujinx.Common/Configuration/ConfigurationState.cs b/Ryujinx.Common/Configuration/ConfigurationState.cs index d83d07d3..915cb77e 100644 --- a/Ryujinx.Common/Configuration/ConfigurationState.cs +++ b/Ryujinx.Common/Configuration/ConfigurationState.cs @@ -298,13 +298,19 @@ namespace Ryujinx.Configuration /// </summary> public ReactiveObject<bool> EnableVsync { get; private set; } + /// <summary> + /// Enables or disables Shader cache + /// </summary> + public ReactiveObject<bool> EnableShaderCache { get; private set; } + public GraphicsSection() { - ResScale = new ReactiveObject<int>(); - ResScaleCustom = new ReactiveObject<float>(); - MaxAnisotropy = new ReactiveObject<float>(); - ShadersDumpPath = new ReactiveObject<string>(); - EnableVsync = new ReactiveObject<bool>(); + ResScale = new ReactiveObject<int>(); + ResScaleCustom = new ReactiveObject<float>(); + MaxAnisotropy = new ReactiveObject<float>(); + ShadersDumpPath = new ReactiveObject<string>(); + EnableVsync = new ReactiveObject<bool>(); + EnableShaderCache = new ReactiveObject<bool>(); } } @@ -401,6 +407,7 @@ namespace Ryujinx.Configuration EnableDiscordIntegration = EnableDiscordIntegration, CheckUpdatesOnStart = CheckUpdatesOnStart, EnableVsync = Graphics.EnableVsync, + EnableShaderCache = Graphics.EnableShaderCache, EnableMulticoreScheduling = System.EnableMulticoreScheduling, EnablePtc = System.EnablePtc, EnableFsIntegrityChecks = System.EnableFsIntegrityChecks, @@ -461,6 +468,7 @@ namespace Ryujinx.Configuration EnableDiscordIntegration.Value = true; CheckUpdatesOnStart.Value = true; Graphics.EnableVsync.Value = true; + Graphics.EnableShaderCache.Value = true; System.EnableMulticoreScheduling.Value = true; System.EnablePtc.Value = false; System.EnableFsIntegrityChecks.Value = true; @@ -727,6 +735,15 @@ namespace Ryujinx.Configuration configurationFileUpdated = true; } + if (configurationFileFormat.Version < 16) + { + Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 16."); + + configurationFileFormat.EnableShaderCache = true; + + configurationFileUpdated = true; + } + List<InputConfig> inputConfig = new List<InputConfig>(); inputConfig.AddRange(configurationFileFormat.ControllerConfig); inputConfig.AddRange(configurationFileFormat.KeyboardConfig); @@ -753,6 +770,7 @@ namespace Ryujinx.Configuration EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration; CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart; Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync; + Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache; System.EnableMulticoreScheduling.Value = configurationFileFormat.EnableMulticoreScheduling; System.EnablePtc.Value = configurationFileFormat.EnablePtc; System.EnableFsIntegrityChecks.Value = configurationFileFormat.EnableFsIntegrityChecks; |