Fix deadlocks

This commit is contained in:
ReinUsesLisp 2018-07-10 03:34:11 -03:00
parent 59a5fb397f
commit 9415b2862f
3 changed files with 6 additions and 10 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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();