aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Vulkan/SyncManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.Vulkan/SyncManager.cs')
-rw-r--r--src/Ryujinx.Graphics.Vulkan/SyncManager.cs31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/SyncManager.cs b/src/Ryujinx.Graphics.Vulkan/SyncManager.cs
index 432d224f..b3f6e8e5 100644
--- a/src/Ryujinx.Graphics.Vulkan/SyncManager.cs
+++ b/src/Ryujinx.Graphics.Vulkan/SyncManager.cs
@@ -125,24 +125,29 @@ namespace Ryujinx.Graphics.Vulkan
if (result != null)
{
- lock (result)
+ if (result.Waitable == null)
{
- if (result.Waitable == null)
- {
- return;
- }
+ return;
+ }
- long beforeTicks = Stopwatch.GetTimestamp();
+ long beforeTicks = Stopwatch.GetTimestamp();
- if (result.NeedsFlush(FlushId))
+ if (result.NeedsFlush(FlushId))
+ {
+ _gd.InterruptAction(() =>
{
- _gd.InterruptAction(() =>
+ if (result.NeedsFlush(FlushId))
{
- if (result.NeedsFlush(FlushId))
- {
- _gd.FlushAllCommands();
- }
- });
+ _gd.FlushAllCommands();
+ }
+ });
+ }
+
+ lock (result)
+ {
+ if (result.Waitable == null)
+ {
+ return;
}
bool signaled = result.Signalled || result.Waitable.WaitForFences(_gd.Api, _device, 1000000000);