From 1fa061ba81a59ac57c712fe8abaa9a17bb362dff Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Thu, 6 Jul 2023 04:19:50 +0300 Subject: [PATCH 1/2] Fix frame statistics display showing `CADisplayLink` callback delays under "WndProc" time --- osu.Framework/Platform/GameHost.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/osu.Framework/Platform/GameHost.cs b/osu.Framework/Platform/GameHost.cs index 9a8f7cc608..0a0b7ad4a5 100644 --- a/osu.Framework/Platform/GameHost.cs +++ b/osu.Framework/Platform/GameHost.cs @@ -1060,15 +1060,19 @@ public void Resume() private void windowUpdate() { - inputPerformanceCollectionPeriod?.Dispose(); - inputPerformanceCollectionPeriod = null; + outsideRunLoopCollectionPeriod?.Dispose(); + outsideRunLoopCollectionPeriod = null; if (suspended) return; threadRunner.RunMainLoop(); - inputPerformanceCollectionPeriod = inputMonitor.BeginCollecting(PerformanceCollectionType.WndProc); + outsideRunLoopCollectionPeriod = RuntimeInfo.OS == RuntimeInfo.Platform.iOS + // in iOS, the game loop is wrapped around CADisplayLink which waits for the next V-Sync point before processing next frame, + // therefore we should mark this as "sleep" time in draw thread instead. + ? drawMonitor.BeginCollecting(PerformanceCollectionType.Sleep) + : inputMonitor.BeginCollecting(PerformanceCollectionType.WndProc); } /// @@ -1142,7 +1146,7 @@ private void bootstrapSceneGraph(Game game) Root = root; } - private InvokeOnDisposal inputPerformanceCollectionPeriod; + private InvokeOnDisposal outsideRunLoopCollectionPeriod; private Bindable bypassFrontToBackPass; From c064c0212c6bc2e16fb0a1c33270b4c3067a1e7c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 6 Jul 2023 12:02:44 +0900 Subject: [PATCH 2/2] Update veldrid --- osu.Framework/osu.Framework.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Framework/osu.Framework.csproj b/osu.Framework/osu.Framework.csproj index a7c4ee0f77..af1fe63ae4 100644 --- a/osu.Framework/osu.Framework.csproj +++ b/osu.Framework/osu.Framework.csproj @@ -27,7 +27,7 @@ - +