From 48f6570557fc76496936514d94e3ccddf55ec633 Mon Sep 17 00:00:00 2001 From: Mary Date: Fri, 13 Nov 2020 00:15:34 +0100 Subject: 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. --- Ryujinx.Common/Configuration/ConfigurationState.cs | 28 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'Ryujinx.Common/Configuration/ConfigurationState.cs') 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 /// public ReactiveObject EnableVsync { get; private set; } + /// + /// Enables or disables Shader cache + /// + public ReactiveObject EnableShaderCache { get; private set; } + public GraphicsSection() { - ResScale = new ReactiveObject(); - ResScaleCustom = new ReactiveObject(); - MaxAnisotropy = new ReactiveObject(); - ShadersDumpPath = new ReactiveObject(); - EnableVsync = new ReactiveObject(); + ResScale = new ReactiveObject(); + ResScaleCustom = new ReactiveObject(); + MaxAnisotropy = new ReactiveObject(); + ShadersDumpPath = new ReactiveObject(); + EnableVsync = new ReactiveObject(); + EnableShaderCache = new ReactiveObject(); } } @@ -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 = new List(); 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; -- cgit v1.2.3