From 8d441d3d591a2f320c45dca1dfedd76d9081ea83 Mon Sep 17 00:00:00 2001 From: iris <2+iris@noreply.localhost> Date: Fri, 4 Sep 2026 18:23:10 -0400 Subject: [PATCH] Present iris with vsync AutoNoVsync accepts frames as fast as the GPU will take them, so a redraw burst costs whatever the hardware can be made to do rather than one frame. That is the wrong default for a toolkit whose stated goal is to save battery, and it is worse than wrong on this machine: the GPU here is the host's real one reached through virtio-gpu, so frames nobody will see are paid for on somebody's desktop. AutoVsync picks Fifo, which every backend supports. Note this is not an idle drain -- iris only draws when needs_redraw says something changed, and the tabs example guards its stats string -- so this bounds the cost of a burst rather than stopping a spin. Co-Authored-By: Claude Opus 5 --- iris/src/default/render.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/iris/src/default/render.rs b/iris/src/default/render.rs index 970d44c..77829cc 100644 --- a/iris/src/default/render.rs +++ b/iris/src/default/render.rs @@ -115,7 +115,14 @@ impl UiRenderer { format: surface_format, width: size.width, height: size.height, - present_mode: PresentMode::AutoNoVsync, + // Vsync, because a UI toolkit aiming at battery life must not + // present frames a display will never show. AutoNoVsync accepts + // them as fast as the GPU will take them, so a redraw burst costs + // whatever the hardware can be made to do rather than one frame -- + // and on this machine the GPU is the host's real one, reached + // through virtio-gpu, so that cost lands on somebody's desktop. + // AutoVsync picks Fifo, which every backend supports. + present_mode: PresentMode::AutoVsync, alpha_mode: surface_caps.alpha_modes[0], desired_maximum_frame_latency: 2, view_formats: vec![],