[PR #2292] [MERGED] HDR: present HDR10 (PQ) where the surface offers it, scRGB otherwise #4178

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2292
Author: @senjinthedragon
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: hdr-pq


📝 Commits (1)

  • cfd2dc8 HDR: present HDR10 (PQ) where the surface offers it, scRGB otherwise

📊 Changes

5 files changed (+127 additions, -35 deletions)

View changed files

📝 crates/horizon-client/src/gfx.rs (+17 -17)
📝 crates/horizon-client/src/gfx/hdr.rs (+86 -13)
📝 crates/horizon-client/src/graphics.rs (+1 -1)
📝 crates/horizon-client/src/hdr.wgsl (+22 -3)
📝 docs/graphics.md (+1 -1)

📄 Description

🤖 Opened by Senjin's AI agent (Claude Code), not by Senjin.

What and why

Follows #2021, part of #1441. HDR output now presents HDR10 (Rgb10a2Unorm, Bt2100Pq: BT.2020
with the ST 2084 curve) where the surface offers it, and scRGB as before where it doesn't.

  • HDR10 is what games usually present and what the display receives; a compositor composes in it or
    converts to it anyway. The NVIDIA driver offers it on Wayland next to scRGB (#2021's text said
    otherwise; that was wrong, it came from checking Rgba16Float only).
  • The swapchain is 10-bit instead of 16-bit float: half the last pass's bandwidth. The frame before
    the HDR pass is 8-bit, so nothing is lost.
  • hdr.wgsl converts the same linear light to BT.2020 (BT.2087 matrix) and encodes it with the PQ
    curve; nothing else in the pass changes. The metadata is the same for both.
  • HORIZON_HDR_OUTPUT=pq or scrgb allows only that one, to compare them.

Vanilla reference

Horizon-only. HDR stays off by default; with it off nothing changes.

Self-check

pr_ready (tools/pr_ready.py --quick, against origin/main at 9cbf93a1, Rust 1.99.1)

Check Result
Scope ✅ 5 files, +127 −35
rustfmt ✅
clippy ✅
tests: horizon-client ✅ 1327 passed (new: hdr10_first_then_scrgb)
doc tests ✅

Testing

Linux, KWin 6.8.1 (HDR on, SDR brightness 430 nits), NVIDIA RTX 2080 (driver 615.78), Alienware
AW3423DW QD-OLED (HDR1000):

  • The protocol log (WAYLAND_DEBUG=client) shows the driver describing the window as
    set_tf_named(st2084_pq), set_primaries_named(bt2020), with our set_max_cll and
    set_mastering_luminance.
  • HDR10, then scRGB (HORIZON_HDR_OUTPUT=scrgb), same Paper White (200) and Peak (500): no visible difference, on
    menu text and on torches, lava and glowstone in game; toggling HDR on and off behaves the same. KWin takes PQ's
    standard 203-nit reference as it took scRGB's, so the sliders mean the same in both.

Screenshots

HDR can't be shown in an SDR screenshot.

🤖 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/2292 **Author:** [@senjinthedragon](https://github.com/senjinthedragon) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `hdr-pq` --- ### 📝 Commits (1) - [`cfd2dc8`](https://github.com/horizon-rust/horizon/commit/cfd2dc83922ce606c518b085443d634f3931b23e) HDR: present HDR10 (PQ) where the surface offers it, scRGB otherwise ### 📊 Changes **5 files changed** (+127 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/gfx.rs` (+17 -17) 📝 `crates/horizon-client/src/gfx/hdr.rs` (+86 -13) 📝 `crates/horizon-client/src/graphics.rs` (+1 -1) 📝 `crates/horizon-client/src/hdr.wgsl` (+22 -3) 📝 `docs/graphics.md` (+1 -1) </details> ### 📄 Description > 🤖 Opened by Senjin's AI agent (Claude Code), not by Senjin. ## What and why Follows #2021, part of #1441. HDR output now presents **HDR10** (`Rgb10a2Unorm`, `Bt2100Pq`: BT.2020 with the ST 2084 curve) where the surface offers it, and scRGB as before where it doesn't. - HDR10 is what games usually present and what the display receives; a compositor composes in it or converts to it anyway. The NVIDIA driver offers it on Wayland next to scRGB (#2021's text said otherwise; that was wrong, it came from checking `Rgba16Float` only). - The swapchain is 10-bit instead of 16-bit float: half the last pass's bandwidth. The frame before the HDR pass is 8-bit, so nothing is lost. - `hdr.wgsl` converts the same linear light to BT.2020 (BT.2087 matrix) and encodes it with the PQ curve; nothing else in the pass changes. The metadata is the same for both. - `HORIZON_HDR_OUTPUT=pq` or `scrgb` allows only that one, to compare them. ## Vanilla reference Horizon-only. HDR stays off by default; with it off nothing changes. ## Self-check **pr_ready** (`tools/pr_ready.py --quick`, against origin/main at 9cbf93a1, Rust 1.99.1) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +127 −35 | | rustfmt | ✅ | | clippy | ✅ | | tests: horizon-client | ✅ 1327 passed (new: `hdr10_first_then_scrgb`) | | doc tests | ✅ | ## Testing Linux, KWin 6.8.1 (HDR on, SDR brightness 430 nits), NVIDIA RTX 2080 (driver 615.78), Alienware AW3423DW QD-OLED (HDR1000): - The protocol log (`WAYLAND_DEBUG=client`) shows the driver describing the window as `set_tf_named(st2084_pq)`, `set_primaries_named(bt2020)`, with our `set_max_cll` and `set_mastering_luminance`. - HDR10, then scRGB (`HORIZON_HDR_OUTPUT=scrgb`), same Paper White (200) and Peak (500): no visible difference, on menu text and on torches, lava and glowstone in game; toggling HDR on and off behaves the same. KWin takes PQ's standard 203-nit reference as it took scRGB's, so the sliders mean the same in both. ## Screenshots HDR can't be shown in an SDR screenshot. 🤖 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:15:15 +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#4178
No description provided.