From c482a0b4696e9f825a0aac5b59e57cbdf210b36e Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 18 Dec 2023 13:19:04 +0100 Subject: [PATCH] egui-wgpu: reduce input latency by defaulting to double-buffering This makes a huge difference in perceived latency on my 60 Hz monitor on macOS on a native build. There is no difference on web though afaict. For me this is a much better default. Tearing is mildly annoying, but input latency makes an aplication feel sluggish. --- crates/egui-wgpu/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/egui-wgpu/src/lib.rs b/crates/egui-wgpu/src/lib.rs index 447f717b947..287121e2f1d 100644 --- a/crates/egui-wgpu/src/lib.rs +++ b/crates/egui-wgpu/src/lib.rs @@ -238,8 +238,8 @@ impl Default for WgpuConfiguration { } }), - present_mode: wgpu::PresentMode::AutoVsync, - + present_mode: wgpu::PresentMode::AutoNoVsync, // double-buffered: low-latency, may have tearing + // present_mode: wgpu::PresentMode::AutoVsync, // triple-buffered: high-latency, no tearing power_preference: wgpu::util::power_preference_from_env() .unwrap_or(wgpu::PowerPreference::HighPerformance),