From fb935fd201a347de07762d14f81a985c8cdeb360 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Sat, 19 Feb 2022 14:29:11 +0000 Subject: [PATCH] Add dedicated ServerBase for FileSystem services (#3142) This should prevent filesystem services from blocking other services that don't have their own ServerBase. May improve filesystem related stutters in certain titles. Improves button advanced cutscenes such as Miqol's Request in Xenoblade: DE when the game is on a network share (used to stutter when voice lines played). Should probably be tested to make sure no mysterious bugs have been unearthed, and to see if any other filesystem related perf issues are improved. --- Ryujinx.HLE/HOS/Horizon.cs | 2 ++ Ryujinx.HLE/HOS/Services/DisposableIpcService.cs | 2 ++ Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Ryujinx.HLE/HOS/Horizon.cs b/Ryujinx.HLE/HOS/Horizon.cs index 59e2ca1c..56c99859 100644 --- a/Ryujinx.HLE/HOS/Horizon.cs +++ b/Ryujinx.HLE/HOS/Horizon.cs @@ -76,6 +76,7 @@ namespace Ryujinx.HLE.HOS internal ServerBase BsdServer { get; private set; } internal ServerBase AudRenServer { get; private set; } internal ServerBase AudOutServer { get; private set; } + internal ServerBase FsServer { get; private set; } internal ServerBase HidServer { get; private set; } internal ServerBase NvDrvServer { get; private set; } internal ServerBase TimeServer { get; private set; } @@ -298,6 +299,7 @@ namespace Ryujinx.HLE.HOS BsdServer = new ServerBase(KernelContext, "BsdServer"); AudRenServer = new ServerBase(KernelContext, "AudioRendererServer"); AudOutServer = new ServerBase(KernelContext, "AudioOutServer"); + FsServer = new ServerBase(KernelContext, "FsServer"); HidServer = new ServerBase(KernelContext, "HidServer"); NvDrvServer = new ServerBase(KernelContext, "NvservicesServer"); TimeServer = new ServerBase(KernelContext, "TimeServer"); diff --git a/Ryujinx.HLE/HOS/Services/DisposableIpcService.cs b/Ryujinx.HLE/HOS/Services/DisposableIpcService.cs index 7aecdfd1..2d0802a7 100644 --- a/Ryujinx.HLE/HOS/Services/DisposableIpcService.cs +++ b/Ryujinx.HLE/HOS/Services/DisposableIpcService.cs @@ -7,6 +7,8 @@ namespace Ryujinx.HLE.HOS.Services { private int _disposeState; + public DisposableIpcService(ServerBase server = null) : base(server) { } + protected abstract void Dispose(bool isDisposing); public void Dispose() diff --git a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs index fc60ce3a..94578303 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs @@ -28,7 +28,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs { private SharedRef _baseFileSystemProxy; - public IFileSystemProxy(ServiceCtx context) + public IFileSystemProxy(ServiceCtx context) : base(context.Device.System.FsServer) { var applicationClient = context.Device.System.LibHacHorizonManager.ApplicationClient; _baseFileSystemProxy = applicationClient.Fs.Impl.GetFileSystemProxyServiceObject();