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:
@@ -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)
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user