Skip to content

Commit 854648d

Browse files
Force MultiThreaded execution mode and remove SingleThread UI option
SingleThread is incompatible with the Android Vulkan surface-readiness path (VeldridDevice polls SurfaceHandle for up to 5s on the same thread that publishes it in SingleThread mode -> deadlock -> null Vulkan func ptr -> SDLThread SI_TKILL crash within ~5s of launch, which matches the tablet crash report). The same pattern would also bite iOS Metal drawable attach. On desktop SingleThread is just slower with no UX benefit. Upstream ppy/osu defaults to MultiThreaded; we now enforce it on every startup so a stale framework.ini cannot pin a user into the broken mode. - OsuGameBase.load: force ExecutionMode = MultiThreaded once on load. - RendererSettings: drop the Threading Mode dropdown. - GraphicsSettingsStrings: drop the now-unused ThreadingMode string. - TestSceneOsuGame: drop TestSwitchThreadExecutionMode (covered behaviour is no longer user-reachable) and prune the now-unused usings. Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/cccaf70f-1049-4fde-a21c-cd61a27bf8b2 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent 50fd801 commit 854648d

4 files changed

Lines changed: 15 additions & 19 deletions

File tree

osu.Game.Tests/Visual/Navigation/TestSceneOsuGame.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
using NUnit.Framework;
99
using osu.Framework.Allocation;
1010
using osu.Framework.Bindables;
11-
using osu.Framework.Configuration;
1211
using osu.Framework.Graphics.Textures;
13-
using osu.Framework.Platform;
1412
using osu.Game.Audio;
1513
using osu.Game.Beatmaps;
1614
using osu.Game.Configuration;
@@ -104,13 +102,6 @@ public void TestNullRulesetHandled()
104102
AddAssert("ruleset unchanged", () => ReferenceEquals(Ruleset.Value, ruleset));
105103
}
106104

107-
[Test]
108-
public void TestSwitchThreadExecutionMode()
109-
{
110-
AddStep("Change thread mode to multi threaded", () => { Game.Dependencies.Get<FrameworkConfigManager>().SetValue(FrameworkSetting.ExecutionMode, ExecutionMode.MultiThreaded); });
111-
AddStep("Change thread mode to single thread", () => { Game.Dependencies.Get<FrameworkConfigManager>().SetValue(FrameworkSetting.ExecutionMode, ExecutionMode.SingleThread); });
112-
}
113-
114105
[Test]
115106
public void TestUnavailableRulesetHandled()
116107
{

osu.Game/Localisation/GraphicsSettingsStrings.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ public static class GraphicsSettingsStrings
2929
/// </summary>
3030
public static LocalisableString FrameLimiter => new TranslatableString(getKey(@"frame_limiter"), @"Frame limiter");
3131

32-
/// <summary>
33-
/// "Threading mode"
34-
/// </summary>
35-
public static LocalisableString ThreadingMode => new TranslatableString(getKey(@"threading_mode"), @"Threading mode");
36-
3732
/// <summary>
3833
/// "Show FPS"
3934
/// </summary>

osu.Game/OsuGameBase.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,21 @@ private void load(ReadableKeyCombinationProvider keyCombinationProvider, Framewo
329329

330330
MessageFormatter.WebsiteRootUrl = endpoints.WebsiteUrl;
331331

332+
// Force the framework execution mode to MultiThreaded on every startup.
333+
//
334+
// SingleThread used to be exposed in the graphics settings, but it is incompatible
335+
// with our Android Vulkan-surface readiness path: VeldridDevice / AndroidGameHost
336+
// poll AndroidGameWindow.SurfaceHandle for up to 5s, and in SingleThread mode that
337+
// poll runs on the same thread that publishes the surface handle, deadlocking
338+
// initialisation until the timeout fires and Vulkan device creation crashes with a
339+
// null function pointer (see PR history around the SDLThread/SI_TKILL crash).
340+
//
341+
// The same risk applies to iOS Metal layer attach (drawable surfaces are also
342+
// delivered via the main loop), and on desktop SingleThread is strictly slower with
343+
// no UX benefit. Upstream ppy/osu defaults to MultiThreaded; we now enforce it
344+
// unconditionally so a stale `framework.ini` cannot pin a user into the broken mode.
345+
frameworkConfig.SetValue(FrameworkSetting.ExecutionMode, ExecutionMode.MultiThreaded);
346+
332347
// Initialise localisation
333348
frameworkLocale = frameworkConfig.GetBindable<string>(FrameworkSetting.Locale);
334349
frameworkLocale.BindValueChanged(_ => updateLanguage());

osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ private void load(FrameworkConfigManager config, OsuConfigManager osuConfig, IDi
8383
Keywords = new[] { @"fps", @"framerate" },
8484
},
8585
customDrawLimitItem,
86-
new SettingsItemV2(new FormEnumDropdown<ExecutionMode>
87-
{
88-
Caption = GraphicsSettingsStrings.ThreadingMode,
89-
Current = config.GetBindable<ExecutionMode>(FrameworkSetting.ExecutionMode)
90-
}),
9186
new SettingsItemV2(new FormCheckBox
9287
{
9388
Caption = GraphicsSettingsStrings.ShowFPS,

0 commit comments

Comments
 (0)