mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
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
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user