diff --git a/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs b/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs index 7323abfe..027495cd 100644 --- a/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs +++ b/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs @@ -56,6 +56,11 @@ namespace Ryujinx.Graphics.OpenGL.Queries GL.GetQueryObject(Query, GetQueryObjectParam.QueryResult, (long*)0); GL.MemoryBarrier(MemoryBarrierFlags.QueryBufferBarrierBit | MemoryBarrierFlags.ClientMappedBufferBarrierBit); } + else + { + // Dummy result, just return 0. + Marshal.WriteInt64(_bufferMap, 0L); + } } public bool TryGetResult(out long result) diff --git a/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs b/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs index f4ab02fb..84b2bfdc 100644 --- a/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs +++ b/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs @@ -119,19 +119,10 @@ namespace Ryujinx.Graphics.OpenGL.Queries _current.ReserveForHostAccess(); } - if (draws > 0) - { - _current.Complete(true); - _events.Enqueue(_current); + _current.Complete(draws > 0); + _events.Enqueue(_current); - _current.OnResult += resultHandler; - } - else - { - _current.Complete(false); - _current.Dispose(); - resultHandler(_current, 0); - } + _current.OnResult += resultHandler; result = _current;