diff --git a/Ryujinx.HLE/Gpu/Engines/NvGpuFifo.cs b/Ryujinx.HLE/Gpu/Engines/NvGpuFifo.cs index 7ced9e9ecc..7b999eaed1 100644 --- a/Ryujinx.HLE/Gpu/Engines/NvGpuFifo.cs +++ b/Ryujinx.HLE/Gpu/Engines/NvGpuFifo.cs @@ -19,7 +19,7 @@ namespace Ryujinx.HLE.Gpu.Engines private NvGpuEngine[] SubChannels; - public ManualResetEvent Event { get; private set; } + public AutoResetEvent Event { get; private set; } private struct CachedMacro { @@ -64,7 +64,7 @@ namespace Ryujinx.HLE.Gpu.Engines Mme = new int[MmeWords]; - Event = new ManualResetEvent(false); + Event = new AutoResetEvent(false); } public void PushBuffer(NvGpuVmm Vmm, NvGpuPBEntry[] Buffer) diff --git a/Ryujinx.HLE/Switch.cs b/Ryujinx.HLE/Switch.cs index 43e94d533a..1946b187ba 100644 --- a/Ryujinx.HLE/Switch.cs +++ b/Ryujinx.HLE/Switch.cs @@ -73,14 +73,12 @@ namespace Ryujinx.HLE public bool WaitFifo() { - return Gpu.Fifo.Event.WaitOne(1); + return Gpu.Fifo.Event.WaitOne(8); } public void ProcessFrame() { Gpu.Fifo.DispatchCalls(); - - Gpu.Fifo.Event.Reset(); } internal virtual void OnFinish(EventArgs e) diff --git a/Ryujinx/Ui/GLScreen.cs b/Ryujinx/Ui/GLScreen.cs index 0e36f01646..c195d5acaf 100644 --- a/Ryujinx/Ui/GLScreen.cs +++ b/Ryujinx/Ui/GLScreen.cs @@ -59,15 +59,13 @@ namespace Ryujinx while (!IsExiting) { - //Sleeping until Fifo event improves performance, but it deadlocks most games - //should not be uncommented until it's found why it happens - //if (Ns.WaitFifo()) + if (Ns.WaitFifo()) { Ns.ProcessFrame(); - - Renderer.RunActions(); } + Renderer.RunActions(); + Ticks += Chrono.ElapsedTicks; Chrono.Restart();