Make PPTC state non-static (#4157)
* Make PPTC state non-static * DiskCacheLoadState can be null
This commit is contained in:
parent
08831eecf7
commit
fc4b7cba2c
21 changed files with 434 additions and 230 deletions
|
@ -1,4 +1,3 @@
|
|||
using ARMeilleure.Translation.PTC;
|
||||
using Gtk;
|
||||
using Ryujinx.Common;
|
||||
using Ryujinx.Common.Configuration;
|
||||
|
@ -308,9 +307,6 @@ namespace Ryujinx
|
|||
|
||||
private static void ProcessUnhandledException(Exception ex, bool isTerminating)
|
||||
{
|
||||
Ptc.Close();
|
||||
PtcProfiler.Stop();
|
||||
|
||||
string message = $"Unhandled exception caught: {ex}";
|
||||
|
||||
Logger.Error?.PrintMsg(LogClass.Application, message);
|
||||
|
@ -330,9 +326,6 @@ namespace Ryujinx
|
|||
{
|
||||
DiscordIntegrationModule.Exit();
|
||||
|
||||
Ptc.Dispose();
|
||||
PtcProfiler.Dispose();
|
||||
|
||||
Logger.Shutdown();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using ARMeilleure.Translation;
|
||||
using ARMeilleure.Translation.PTC;
|
||||
using Gtk;
|
||||
using LibHac.Common;
|
||||
using LibHac.Common.Keys;
|
||||
|
@ -16,6 +15,7 @@ using Ryujinx.Common;
|
|||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Common.SystemInterop;
|
||||
using Ryujinx.Cpu;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using Ryujinx.Graphics.GAL.Multithreading;
|
||||
using Ryujinx.Graphics.OpenGL;
|
||||
|
@ -46,7 +46,6 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
|
||||
using GUI = Gtk.Builder.ObjectAttribute;
|
||||
using PtcLoadingState = ARMeilleure.Translation.PTC.PtcLoadingState;
|
||||
using ShaderCacheLoadingState = Ryujinx.Graphics.Gpu.Shader.ShaderCacheState;
|
||||
|
||||
namespace Ryujinx.Ui
|
||||
|
@ -588,8 +587,11 @@ namespace Ryujinx.Ui
|
|||
|
||||
private void SetupProgressUiHandlers()
|
||||
{
|
||||
Ptc.PtcStateChanged -= ProgressHandler;
|
||||
Ptc.PtcStateChanged += ProgressHandler;
|
||||
if (_emulationContext.Application.DiskCacheLoadState != null)
|
||||
{
|
||||
_emulationContext.Application.DiskCacheLoadState.StateChanged -= ProgressHandler;
|
||||
_emulationContext.Application.DiskCacheLoadState.StateChanged += ProgressHandler;
|
||||
}
|
||||
|
||||
_emulationContext.Gpu.ShaderCacheStateChanged -= ProgressHandler;
|
||||
_emulationContext.Gpu.ShaderCacheStateChanged += ProgressHandler;
|
||||
|
@ -602,8 +604,8 @@ namespace Ryujinx.Ui
|
|||
|
||||
switch (state)
|
||||
{
|
||||
case PtcLoadingState ptcState:
|
||||
visible = ptcState != PtcLoadingState.Loaded;
|
||||
case LoadState ptcState:
|
||||
visible = ptcState != LoadState.Loaded;
|
||||
label = $"PTC : {current}/{total}";
|
||||
break;
|
||||
case ShaderCacheLoadingState shaderCacheState:
|
||||
|
@ -705,8 +707,6 @@ namespace Ryujinx.Ui
|
|||
|
||||
UpdateGraphicsConfig();
|
||||
|
||||
SetupProgressUiHandlers();
|
||||
|
||||
SystemVersion firmwareVersion = _contentManager.GetCurrentFirmwareVersion();
|
||||
|
||||
bool isDirectory = Directory.Exists(path);
|
||||
|
@ -841,6 +841,8 @@ namespace Ryujinx.Ui
|
|||
return;
|
||||
}
|
||||
|
||||
SetupProgressUiHandlers();
|
||||
|
||||
_currentEmulatedGamePath = path;
|
||||
|
||||
_deviceExitStatus.Reset();
|
||||
|
@ -967,9 +969,6 @@ namespace Ryujinx.Ui
|
|||
|
||||
RendererWidget.Start();
|
||||
|
||||
Ptc.Close();
|
||||
PtcProfiler.Stop();
|
||||
|
||||
_emulationContext.Dispose();
|
||||
_deviceExitStatus.Set();
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using ARMeilleure.Translation;
|
||||
using ARMeilleure.Translation.PTC;
|
||||
using Gdk;
|
||||
using Gtk;
|
||||
using Ryujinx.Common;
|
||||
|
@ -519,7 +518,7 @@ namespace Ryujinx.Ui
|
|||
_gpuCancellationTokenSource.Cancel();
|
||||
|
||||
_isStopped = true;
|
||||
|
||||
|
||||
if (_isActive)
|
||||
{
|
||||
_isActive = false;
|
||||
|
@ -585,7 +584,7 @@ namespace Ryujinx.Ui
|
|||
{
|
||||
if (!ParentWindow.State.HasFlag(WindowState.Fullscreen))
|
||||
{
|
||||
Ptc.Continue();
|
||||
Device.Application.DiskCacheLoadState?.Cancel();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue