Skip to content

Commit

Permalink
Merge pull request #5898 from frenzibyte/fix-frame-graphs-on-ios
Browse files Browse the repository at this point in the history
Fix frame statistics display showing `CADisplayLink` callback delays under "WndProc" time
  • Loading branch information
peppy authored Jul 6, 2023
2 parents 5882d25 + c064c02 commit 824cfae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions osu.Framework/Platform/GameHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/// <summary>
Expand Down Expand Up @@ -1142,7 +1146,7 @@ private void bootstrapSceneGraph(Game game)
Root = root;
}

private InvokeOnDisposal inputPerformanceCollectionPeriod;
private InvokeOnDisposal outsideRunLoopCollectionPeriod;

private Bindable<bool> bypassFrontToBackPass;

Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/osu.Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<PackageReference Include="ppy.ManagedBass" Version="2022.1216.0" />
<PackageReference Include="ppy.ManagedBass.Fx" Version="2022.1216.0" />
<PackageReference Include="ppy.ManagedBass.Mix" Version="2022.1216.0" />
<PackageReference Include="ppy.Veldrid" Version="4.9.3-gc93d085d10" />
<PackageReference Include="ppy.Veldrid" Version="4.9.3-gf4e09bb395" />
<PackageReference Include="ppy.Veldrid.SPIRV" Version="1.0.15-g3e4b9f196a" />
<PackageReference Include="SharpFNT" Version="2.0.0" />
<!-- Preview version of ImageSharp causes NU5104. -->
Expand Down

0 comments on commit 824cfae

Please sign in to comment.