From 2e87387e53b14b7a5e9368b876e110afb7f7cadf Mon Sep 17 00:00:00 2001 From: localcc Date: Tue, 23 Sep 2025 15:57:26 +0200 Subject: [PATCH] Change emulated GPU message on Windows (#38710) Release Notes: - N/A --- crates/zed/src/zed.rs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index 6029ce6530a729ccd0b299bdcab2acbd620bbbdd..5e9ebb3433ee10451102b6066bda73f4cb4d1a51 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -512,17 +512,30 @@ fn show_software_emulation_warning_if_needed( cx: &mut Context, ) { if specs.is_software_emulated && std::env::var("ZED_ALLOW_EMULATED_GPU").is_err() { + let (graphics_api, docs_url, open_url) = if cfg!(target_os = "windows") { + ( + "DirectX", + "https://zed.dev/docs/windows", + "https://zed.dev/docs/windows", + ) + } else { + ( + "Vulkan", + "https://zed.dev/docs/linux", + "https://zed.dev/docs/linux#zed-fails-to-open-windows", + ) + }; let message = format!( db::indoc! {r#" - Zed uses Vulkan for rendering and requires a compatible GPU. + Zed uses {} for rendering and requires a compatible GPU. Currently you are using a software emulated GPU ({}) which will result in awful performance. - For troubleshooting see: https://zed.dev/docs/linux + For troubleshooting see: {} Set ZED_ALLOW_EMULATED_GPU=1 env var to permanently override. "#}, - specs.device_name + graphics_api, specs.device_name, docs_url ); let prompt = window.prompt( PromptLevel::Critical, @@ -534,7 +547,7 @@ fn show_software_emulation_warning_if_needed( cx.spawn(async move |_, cx| { if prompt.await == Ok(1) { cx.update(|cx| { - cx.open_url("https://zed.dev/docs/linux#zed-fails-to-open-windows"); + cx.open_url(open_url); cx.quit(); }) .ok();