Wayland frame pacing on GNOME 46 (no fifo-v1/commit-timing): measure vs XWayland, fix present path #280

Open
opened 2026-10-04 03:57:10 +00:00 by sky_line · 0 comments
Owner

Measure and, if needed, fix frame pacing for native Wayland on GNOME 46 (Ubuntu 24.04 LTS) and other compositors without wp_fifo_v1 / wp_commit_timing_v1. Split out from #196/#197: we keep forcing native Wayland (crisp HiDPI and fractional scaling; XWayland is blurry there), so pacing on Wayland has to be good.

Why we suspect it

  • GNOME 46 (Mutter 46) lacks the fifo-v1 and commit-timing-v1 Wayland protocols. With RenderVSyncEnable=1 (default) we present with VK_PRESENT_MODE_FIFO_KHR. Mesa's Wayland WSI then paces on wl_surface.frame callbacks, which Mutter throttles or stops for occluded or offscreen surfaces. NVIDIA's WSI behaves differently.
  • SDL 3.2 only prefers Wayland by default when those protocols exist, for this reason.
  • The #196 reporter (Ubuntu 24.04, GNOME, RX 9070 XT, RADV) sees notably lower FPS than Alchemy, which runs on XWayland on the same machine.

Measure (GNOME 46, ideally both AMD/RADV and NVIDIA)

Same spot, RenderVKBench-style A/B or manual 60 s captures. Compare frame avg / p50 / p99 / jitter (VKHitch SECTIONS pacing line) and acquireWait:

  1. Native Wayland, vsync on (FIFO)
  2. Native Wayland, vsync off (MAILBOX / IMMEDIATE, if the WSI offers it)
  3. SDL_VIDEO_DRIVER=x11 (XWayland), vsync on
  4. SDL_VIDEO_DRIVER=x11, vsync off

Also test: window partially covered, another monitor, unfocused (with the background FPS limit at 0), and fullscreen versus windowed.

Possible fixes, depending on results

  • On compositors lacking fifo-v1, prefer MAILBOX when available for vsync-on (tear-free, no callback stalls), or IMMEDIATE + our own frame limiter at refresh rate.
  • Present-wait (VK_KHR_present_wait) / our pacing thread to avoid relying on frame callbacks.
  • Detect missing protocols at startup (wl_registry) and log them, so bug reports show it.
  • Last resort: a per-compositor default of X11 only at 100% integer scale, where XWayland isn't blurry. Probably not needed.

Done when

Native Wayland on GNOME 46 is within noise of the XWayland FPS and pacing (p99, jitter) at the same settings, or the remaining gap is understood and documented.

Measure and, if needed, fix frame pacing for native Wayland on **GNOME 46** (Ubuntu 24.04 LTS) and other compositors without `wp_fifo_v1` / `wp_commit_timing_v1`. Split out from #196/#197: we keep forcing native Wayland (crisp HiDPI and fractional scaling; XWayland is blurry there), so pacing on Wayland has to be good. ## Why we suspect it - GNOME 46 (Mutter 46) lacks the `fifo-v1` and `commit-timing-v1` Wayland protocols. With `RenderVSyncEnable=1` (default) we present with `VK_PRESENT_MODE_FIFO_KHR`. Mesa's Wayland WSI then paces on `wl_surface.frame` callbacks, which Mutter throttles or stops for occluded or offscreen surfaces. NVIDIA's WSI behaves differently. - SDL 3.2 only prefers Wayland by default when those protocols exist, for this reason. - The #196 reporter (Ubuntu 24.04, GNOME, RX 9070 XT, RADV) sees notably lower FPS than Alchemy, which runs on XWayland on the same machine. ## Measure (GNOME 46, ideally both AMD/RADV and NVIDIA) Same spot, `RenderVKBench`-style A/B or manual 60 s captures. Compare frame avg / p50 / p99 / jitter (`VKHitch` SECTIONS pacing line) and `acquireWait`: 1. Native Wayland, vsync on (FIFO) 2. Native Wayland, vsync off (MAILBOX / IMMEDIATE, if the WSI offers it) 3. `SDL_VIDEO_DRIVER=x11` (XWayland), vsync on 4. `SDL_VIDEO_DRIVER=x11`, vsync off Also test: window partially covered, another monitor, unfocused (with the background FPS limit at 0), and fullscreen versus windowed. ## Possible fixes, depending on results - On compositors lacking fifo-v1, prefer **MAILBOX** when available for vsync-on (tear-free, no callback stalls), or IMMEDIATE + our own frame limiter at refresh rate. - Present-wait (`VK_KHR_present_wait`) / our pacing thread to avoid relying on frame callbacks. - Detect missing protocols at startup (wl_registry) and log them, so bug reports show it. - Last resort: a per-compositor default of X11 *only* at 100% integer scale, where XWayland isn't blurry. Probably not needed. ## Done when Native Wayland on GNOME 46 is within noise of the XWayland FPS and pacing (p99, jitter) at the same settings, or the remaining gap is understood and documented.
sky_line added this to the Slipstream project 2026-10-06 15:04:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#280
No description provided.