From 4c082ab93183d7da4ef0c6f621502a8e635ea3a4 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 27 Aug 2020 15:36:54 +0200 Subject: [PATCH] Minor optimization for SetEventOnCompletion --- src/ComputeSharp.Graphics/GraphicsDevice.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ComputeSharp.Graphics/GraphicsDevice.cs b/src/ComputeSharp.Graphics/GraphicsDevice.cs index de7b488b..941fb3f5 100644 --- a/src/ComputeSharp.Graphics/GraphicsDevice.cs +++ b/src/ComputeSharp.Graphics/GraphicsDevice.cs @@ -164,11 +164,7 @@ namespace ComputeSharp.Graphics if (fenceValue <= fence.CompletedValue) return; - using ManualResetEvent fenceEvent = new ManualResetEvent(false); - - fence.SetEventOnCompletion(fenceValue, fenceEvent); - - fenceEvent.WaitOne(); + fence.SetEventOnCompletion(fenceValue, default(IntPtr)); } ///