From b3840adccdaf48f9c04f9e67f5b4decf74fd2545 Mon Sep 17 00:00:00 2001 From: rdbtCVS <87152661+rdbtCVS@users.noreply.github.com> Date: Sun, 25 Oct 2026 18:08:03 +0000 Subject: [PATCH] Fix renderer backend fallback after surface creation failure Keep surface creation errors in the backend failure list so Windows Auto can try DirectX 12 after Vulkan fails. Co-Authored-By: OpenAI Codex --- crates/horizon-client/src/gfx.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/horizon-client/src/gfx.rs b/crates/horizon-client/src/gfx.rs index 31853ad92..2c54a0e53 100644 --- a/crates/horizon-client/src/gfx.rs +++ b/crates/horizon-client/src/gfx.rs @@ -685,7 +685,7 @@ fn instance_descriptor(backends: wgpu::Backends) -> wgpu::InstanceDescriptor { /// device. `api` is the player's choice (`GraphicsApi::with_env` applied); /// `wgpu_backend`: whether `WGPU_BACKEND` is set, which picks the backends /// itself. Only Windows has two: Auto tries Vulkan, then DirectX 12 when -/// Vulkan has no adapter (no Vulkan driver) or no device. A native crash in +/// Vulkan has no surface, adapter (no Vulkan driver) or device. A native crash in /// the driver can't be caught in the game; the launcher switches the setting /// to DirectX 12 after one at the renderer's start (#746). fn backend_order(api: GraphicsApi, windows: bool, wgpu_backend: bool) -> Vec { @@ -793,7 +793,13 @@ async fn open_device( let surface = if offscreen { None } else { - Some(instance.create_surface(window.clone())?) + match instance.create_surface(window.clone()) { + Ok(surface) => Some(surface), + Err(e) => { + failures.push(format!("{name} surface: {e}")); + continue; + } + } }; let adapter = match instance .request_adapter(&wgpu::RequestAdapterOptions {