Repository navigation
Prefer a native Wayland window with Vulkan so HDR is available - #87
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
PSPRECOMP_RENDERER=vulkanandWAYLAND_DISPLAYset,psp_runtime_init_sdlsetsSDL_HINT_VIDEODRIVER=wayland,x11beforeSDL_Init(X11 stays the fallback). Not under gamescope (shows only X11 windows) and never over aSDL_VIDEODRIVERthe user set.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).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
🤖 Generated with Claude Code