[pr-fix][rendering] Detect HDR on the display adapter in hybrid GPU systems #157

Open
Bing_Yanchi wants to merge 1 commit from Bing_Yanchi/Darner:codex/fix-hdr-display-output into main
First-time contributor

Fixes #129

Contributor role (optional)

  • Fluxer ID: 1577530089162149888

What it changes

HDR detection queried the rendering adapter's first output. With the monitor connected to the motherboard/iGPU and the dGPU used for rendering, that output does not exist, so the game falls back to SDR even when Windows HDR is enabled.

Enumerate all adapters and match the attached output to the title window's monitor. Before the window exists, use the primary monitor. Both the game's HDR query and the F1 HDR status use this lookup. The HDR log now includes the display name.

How it was tested

  • Tested revision: ec3becbabf, based on main 57dea7f236. The commands below ran on the identical source tree before committing.
  • Commands and results (Windows, Rust 1.98.1):
    • cargo clippy --workspace --all-targets --locked --offline -- -D warnings: passed.
    • cargo clippy --workspace --all-targets --all-features --locked --offline -- -D warnings: passed.
    • cargo test --locked --offline -p darner-gpu --lib host::hdr::tests: 5 passed.
    • cargo test --workspace --locked --offline: failed in three GPU tests: indirect::tests::host_list_records_held_runs, host::uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queue, and watch::tests::ask_once_by_res_splits_reservations_without_refusals.
    • cargo test --locked --offline -p darner-gpu --lib --quiet on unmodified main 57dea7f: reproduced the same indirect and watch failures; the UAV pool test passed in this baseline run.
    • cargo test --locked --offline -p darner-gpu --lib host::uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queue -- --exact on the fix: passed when run alone.
    • cargo run --quiet --locked --offline --package xtask -- policy: 553 files passed; the same command with --staged passed for the one changed file.
    • cargo build --release --locked --offline -p darner: passed; the resulting executable also returned its version successfully.
  • Native DXGI check: the RTX 3070 Ti had no outputs; the new lookup found DISPLAY1 on the AMD iGPU and read a 417-nit peak.
  • Gameplay: RTX 3070 Ti rendering, AMD iGPU driving the monitor, Windows 11; Series S, 2560x1440, DLSS Quality, ray tracing off, 4x DLSS frame generation requested. After enabling HDR in Windows, I confirmed HDR works with the fixed release build. Generated-frame delivery and frame rates were not measured.
  • Shader wave sizes: not applicable; no shader changes.
  • Coverage gaps: other GPU/display combinations, moving between SDR and HDR monitors during a run, and measured HDR image quality/luminance. The full workspace test suite did not pass, as detailed above.

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #118 documents HDR brightness controls; #113 enables FSR 4 frame generation on HDR10. Neither fixes display discovery, and no open PR changes crates/darner-gpu/src/host/hdr.rs or covers #129.
Fixes #129 ## Contributor role (optional) - Fluxer ID: 1577530089162149888 ## What it changes HDR detection queried the rendering adapter's first output. With the monitor connected to the motherboard/iGPU and the dGPU used for rendering, that output does not exist, so the game falls back to SDR even when Windows HDR is enabled. Enumerate all adapters and match the attached output to the title window's monitor. Before the window exists, use the primary monitor. Both the game's HDR query and the F1 HDR status use this lookup. The HDR log now includes the display name. ## How it was tested - Tested revision: ec3becbabf457689ee626824536758ee689e7389, based on main 57dea7f236. The commands below ran on the identical source tree before committing. - Commands and results (Windows, Rust 1.98.1): - `cargo clippy --workspace --all-targets --locked --offline -- -D warnings`: passed. - `cargo clippy --workspace --all-targets --all-features --locked --offline -- -D warnings`: passed. - `cargo test --locked --offline -p darner-gpu --lib host::hdr::tests`: 5 passed. - `cargo test --workspace --locked --offline`: failed in three GPU tests: `indirect::tests::host_list_records_held_runs`, `host::uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queue`, and `watch::tests::ask_once_by_res_splits_reservations_without_refusals`. - `cargo test --locked --offline -p darner-gpu --lib --quiet` on unmodified main 57dea7f: reproduced the same indirect and watch failures; the UAV pool test passed in this baseline run. - `cargo test --locked --offline -p darner-gpu --lib host::uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queue -- --exact` on the fix: passed when run alone. - `cargo run --quiet --locked --offline --package xtask -- policy`: 553 files passed; the same command with `--staged` passed for the one changed file. - `cargo build --release --locked --offline -p darner`: passed; the resulting executable also returned its version successfully. - Native DXGI check: the RTX 3070 Ti had no outputs; the new lookup found DISPLAY1 on the AMD iGPU and read a 417-nit peak. - Gameplay: RTX 3070 Ti rendering, AMD iGPU driving the monitor, Windows 11; Series S, 2560x1440, DLSS Quality, ray tracing off, 4x DLSS frame generation requested. After enabling HDR in Windows, I confirmed HDR works with the fixed release build. Generated-frame delivery and frame rates were not measured. - Shader wave sizes: not applicable; no shader changes. - Coverage gaps: other GPU/display combinations, moving between SDR and HDR monitors during a run, and measured HDR image quality/luminance. The full workspace test suite did not pass, as detailed above. ## Checklist - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #118 documents HDR brightness controls; #113 enables FSR 4 frame generation on HDR10. Neither fixes display discovery, and no open PR changes `crates/darner-gpu/src/host/hdr.rs` or covers #129.
Bing_Yanchi changed title from [pr-fix][rendering] Detect HDR on the display adapter in hybrid GPU systems to WIP: [pr-fix][rendering] Detect HDR on the display adapter in hybrid GPU systems 2026-12-04 00:26:30 +00:00
Bing_Yanchi changed title from WIP: [pr-fix][rendering] Detect HDR on the display adapter in hybrid GPU systems to [pr-fix][rendering] Detect HDR on the display adapter in hybrid GPU systems 2026-12-04 00:30:16 +00:00
This pull request has changes conflicting with the target branch.
  • crates/darner-gpu/src/host/hdr.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'codex/fix-hdr-display-output:Bing_Yanchi-codex/fix-hdr-display-output'
git switch 'Bing_Yanchi-codex/fix-hdr-display-output'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'Bing_Yanchi-codex/fix-hdr-display-output'
git switch 'Bing_Yanchi-codex/fix-hdr-display-output'
git rebase 'main'
git switch 'main'
git merge --ff-only 'Bing_Yanchi-codex/fix-hdr-display-output'
git switch 'Bing_Yanchi-codex/fix-hdr-display-output'
git rebase 'main'
git switch 'main'
git merge --no-ff 'Bing_Yanchi-codex/fix-hdr-display-output'
git switch 'main'
git merge --squash 'Bing_Yanchi-codex/fix-hdr-display-output'
git switch 'main'
git merge --ff-only 'Bing_Yanchi-codex/fix-hdr-display-output'
git switch 'main'
git merge 'Bing_Yanchi-codex/fix-hdr-display-output'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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
TrustNo1/Darner!157
No description provided.