1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 13:50:04 -04:00

Configure wgpu to be low-latency by default (#8203)

* initially done in https://github.com/emilk/egui/pull/8103, reverted in
#8167 due to resize hangs
* Related: https://github.com/emilk/egui/issues/8043 (maybe closes??)

Turns out the resize hangs were caused by the present_with_transaction
call. Disabling that when `desired_maximum_frame_latency == 1` causes
the window to resize smoothly.

Thanks @krisdigital for noticing that connection:
https://github.com/emilk/egui/issues/8043#issuecomment-4154440382

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
Lucas Meurer
2026-05-26 15:49:51 +02:00
committed by GitHub
parent fd57895559
commit 8d5a7b4557
2 changed files with 21 additions and 17 deletions

View File

@@ -87,13 +87,10 @@ impl SurfaceConfig {
pub const LOW_LATENCY: Self = Self {
present_mode: wgpu::PresentMode::AutoVsync,
#[expect(clippy::branches_sharing_code)]
desired_maximum_frame_latency: if cfg!(target_os = "ios") {
None // The default is good on iOS, while `Some(1)` cuts FPS in half
} else {
// TODO(emilk): We would like yo use `Some(1)` here, but
// that causes bugs when resizing the window on macOS.
None
Some(1)
},
};