From a3cf97f2fafd31c69bf16cdbb5f5fa19ccac5324 Mon Sep 17 00:00:00 2001 From: rdbtCVS <87152661+rdbtCVS@users.noreply.github.com> Date: Sat, 17 Oct 2026 23:50:46 +0100 Subject: [PATCH] Build the core renderer before starting audio --- crates/horizon-client/src/game.rs | 12 ++++++------ crates/horizon-client/src/telemetry.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 8fd378187..33b371824 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -11277,12 +11277,6 @@ impl Loading { let mut options = self.options.take().ok_or("loading already finished")?; options.resources = loaded.root.clone(); let gui = self.gui.take().ok_or("missing menu bundle")?; - // Audio is created on the main thread, after the core is ready. - let audio = if options.dedicated.is_some() { - Audio::silent(&options.resources) - } else { - Audio::new(&options.resources) - }; let window = self.window.clone().ok_or("window closed")?; // Keep the loader's device and swap in the real textures in one step. if let Some(renderer) = &mut self.renderer { @@ -11299,6 +11293,12 @@ impl Loading { "Horizon: world renderer ready after {} ms", self.started.elapsed().as_millis() ); + // Audio is created on the main thread, after the core is ready. + let audio = if options.dedicated.is_some() { + Audio::silent(&options.resources) + } else { + Audio::new(&options.resources) + }; let pack_error = loaded.pack_error.or_else(|| self.pack_error.take()); // The game borrows its shared resources for the process's lifetime, // like the single copy an integrated server would share. diff --git a/crates/horizon-client/src/telemetry.rs b/crates/horizon-client/src/telemetry.rs index 85f54df72..c63d82915 100644 --- a/crates/horizon-client/src/telemetry.rs +++ b/crates/horizon-client/src/telemetry.rs @@ -21,9 +21,9 @@ const CRASH_DETAILS: [&str; 3] = ["Horizon Version", "Graphics Adapter", "Render static STARTED: OnceLock = OnceLock::new(); /// When the menu bundle became ready, so the time to the title screen measures /// the menu and not the world bundle loaded behind it. +static UI_READY_MS: AtomicU32 = AtomicU32::new(u32::MAX); static CORE_READY_MS: AtomicU32 = AtomicU32::new(u32::MAX); static REST_READY_MS: AtomicU32 = AtomicU32::new(u32::MAX); -static UI_READY_MS: AtomicU32 = AtomicU32::new(u32::MAX); /// The GPU's name, driver and backend, once the renderer has its adapter. static GPU: Mutex> = Mutex::new(None);