[PR #3988] [MERGED] HDR: Auto on Windows, from the luminances the OS reports #5338

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3988
Author: @senjinthedragon
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: hdr-windows-auto


📝 Commits (6)

  • 4b004cf HDR: Auto on Windows, from the luminances the OS reports
  • b246a02 Merge remote-tracking branch 'origin/main' into upd-3988
  • 8c079ed HDR Windows Auto: builds on Windows; the peak is never below Paper White
  • 691f958 Merge main: log_display serves Windows too; DisplayWatch built field by field
  • 12e23c2 Merge branch 'upd-3988' into upd2-3988
  • dfb6d1f Merge main into hdr-windows-auto: docs/graphics.md keeps main's HDR paragraph with the Windows Auto sentence

📊 Changes

2 files changed (+109 additions, -10 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+108 -9)
📝 docs/graphics.md (+1 -1)

📄 Description

🤖 Opened by senjinthedragon's AI agent (Claude Code, Claude Opus 5.5), not by senjinthedragon personally.

What and why

Follows #3461 (Auto Paper White and Peak Brightness from the Wayland compositor). That PR gives Auto
its values on Linux; this one gives them on Windows, where most players are.

  • Where they come from: wgpu 30's Surface::display_hdr_info, which reads DXGI's MaxLuminance and the
    SDR white level (DISPLAYCONFIG_SDR_WHITE_LEVEL, set by the "SDR content brightness" slider in Windows' HDR
    settings). No new dependency and no unsafe code: wgpu does the Windows calls.
  • In HDR output's scale: Windows composes HDR in absolute nits, so SDR white is Paper White and the display's
    peak is Peak Brightness as they are. Paper White is kept within the slider's 80..480 nits (the same range as
    Windows' own slider) and the peak within 200..10 000.
  • Kept up to date: Windows sends no event when the slider moves or the window goes to another display, so the
    renderer reads the values again every 2 seconds while HDR output is on, and applies them when they changed. The log says what it got:
    Horizon renderer: the system reports SDR white at 240 nits and a peak of 998 nits.
  • On Linux without a Wayland compositor that answers, wgpu reports nothing (Vulkan there has no such query), so
    nothing changes.

What's checked, and what isn't. I have no Windows machine with an HDR display, so this is untested on Windows:
the mapping has a unit test, and the code path compiles and runs on Linux, where wgpu returns nothing. Two
questions a Windows tester could answer from the log line:

  1. Does the reported peak match the display? DXGI's figure usually comes from the display's EDID, which can run
    optimistic. The player's own value always wins, and Graphics: HDR's calibration is there for that.
  2. Does running the Windows HDR Calibration app change the reported peak? I couldn't find that documented.

macOS can feed the same Auto from its EDR headroom (DisplayHdrInfo::headroom), but that's a ratio, not nits, and
I don't know how macOS maps a PQ layer onto it, so I've left it out rather than guess.

Vanilla reference

Horizon-only (Horizon's graphics settings). Vanilla's Video Settings are unchanged.

Self-check

tools/pr_ready.py --quick: 2 files, +97 −8; rustfmt, clippy and 556 tests (horizon-client-render) pass.

🤖 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/3988 **Author:** [@senjinthedragon](https://github.com/senjinthedragon) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `hdr-windows-auto` --- ### 📝 Commits (6) - [`4b004cf`](https://github.com/horizon-rust/horizon/commit/4b004cf7d620e69fdbf5f69bbd8bb144c319ef5b) HDR: Auto on Windows, from the luminances the OS reports - [`b246a02`](https://github.com/horizon-rust/horizon/commit/b246a02f55af1a26371837cb84d0987fc8448a24) Merge remote-tracking branch 'origin/main' into upd-3988 - [`8c079ed`](https://github.com/horizon-rust/horizon/commit/8c079ed9d7bd6fc0a8adce9a1d2ca0f7039c1953) HDR Windows Auto: builds on Windows; the peak is never below Paper White - [`691f958`](https://github.com/horizon-rust/horizon/commit/691f958bc48aca2224aae796d742de0e3f237e4d) Merge main: log_display serves Windows too; DisplayWatch built field by field - [`12e23c2`](https://github.com/horizon-rust/horizon/commit/12e23c20a8bcfc0818fb4908edccd65a7efb1a3b) Merge branch 'upd-3988' into upd2-3988 - [`dfb6d1f`](https://github.com/horizon-rust/horizon/commit/dfb6d1f0fbebbbd7af9a19e379687eda4e9cce18) Merge main into hdr-windows-auto: docs/graphics.md keeps main's HDR paragraph with the Windows Auto sentence ### 📊 Changes **2 files changed** (+109 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+108 -9) 📝 `docs/graphics.md` (+1 -1) </details> ### 📄 Description > 🤖 Opened by senjinthedragon's AI agent (Claude Code, Claude Opus 5.5), not by senjinthedragon personally. ## What and why Follows #3461 (Auto Paper White and Peak Brightness from the Wayland compositor). That PR gives Auto its values on Linux; this one gives them on Windows, where most players are. - **Where they come from:** wgpu 30's `Surface::display_hdr_info`, which reads DXGI's `MaxLuminance` and the SDR white level (`DISPLAYCONFIG_SDR_WHITE_LEVEL`, set by the "SDR content brightness" slider in Windows' HDR settings). No new dependency and no unsafe code: wgpu does the Windows calls. - **In HDR output's scale:** Windows composes HDR in absolute nits, so SDR white is Paper White and the display's peak is Peak Brightness as they are. Paper White is kept within the slider's 80..480 nits (the same range as Windows' own slider) and the peak within 200..10 000. - **Kept up to date:** Windows sends no event when the slider moves or the window goes to another display, so the renderer reads the values again every 2 seconds while HDR output is on, and applies them when they changed. The log says what it got: `Horizon renderer: the system reports SDR white at 240 nits and a peak of 998 nits`. - On Linux without a Wayland compositor that answers, wgpu reports nothing (Vulkan there has no such query), so nothing changes. **What's checked, and what isn't.** I have no Windows machine with an HDR display, so this is untested on Windows: the mapping has a unit test, and the code path compiles and runs on Linux, where wgpu returns nothing. Two questions a Windows tester could answer from the log line: 1. Does the reported peak match the display? DXGI's figure usually comes from the display's EDID, which can run optimistic. The player's own value always wins, and Graphics: HDR's calibration is there for that. 2. Does running the **Windows HDR Calibration** app change the reported peak? I couldn't find that documented. macOS can feed the same Auto from its EDR headroom (`DisplayHdrInfo::headroom`), but that's a ratio, not nits, and I don't know how macOS maps a PQ layer onto it, so I've left it out rather than guess. ## Vanilla reference Horizon-only (Horizon's graphics settings). Vanilla's Video Settings are unchanged. ## Self-check `tools/pr_ready.py --quick`: 2 files, +97 −8; rustfmt, clippy and 556 tests (horizon-client-render) pass. 🤖 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 05:11:54 +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#5338
No description provided.