From f2cdceb8461f032b77fa3516264cd9b3b1e7d627 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Tue, 30 Mar 2021 00:10:43 +0100 Subject: [PATCH] Force command flush after creating a syncpoint (#2056) * Force command flush after creating GL sync * This is not required, as the commands were flushed on creation. * Move comment. --- Ryujinx.Graphics.OpenGL/Sync.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Ryujinx.Graphics.OpenGL/Sync.cs b/Ryujinx.Graphics.OpenGL/Sync.cs index 97a71fc4..18ab07e2 100644 --- a/Ryujinx.Graphics.OpenGL/Sync.cs +++ b/Ryujinx.Graphics.OpenGL/Sync.cs @@ -26,6 +26,9 @@ namespace Ryujinx.Graphics.OpenGL Handle = GL.FenceSync(SyncCondition.SyncGpuCommandsComplete, WaitSyncFlags.None) }; + // Force commands to flush up to the syncpoint. + GL.ClientWaitSync(handle.Handle, ClientWaitSyncFlags.SyncFlushCommandsBit, 0); + lock (Handles) { Handles.Add(handle); @@ -62,7 +65,7 @@ namespace Ryujinx.Graphics.OpenGL return; } - WaitSyncStatus syncResult = GL.ClientWaitSync(result.Handle, ClientWaitSyncFlags.SyncFlushCommandsBit, 1000000000); + WaitSyncStatus syncResult = GL.ClientWaitSync(result.Handle, ClientWaitSyncFlags.None, 1000000000); if (syncResult == WaitSyncStatus.TimeoutExpired) { @@ -86,7 +89,7 @@ namespace Ryujinx.Graphics.OpenGL if (first == null) break; - WaitSyncStatus syncResult = GL.ClientWaitSync(first.Handle, ClientWaitSyncFlags.SyncFlushCommandsBit, 0); + WaitSyncStatus syncResult = GL.ClientWaitSync(first.Handle, ClientWaitSyncFlags.None, 0); if (syncResult == WaitSyncStatus.AlreadySignaled) {