diff options
author | riperiperi <rhy3756547@hotmail.com> | 2022-12-01 15:30:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-01 16:30:13 +0100 |
commit | 458452279cee03bfe1bbf2c3daf3fc9722b03a74 (patch) | |
tree | d62389dca124f75f2245d03d288ff54b87b7269e /Ryujinx.Graphics.OpenGL/Sync.cs | |
parent | 817b89767aa31b3b2847203b27151044f5d323f6 (diff) |
GPU: Track buffer migrations and flush source on incomplete copy (#3952)1.1.405
* Track buffer migrations and flush source on incomplete copy
Makes sure that the modified range list is always from the latest iteration of the buffer, and flushes earlier iterations of a buffer if the data has not been migrated yet.
* Cleanup 1
* Reduce cost for redundant signal checks on Vulkan
* Only inherit the range list if there are pending ranges.
* Fix OpenGL
* Address Feedback
* Whoops
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Sync.cs')
-rw-r--r-- | Ryujinx.Graphics.OpenGL/Sync.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Sync.cs b/Ryujinx.Graphics.OpenGL/Sync.cs index de94fd31..58818e6a 100644 --- a/Ryujinx.Graphics.OpenGL/Sync.cs +++ b/Ryujinx.Graphics.OpenGL/Sync.cs @@ -40,6 +40,37 @@ namespace Ryujinx.Graphics.OpenGL } } + public ulong GetCurrent() + { + lock (_handles) + { + ulong lastHandle = _firstHandle; + + foreach (SyncHandle handle in _handles) + { + lock (handle) + { + if (handle.Handle == IntPtr.Zero) + { + continue; + } + + if (handle.ID > lastHandle) + { + WaitSyncStatus syncResult = GL.ClientWaitSync(handle.Handle, _syncFlags, 0); + + if (syncResult == WaitSyncStatus.AlreadySignaled) + { + lastHandle = handle.ID; + } + } + } + } + + return lastHandle; + } + } + public void Wait(ulong id) { SyncHandle result = null; |