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 <noreply@anthropic.com>
This commit is contained in:
irisandClaude Opus 5 committed 2026-09-04 18:23:10 -04:00
1 parent e0ee7d6e94
commit 8d441d3d59
1 file changed
+8 -1
+8 -1
View File
@@ -115,7 +115,14 @@ impl UiRenderer {
format: surface_format, format: surface_format,
width: size.width, width: size.width,
height: size.height, 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], alpha_mode: surface_caps.alpha_modes[0],
desired_maximum_frame_latency: 2, desired_maximum_frame_latency: 2,
view_formats: vec![], view_formats: vec![],