[PR #1174] [MERGED] Wayland white overlay (#1007): reproduced on a real GPU, fixed by #1075; pin it with that GPU's surface list #3388

Closed
opened 2026-11-03 04:09:10 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1174
Author: @ludovic111
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @ludovic111

Base: main ← Head: fix/wayland-surface-format-test


📝 Commits (1)

  • 30a2cc7 Wayland: pin the 8-bit surface choice with a colour-managed compositor's list (#1007)

📊 Changes

1 file changed (+28 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/gfx.rs (+28 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

#1007 (DerRehberg, Hyprland): a white overlay over the game on Wayland, gone under XWayland. The cause is the one #1075 (ItsPotatoTime, merged 2026-10-21) fixed, and this PR shows it on a real GPU and pins it with a regression test built from that GPU's real surface list.

On a Wayland compositor with colour management, Mesa lists Rgba16Float first among the surface formats, and wgpu gives it a linear extended-sRGB colour space. Before #1075, Horizon took the first non-sRGB format, so the compositor read the game's gamma-encoded pixels as linear light, and every colour came out washed toward white. X11 has no such formats, which is why XWayland looked right. Since #1075, Horizon takes Bgra8Unorm/Rgba8Unorm.

Reproduction (ThinkPad, no screen)

  • Stack: headless weston 16 (GL renderer on the ThinkPad's Intel HD 620, color-management=true, white background so any washing or transparency shows) and Mesa 26.2.5 ANV (Vulkan on the real GPU, not a software renderer).
  • Surface list: vulkaninfo on that Wayland display gives R16G16B16A16_SFLOAT first, then R16G16B16A16_UNORM, A2B10G10R10 and the 8-bit formats, with extended-linear, BT.2020, PQ and other colour spaces. That matches #1075's RADV report.
  • Builds: main's client, and the same client with only surface_format put back to its pre-#1075 rule. Both RD 4, same seed, position and view. Captures come from the compositor (weston-screenshooter), i.e. what a player sees, not the game's own framebuffer.

Kiosk shell (window forced to the output, like a tiling compositor):

before #1075 (Rgba16Float) main (Bgra8Unorm)

Desktop shell, before and after a resize (F11 → 1600x900, so the surface is reconfigured):

windowed after the resize
before #1075
main

The game's log line says which surface it got: configuring the surface (1280x720 Rgba16Float, Mailbox) before, (1280x720 Bgra8Unorm, Mailbox) on main.

One difference from the report: under weston the old choice stays washed after a resize, whereas DerRehberg saw it clear on Hyprland. A resize reconfigures the same Rgba16Float surface, so this is probably Hyprland handling a recreated swapchain's colour description differently. It doesn't matter for the fix: main never asks for the fp16/linear surface when an 8-bit one exists.

(The white margin after F11 is in both builds: weston's headless fullscreen placement, not part of #1007.)

This PR

A test, a_colour_managed_wayland_surface_still_gets_8_bit, with the list exactly as wgpu reports it on that stack (Rgba16Float, Rgba16Unorm, Rgb10a2Unorm, Bgra8UnormSrgb, Bgra8Unorm, Rgba8UnormSrgb, Rgba8Unorm). It fails if a future change to surface_format ever takes a 16- or 10-bit format first again.

Self-check (Mac mini)

cargo fmt --all --check                                                    OK
set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings     exit 0
cargo test -p horizon-client --lib -- surface                              7 passed (new: a_colour_managed_wayland_surface_still_gets_8_bit)
tools/parity.py --changed origin/main --list                               102 of 327 (gfx.rs changed)

The change is only inside #[cfg(test)] mod tests, so no game binary changes; I left the 102 harnesses to CI's parity job instead of running them on a loaded Mac mini.

Needs

  • Players get #1075 with the next release (frozen until Ludovic says go). @DerRehberg could confirm on Hyprland then.
  • Not tested: Hyprland itself and NVIDIA's proprietary Wayland driver (no such machine here; the desktop was off). Software-only Vulkan (lavapipe) wasn't needed: the ThinkPad's own GPU reproduced it.
  • I fetched weston, Mesa, vulkan-tools, vulkan-loader, wayland and libxkbcommon into the ThinkPad's nix store (nix build --no-link, about 480 MB, removable with nix-collect-garbage). Nothing was installed system-wide and the system configuration was not changed.

Fixes #1007

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1174 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/wayland-surface-format-test` --- ### 📝 Commits (1) - [`30a2cc7`](https://github.com/horizon-rust/horizon/commit/30a2cc7c61001a5c284185b3c25bb106cff0336b) Wayland: pin the 8-bit surface choice with a colour-managed compositor's list (#1007) ### 📊 Changes **1 file changed** (+28 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/gfx.rs` (+28 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What #1007 (**DerRehberg**, Hyprland): a white overlay over the game on Wayland, gone under XWayland. The cause is the one #1075 (**ItsPotatoTime**, merged 2026-10-21) fixed, and this PR shows it on a real GPU and pins it with a regression test built from that GPU's real surface list. On a Wayland compositor with colour management, Mesa lists `Rgba16Float` first among the surface formats, and wgpu gives it a linear extended-sRGB colour space. Before #1075, Horizon took the first non-sRGB format, so the compositor read the game's gamma-encoded pixels as linear light, and every colour came out washed toward white. X11 has no such formats, which is why XWayland looked right. Since #1075, Horizon takes `Bgra8Unorm`/`Rgba8Unorm`. ## Reproduction (ThinkPad, no screen) - **Stack:** headless **weston 16** (GL renderer on the ThinkPad's **Intel HD 620**, `color-management=true`, white background so any washing or transparency shows) and **Mesa 26.2.5 ANV** (Vulkan on the real GPU, not a software renderer). - **Surface list:** `vulkaninfo` on that Wayland display gives `R16G16B16A16_SFLOAT` first, then `R16G16B16A16_UNORM`, `A2B10G10R10` and the 8-bit formats, with extended-linear, BT.2020, PQ and other colour spaces. That matches #1075's RADV report. - **Builds:** main's client, and the same client with only `surface_format` put back to its pre-#1075 rule. Both RD 4, same seed, position and view. Captures come from the compositor (`weston-screenshooter`), i.e. what a player sees, not the game's own framebuffer. Kiosk shell (window forced to the output, like a tiling compositor): | before #1075 (`Rgba16Float`) | main (`Bgra8Unorm`) | |---|---| | <img src="https://raw.githubusercontent.com/ludovic111/horizon/93792183e6fd59650d09c08004234420b0c4dbba/wayland-1007/kiosk-before-1075-rgba16float.png"> | <img src="https://raw.githubusercontent.com/ludovic111/horizon/93792183e6fd59650d09c08004234420b0c4dbba/wayland-1007/kiosk-main-bgra8unorm.png"> | Desktop shell, before and after a resize (F11 → 1600x900, so the surface is reconfigured): | | windowed | after the resize | |---|---|---| | before #1075 | <img src="https://raw.githubusercontent.com/ludovic111/horizon/93792183e6fd59650d09c08004234420b0c4dbba/wayland-1007/desktop-before-1075.png"> | <img src="https://raw.githubusercontent.com/ludovic111/horizon/93792183e6fd59650d09c08004234420b0c4dbba/wayland-1007/desktop-before-1075-after-f11.png"> | | main | <img src="https://raw.githubusercontent.com/ludovic111/horizon/93792183e6fd59650d09c08004234420b0c4dbba/wayland-1007/desktop-main.png"> | <img src="https://raw.githubusercontent.com/ludovic111/horizon/93792183e6fd59650d09c08004234420b0c4dbba/wayland-1007/desktop-main-after-f11.png"> | The game's log line says which surface it got: `configuring the surface (1280x720 Rgba16Float, Mailbox)` before, `(1280x720 Bgra8Unorm, Mailbox)` on main. **One difference from the report:** under weston the old choice stays washed after a resize, whereas DerRehberg saw it clear on Hyprland. A resize reconfigures the same `Rgba16Float` surface, so this is probably Hyprland handling a recreated swapchain's colour description differently. It doesn't matter for the fix: main never asks for the fp16/linear surface when an 8-bit one exists. (The white margin after F11 is in both builds: weston's headless fullscreen placement, not part of #1007.) ## This PR A test, `a_colour_managed_wayland_surface_still_gets_8_bit`, with the list exactly as wgpu reports it on that stack (`Rgba16Float, Rgba16Unorm, Rgb10a2Unorm, Bgra8UnormSrgb, Bgra8Unorm, Rgba8UnormSrgb, Rgba8Unorm`). It fails if a future change to `surface_format` ever takes a 16- or 10-bit format first again. ## Self-check (Mac mini) ``` cargo fmt --all --check OK set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings exit 0 cargo test -p horizon-client --lib -- surface 7 passed (new: a_colour_managed_wayland_surface_still_gets_8_bit) tools/parity.py --changed origin/main --list 102 of 327 (gfx.rs changed) ``` The change is only inside `#[cfg(test)] mod tests`, so no game binary changes; I left the 102 harnesses to CI's parity job instead of running them on a loaded Mac mini. ## Needs - Players get #1075 with the next release (frozen until Ludovic says go). @DerRehberg could confirm on Hyprland then. - Not tested: Hyprland itself and NVIDIA's proprietary Wayland driver (no such machine here; the desktop was off). Software-only Vulkan (lavapipe) wasn't needed: the ThinkPad's own GPU reproduced it. - I fetched weston, Mesa, vulkan-tools, vulkan-loader, wayland and libxkbcommon into the ThinkPad's nix store (`nix build --no-link`, about 480 MB, removable with `nix-collect-garbage`). Nothing was installed system-wide and the system configuration was not changed. Fixes #1007 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:09:10 +07: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
horizon-rust/horizon#3388
No description provided.