From 3607aae91d7bd5b3895cfa4a7e2056c41e0a5bfe Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Tue, 14 Apr 2026 13:14:16 +0200 Subject: [PATCH] Configure wgpu to be low-latency by default (#8103) This changes the default value of `WgpuConfiguration::desired_maximum_frame_latency` to `Some(1)`. For low-Hz displays, this results in significantly lower input latency. * Closes https://github.com/emilk/egui/issues/5037 ? * Related to https://github.com/emilk/egui/issues/7761 --- crates/egui-wgpu/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/egui-wgpu/src/lib.rs b/crates/egui-wgpu/src/lib.rs index 5ab91557b..75155899d 100644 --- a/crates/egui-wgpu/src/lib.rs +++ b/crates/egui-wgpu/src/lib.rs @@ -328,7 +328,12 @@ impl Default for WgpuConfiguration { fn default() -> Self { Self { present_mode: wgpu::PresentMode::AutoVsync, - desired_maximum_frame_latency: None, + desired_maximum_frame_latency: if cfg!(target_os = "ios") { + None // The default is good on iOS, while `Some(1)` cuts FPS in half + } else { + Some(1) // Low-latency by default. + }, + // No display handle available at this point — callers should replace this with // `WgpuSetup::from_display_handle(...)` before creating the instance if one is available. wgpu_setup: WgpuSetup::without_display_handle(),