Skip to content

Prefer a native Wayland window with Vulkan so HDR is available - #87

Merged
schindlershadow merged 1 commit into
mainfrom
prefer-wayland-hdr
Nov 19, 2026
Merged

schindlershadow merged 1 commit into
mainfrom
prefer-wayland-hdr

Conversation

@schindlershadow

Copy link
Copy Markdown
Owner

SDL2 tries X11 before Wayland. A game started from a Linux desktop (GNOME/KDE on Wayland) has X authorization, so its window opened through XWayland, whose surfaces offer no HDR format: HDR Output read "Unavailable" even with HDR on in the system settings.

  • With PSPRECOMP_RENDERER=vulkan and WAYLAND_DISPLAY set, psp_runtime_init_sdl sets SDL_HINT_VIDEODRIVER=wayland,x11 before SDL_Init (X11 stays the fallback). Not under gamescope (shows only X11 windows) and never over a SDL_VIDEODRIVER the user set.
  • The renderer is read from the environment, not vk_renderer_requested(): its Vulkan probe starts SDL's video layer, which picks X11 before the hint exists (the first attempt failed exactly this way).
  • The HDR unavailable reason names XWayland when the window still ended up on X11.
  • GRAPHICS.md updated.

Tested on desktop (GNOME 50 Wayland, HDR on, RX 7900 GRE), started with the session's XAUTHORITY like a desktop launch: before, present mode (of 4) = X11 and an SDR swapchain; after, (of 2) = Wayland and an HDR10 PQ swapchain. Not checked: windowed-mode decorations on native Wayland.

Release notes

  • Linux: HDR output now works on Wayland desktops (GNOME, KDE); it was greyed out as "Unavailable" because the game opened through XWayland.

🤖 Generated with Claude Code

SDL2 tries X11 before Wayland. In a desktop session (X authorization
present) the game opened through XWayland, whose surfaces offer no HDR
format, so HDR Output read Unavailable even with HDR on in GNOME.

With PSPRECOMP_RENDERER=vulkan and WAYLAND_DISPLAY set, set
SDL_HINT_VIDEODRIVER=wayland,x11 before SDL_Init (not under gamescope,
never over a user SDL_VIDEODRIVER). The renderer is read from the
environment: vk_renderer_requested() probes Vulkan, which starts SDL's
video layer before the hint. The unavailable reason now names XWayland
when the window ended up on X11.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schindlershadow
schindlershadow merged commit 3adc288 into main Nov 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant