Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Change emulated GPU message on Windows (#38710)
localcc2e87387e53b1
diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rsindex 6029ce6530a..5e9ebb3433e 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<Workspace>,) {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 ({}) whichwill 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();