fix(vk): preserve Native HDR HUD colors in FSR frame generation #2169

Merged
HumanBean merged 3 commits from futondestroyer/Longshot:codex/fsr-native-hdr-hud into main 2026-11-22 00:15:36 +00:00
Member

TL;DR

Preserve the HUD’s displayed colors in Native HDR with FSR 3.1 frame generation. The game-free regression fails before the fix and passes after it. Both matched Windows RTX 4070 comparisons passed, including the tested main and PR pins. The original RX 9070 XT and FSR 4 setup still needs confirmation.

Summary

In the Market, enable Native HDR, FSR 4 Native AA and FSR 3.1 frame generation. In the reported run, the minimap, hearts and item icons alternated between their ordinary colors and saturated red or dark colors while the scene was in motion. The generated-frame HUD path combined a linear game capture with the PQ-encoded picture presented to the display.

When a HUD copy is available, Native HDR now supplies already-presented PQ pixels to the existing FSR HUD mask. Marked pixels keep their displayed color, and the generated picture supplies the unmarked pixels. SDR and Expanded HDR keep their existing learned HUD layer. The first fitting pass after leaving Native HDR starts from a fresh capture pair. Start in gpu/vk/vk_framegen.cpp and tests/test_fsr3fi_hud_mask.py.

See #1896.

Testing

Tested:

  • Windows 11 with LLVM-MinGW. The source-backed regression fails with 334b6b52 on main cce3ded1 and passes at 0faee414. It covers opaque and translucent marked pixels, hidden and unmarked pixels, and the first learned fit after returning to sRGB. HUD capture and frame-generation resource checks also pass. The Windows candidate renderer linked and passed its export check.
  • Windows 11, RTX 4070, NVIDIA 621.01. Compared main cce3ded1 and this PR at 0faee414 with the same hashed Windows API 44 host. The candidate pack replaced only the Vulkan renderer. Both runs used the child Market checkpoint at 1280×720, FSR 3.1 Quality upscaling and 2× FSR 3.1 frame generation. Native HDR10 at 300-nit paper white and 1000-nit peak was followed by Expanded HDR. The counts below are from the last 600 settled presents in each phase. Both runs exited cleanly.
  • Windows 11, RTX 4070, NVIDIA 621.01. Compared the shipped Nightly 695 host and renderer (96caf2f2, build source stamp e78e3645) with that same host and the equivalent fix in its API 41 renderer (64a8e6b7). Ran the child Market checkpoint at 1280×720 with FSR 3.1 Quality upscaling and 2× FSR 3.1 frame generation, Native HDR10 at 300-nit paper white and 1000-nit peak, then switched to Expanded HDR. Each build made 600 FSR frames with the HUD marked in the sampled Native window. Stock used the learned HUD layer on all 600. The fixed renderer skipped it on all 600, then used it on all 600 in the settled Expanded window after the SDK reset its input history to sRGB. Both runs exited cleanly. This comparison exercises the shared frame-generation path on a linear RGBA16F capture. Its upscaler and GPU differ from those in the original report.
  • Both exact PR pins pass the existing HUD layer and HUD-less color math and embedded shader checks when run directly. The strict shader checks require glslangValidator, which is unavailable on this PC. test_hdr_encode.py and test_psychov35_fsr3_fg.py have the same failures on both pins. Full suite coverage remains open.
  • Main advanced to dd5ffe6a after this comparison started. Git merged the tested change cleanly with that revision. The intervening changes update FSR 4 shader preparation, the startup screen, crash-report privacy, and VI diagnostic logging. The gameplay results below retain their cce3ded1 and 0faee414 pins.

Still to test:

  • Revisit the Market on Windows with an RX 9070 XT and AMD driver 26.11.2 at 4K 120 Hz. Set Native HDR with 300-nit paper white and 1000-nit peak, FSR 4 Native AA and FSR 3.1 Auto. Verify that generated pictures preserve the HUD colors during motion. Check translucent edges and Toggle HUD by hand on a matching HDR display.
  • Verify the Linux build and UTF-8 paths and repeat the HDR HUD check by hand on desktop NVIDIA and AMD RADV, and on an HDR-capable Steam Deck setup. Check SDR frame generation and HUD visibility where HDR output is unavailable.

Measurements

Verdict: The marked-pixel regression passes with the fix. Both runs generated the same number of FSR and HUD-marked frames in settled samples. Native HDR dropped the linear learned layer and Expanded HDR resumed it after the color-history reset.

Setup: Windows 11, RTX 4070, NVIDIA 621.01 and LLVM-MinGW. The game counters come from the matched API 44 Market runs above. The test-only commit 334b6b52 runs the regression on main’s production code. It exercises the source routing, the HUD mask expression and the patched FSR static-pixel rule.

Check Before: main @ cce3ded1 After: this PR @ 0faee414
Presented PQ color for opaque and translucent marked pixels Fails Native input routing assertion Passes
Unmarked pixels and first learned fit after leaving Native Fixture stops at the input routing assertion Passes
Native HDR FSR 3.1 generated / HUD-marked / learned-layer presents 600 / 600 / 600 600 / 600 / 0
Expanded HDR FSR 3.1 generated / HUD-marked / learned-layer presents 600 / 600 / 600 600 / 600 / 600

Risks

Native HDR keeps the fully composited source pixel at a marked translucent edge. In motion, that can retain part of the source frame’s background. SDR and Expanded HDR still use the existing transparency fit. The change requires no save, options, or cache migration.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Screenshots of the same spot on main and here, for a change that shows on screen.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## TL;DR Preserve the HUD’s displayed colors in Native HDR with FSR 3.1 frame generation. The game-free regression fails before the fix and passes after it. Both matched Windows RTX 4070 comparisons passed, including the tested main and PR pins. The original RX 9070 XT and FSR 4 setup still needs confirmation. ## Summary In the Market, enable Native HDR, FSR 4 Native AA and FSR 3.1 frame generation. In the reported run, the minimap, hearts and item icons alternated between their ordinary colors and saturated red or dark colors while the scene was in motion. The generated-frame HUD path combined a linear game capture with the PQ-encoded picture presented to the display. When a HUD copy is available, Native HDR now supplies already-presented PQ pixels to the existing FSR HUD mask. Marked pixels keep their displayed color, and the generated picture supplies the unmarked pixels. SDR and Expanded HDR keep their existing learned HUD layer. The first fitting pass after leaving Native HDR starts from a fresh capture pair. Start in `gpu/vk/vk_framegen.cpp` and `tests/test_fsr3fi_hud_mask.py`. See #1896. ## Testing **Tested:** - Windows 11 with LLVM-MinGW. The source-backed regression fails with `334b6b52` on main `cce3ded1` and passes at `0faee414`. It covers opaque and translucent marked pixels, hidden and unmarked pixels, and the first learned fit after returning to sRGB. HUD capture and frame-generation resource checks also pass. The Windows candidate renderer linked and passed its export check. - Windows 11, RTX 4070, NVIDIA 621.01. Compared main `cce3ded1` and this PR at `0faee414` with the same hashed Windows API 44 host. The candidate pack replaced only the Vulkan renderer. Both runs used the child Market checkpoint at 1280×720, FSR 3.1 Quality upscaling and 2× FSR 3.1 frame generation. Native HDR10 at 300-nit paper white and 1000-nit peak was followed by Expanded HDR. The counts below are from the last 600 settled presents in each phase. Both runs exited cleanly. - Windows 11, RTX 4070, NVIDIA 621.01. Compared the shipped Nightly 695 host and renderer (`96caf2f2`, build source stamp `e78e3645`) with that same host and the equivalent fix in its API 41 renderer (`64a8e6b7`). Ran the child Market checkpoint at 1280×720 with FSR 3.1 Quality upscaling and 2× FSR 3.1 frame generation, Native HDR10 at 300-nit paper white and 1000-nit peak, then switched to Expanded HDR. Each build made 600 FSR frames with the HUD marked in the sampled Native window. Stock used the learned HUD layer on all 600. The fixed renderer skipped it on all 600, then used it on all 600 in the settled Expanded window after the SDK reset its input history to sRGB. Both runs exited cleanly. This comparison exercises the shared frame-generation path on a linear RGBA16F capture. Its upscaler and GPU differ from those in the original report. - Both exact PR pins pass the existing HUD layer and HUD-less color math and embedded shader checks when run directly. The strict shader checks require `glslangValidator`, which is unavailable on this PC. `test_hdr_encode.py` and `test_psychov35_fsr3_fg.py` have the same failures on both pins. Full suite coverage remains open. - Main advanced to `dd5ffe6a` after this comparison started. Git merged the tested change cleanly with that revision. The intervening changes update FSR 4 shader preparation, the startup screen, crash-report privacy, and VI diagnostic logging. The gameplay results below retain their `cce3ded1` and `0faee414` pins. **Still to test:** - Revisit the Market on Windows with an RX 9070 XT and AMD driver 26.11.2 at 4K 120 Hz. Set Native HDR with 300-nit paper white and 1000-nit peak, FSR 4 Native AA and FSR 3.1 Auto. Verify that generated pictures preserve the HUD colors during motion. Check translucent edges and Toggle HUD by hand on a matching HDR display. - Verify the Linux build and UTF-8 paths and repeat the HDR HUD check by hand on desktop NVIDIA and AMD RADV, and on an HDR-capable Steam Deck setup. Check SDR frame generation and HUD visibility where HDR output is unavailable. ## Measurements **Verdict:** The marked-pixel regression passes with the fix. Both runs generated the same number of FSR and HUD-marked frames in settled samples. Native HDR dropped the linear learned layer and Expanded HDR resumed it after the color-history reset. **Setup:** Windows 11, RTX 4070, NVIDIA 621.01 and LLVM-MinGW. The game counters come from the matched API 44 Market runs above. The test-only commit `334b6b52` runs the regression on main’s production code. It exercises the source routing, the HUD mask expression and the patched FSR static-pixel rule. | Check | Before: main @ `cce3ded1` | After: this PR @ `0faee414` | | --- | --- | --- | | Presented PQ color for opaque and translucent marked pixels | Fails Native input routing assertion | Passes | | Unmarked pixels and first learned fit after leaving Native | Fixture stops at the input routing assertion | Passes | | Native HDR FSR 3.1 generated / HUD-marked / learned-layer presents | 600 / 600 / 600 | 600 / 600 / 0 | | Expanded HDR FSR 3.1 generated / HUD-marked / learned-layer presents | 600 / 600 / 600 | 600 / 600 / 600 | ## Risks Native HDR keeps the fully composited source pixel at a marked translucent edge. In motion, that can retain part of the source frame’s background. SDR and Expanded HDR still use the existing transparency fit. The change requires no save, options, or cache migration. ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
Assisted-by: Codex (GPT-6.2 Sol)
fix(vk): preserve presented PQ HUD colors in FSR frame generation
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 19s
CI / Conventional Commit title (pull_request) Successful in 18s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Workflow lint (actionlint) (pull_request) Successful in 23s
Third-party parts / As their notes say (pull_request) Successful in 26s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 1m3s
CI / Website build and checks (pull_request) Failing after 1m29s
0faee4149d
Use the existing HUD mask when the game presents Native HDR. Its pre-encode HUD capture is unsuitable as an encoded interpolation input or for compositing a linear layer. Forget its pair before the next SDR or Expanded layer fit.

Assisted-by: Codex (GPT-6.2 Sol)
Author
Member

Tested in game: Windows 11, RTX 4070 (NVIDIA 621.01), Market_Child, 1280×720 HDR10, FSR 3.1 Quality and 2× FSR 3.1 frame generation. Verified main cce3ded1 vs this head 0faee414 with the same API 44 host, and stock Nightly 695 96caf2f2 vs the equivalent API 41 renderer 64a8e6b7 on the same Nightly host. In both comparisons the candidate kept 600 FSR-generated and HUD-marked frames in the settled Native sample, with 0 learned HUD layers versus 600 on stock. Expanded HDR reset FSR history to sRGB and used 600 learned layers on both sides. All four runs exited cleanly. The RX 9070 XT and FSR 4 Native AA setup in #1896 remains to test.

Tested in game: Windows 11, RTX 4070 (NVIDIA 621.01), Market_Child, 1280×720 HDR10, FSR 3.1 Quality and 2× FSR 3.1 frame generation. Verified main cce3ded1 vs this head 0faee414 with the same API 44 host, and stock Nightly 695 96caf2f2 vs the equivalent API 41 renderer 64a8e6b7 on the same Nightly host. In both comparisons the candidate kept 600 FSR-generated and HUD-marked frames in the settled Native sample, with 0 learned HUD layers versus 600 on stock. Expanded HDR reset FSR history to sRGB and used 600 learned layers on both sides. All four runs exited cleanly. The RX 9070 XT and FSR 4 Native AA setup in #1896 remains to test.
Member
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The Native HDR path has a game-free regression test, but its visual result on the reported AMD setup remains unproven. The change also leaves the HUD-handling reference and switch description inaccurate. Recommend approval; not approved on the forge.

Native HDR frame generation uses the presented PQ pixels at HUD marks instead of compositing a learned layer from linear captures. This avoids mixing color encodings, at the cost of retaining the real frame’s background at translucent HUD pixels.

@fix will do (2)

  1. L1 gpu/vk/vk_framegen.cpp:1397: Native HDR now ignores the HUD-less and learned-layer switches, but gpu/vk/switches.def and docs/dev/reference/upscalers.md still say the HUD-less copy and learned layer are used by default without that exception. (more on the line)
  2. L2 (minor) tests/test_fsr3fi_hud_mask.py:395: The new pixel fixture reads the shader and shader patches from ROOT even when --source selects another checkout for the production C++ code. (more on the line)

Before merging: testing (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3 (minor) gpu/vk/vk_framegen.cpp:1492: The reported RX 9070 XT, FSR 4 Native AA and HDR setup has not been checked visually. (more on the line)
  • L4 (minor) gpu/vk/vk_framegen.cpp:1555: The changed frame-generation path has not been checked in gameplay on Linux NVIDIA, AMD RADV or an HDR-capable Steam Deck. (more on the line)

Checks: Failing on this head, which is behind its base, where they pass: Guide screenshots / Guide images and local UI source review (pull_request), CI / Website build and checks (pull_request). @rebase (or @fix) brings it up to date and runs them again; not held against it.

More: does it help, other systems, switches, what was read

Does it help: Unproven in the reported setup. The source-backed test fails on main and passes on the PR; matched RTX 4070 runs report 600 generated and HUD-marked presents on each side, with learned-layer use changing from 600 to 0 in Native HDR. Those counts do not establish that the visible color flicker is gone or assess translucent edges.

Other systems: The routing affects FSR 3.1 frame generation in Native HDR on all supported GPUs and operating systems. SDR and Expanded HDR retain the learned path, but transitions back to it need coverage. Windows RTX 4070 counters and the fixture cover part of this; AMD, Linux and Steam Deck gameplay remain unverified.

Switches: RX_VK_FSR_FG_HUDLESS remains on by default but is now bypassed in Native HDR; its switch-table description and the upscaler reference do not describe that exception. RX_VK_FSR_FG_HUD_LAYER also no longer applies in Native HDR. The default’s visual result remains to be verified.

Reviewed: 0faee4149d against cce3ded1a3: Read the diff, both changed files and the relevant HUD capture, mask, layer, shader-patch and FSR input paths; read AGENTS.md, CONTRIBUTING.md, the PR template and the applicable standards. Skimmed related references and tests. No recorded runs or generated files were changed. The adjacent Tooling AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review).

Checked and fine:

  • Both commits record AI assistance; the diff contains no game-derived files, generated shader changes, API changes or third-party edits.
  • The Native-to-sRGB fixture checks that the first subsequent layer fit has no previous capture.
  • The FSR backend resets its color history when PQ encoding or HUD-less mode changes.

Testing: Read-only review; no builds, scripts or tests were run. The PR reports a Windows renderer build and fixture runs, while Linux build and visual coverage remain open.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The Native HDR path has a game-free regression test, but its visual result on the reported AMD setup remains unproven. The change also leaves the HUD-handling reference and switch description inaccurate. Recommend approval; not approved on the forge. Native HDR frame generation uses the presented PQ pixels at HUD marks instead of compositing a learned layer from linear captures. This avoids mixing color encodings, at the cost of retaining the real frame’s background at translucent HUD pixels. **`@fix` will do (2)** 1. **L1** `gpu/vk/vk_framegen.cpp:1397`: Native HDR now ignores the HUD-less and learned-layer switches, but gpu/vk/switches.def and docs/dev/reference/upscalers.md still say the HUD-less copy and learned layer are used by default without that exception. (more on the line) 2. **L2** (minor) `tests/test_fsr3fi_hud_mask.py:395`: The new pixel fixture reads the shader and shader patches from ROOT even when --source selects another checkout for the production C++ code. (more on the line) **Before merging: testing (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** (minor) `gpu/vk/vk_framegen.cpp:1492`: The reported RX 9070 XT, FSR 4 Native AA and HDR setup has not been checked visually. (more on the line) - **L4** (minor) `gpu/vk/vk_framegen.cpp:1555`: The changed frame-generation path has not been checked in gameplay on Linux NVIDIA, AMD RADV or an HDR-capable Steam Deck. (more on the line) **Checks:** Failing on this head, which is behind its base, where they pass: `Guide screenshots / Guide images and local UI source review (pull_request)`, `CI / Website build and checks (pull_request)`. `@rebase` (or `@fix`) brings it up to date and runs them again; not held against it. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven in the reported setup. The source-backed test fails on main and passes on the PR; matched RTX 4070 runs report 600 generated and HUD-marked presents on each side, with learned-layer use changing from 600 to 0 in Native HDR. Those counts do not establish that the visible color flicker is gone or assess translucent edges. **Other systems:** The routing affects FSR 3.1 frame generation in Native HDR on all supported GPUs and operating systems. SDR and Expanded HDR retain the learned path, but transitions back to it need coverage. Windows RTX 4070 counters and the fixture cover part of this; AMD, Linux and Steam Deck gameplay remain unverified. **Switches:** RX_VK_FSR_FG_HUDLESS remains on by default but is now bypassed in Native HDR; its switch-table description and the upscaler reference do not describe that exception. RX_VK_FSR_FG_HUD_LAYER also no longer applies in Native HDR. The default’s visual result remains to be verified. **Reviewed:** 0faee4149d4d against cce3ded1a326: Read the diff, both changed files and the relevant HUD capture, mask, layer, shader-patch and FSR input paths; read AGENTS.md, CONTRIBUTING.md, the PR template and the applicable standards. Skimmed related references and tests. No recorded runs or generated files were changed. The adjacent Tooling AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review). **Checked and fine:** - Both commits record AI assistance; the diff contains no game-derived files, generated shader changes, API changes or third-party edits. - The Native-to-sRGB fixture checks that the first subsequent layer fit has no previous capture. - The FSR backend resets its color history when PQ encoding or HUD-less mode changes. **Testing:** Read-only review; no builds, scripts or tests were run. The PR reports a Windows renderer build and fixture runs, while Linux build and visual coverage remain open. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -1395,0 +1394,4 @@
bool hudless_wanted(bool native_pq) {
// The game captures the HUD's linear target before its HDR encode. Treating that colour as PQ
// corrupts both the HUD-less input and the learned layer. Use the mask with the game's PQ present.
if (native_pq) return false;
Member

L1: Native HDR now ignores the HUD-less and learned-layer switches, but gpu/vk/switches.def and docs/dev/reference/upscalers.md still say the HUD-less copy and learned layer are used by default without that exception. Update both descriptions so developers can correctly interpret an A/B run.

**L1**: Native HDR now ignores the HUD-less and learned-layer switches, but gpu/vk/switches.def and docs/dev/reference/upscalers.md still say the HUD-less copy and learned layer are used by default without that exception. Update both descriptions so developers can correctly interpret an A/B run.
@ -1489,3 +1492,1 @@
hud.layered = hud_layer(cmd, x0, y0, w, h);
// (this frame's pictures are the next one's frame before; the next copies go into the other pair)
hud.prev = true;
hud.layered = hudless_wanted(pq) && hud_layer(cmd, x0, y0, w, h);
Member

L3 (minor): The reported RX 9070 XT, FSR 4 Native AA and HDR setup has not been checked visually. Compare main and this head during Market motion, including translucent edges and HUD visibility, to establish that the reported color flicker is fixed and assess the retained background.

**L3** (minor): The reported RX 9070 XT, FSR 4 Native AA and HDR setup has not been checked visually. Compare main and this head during Market motion, including translucent edges and HUD visibility, to establish that the reported color flicker is fixed and assess the retained background.
@ -1550,3 +1553,3 @@
in.color = fg.frames[cur].view;
in.color_image = fg.frames[cur].image;
const bool hudless = hudless_wanted();
const bool hudless = hudless_wanted(native_pq);
Member

L4 (minor): The changed frame-generation path has not been checked in gameplay on Linux NVIDIA, AMD RADV or an HDR-capable Steam Deck. Exercise Native HDR where available, SDR HUD visibility, and the transition back to Expanded HDR or SDR; compare the visible HUD and translucent edges.

**L4** (minor): The changed frame-generation path has not been checked in gameplay on Linux NVIDIA, AMD RADV or an HDR-capable Steam Deck. Exercise Native HDR where available, SDR HUD visibility, and the transition back to Expanded HDR or SDR; compare the visible HUD and translucent edges.
@ -335,0 +392,4 @@
def pixel_fixture():
# Use the actual mask expression and the patched FSR shader that consumes it.
shader = (ROOT / "gpu/vk/shaders/fg_hud.comp").read_text(encoding="utf-8")
alpha = re.search(r"imageStore\(dst, g, vec4\(shown, (.*?)\)\);", shader)[1]
Member

L2 (minor): The new pixel fixture reads the shader and shader patches from ROOT even when --source selects another checkout for the production C++ code. Comparing a different source tree can therefore pass using this checkout’s mask and FSR rules rather than those being tested. Pass the selected source directory into pixel_fixture and read both files from it.

**L2** (minor): The new pixel fixture reads the shader and shader patches from ROOT even when --source selects another checkout for the production C++ code. Comparing a different source tree can therefore pass using this checkout’s mask and FSR rules rather than those being tested. Pass the selected source directory into pixel_fixture and read both files from it.
Member
@fix
BeanBot force-pushed codex/fsr-native-hdr-hud from 0faee4149d
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 19s
CI / Conventional Commit title (pull_request) Successful in 18s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Workflow lint (actionlint) (pull_request) Successful in 23s
Third-party parts / As their notes say (pull_request) Successful in 26s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 1m3s
CI / Website build and checks (pull_request) Failing after 1m29s
to da3928c97b
Some checks failed
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 21s
Third-party parts / As their notes say (pull_request) Successful in 25s
CI / Website build and checks (pull_request) Failing after 24s
PR description / Description follows the template (pull_request_target) Failing after 6s
2026-11-22 00:13:34 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The regression fixture and Windows runs support the routing change, but the reported AMD setup and affected Linux systems still need visual gameplay checks. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is da3928c97b. I rebased it onto main (dd5ffe6a29). I edited its description to match the change.

Changed

  • Native HDR switch descriptions: Updated gpu/vk/switches.def:452 and docs/dev/reference/upscalers.md:247 to describe the Native HDR exceptions and marked-frame fallback.
  • Selected source for pixel fixture: Updated tests/test_fsr3fi_hud_mask.py:392 to read the shader and patches from the selected source directory. Tests were not run, as requested.

Nothing was built or run: the checks run again on the new head.

Native HDR frame generation uses presented PQ pixels for marked HUD pixels instead of fitting a layer from linear captures. This avoids mixing color encodings, at the cost of retaining some source-frame background at translucent HUD edges.

Before merging: testing (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3 (minor) gpu/vk/vk_framegen.cpp:1492: The reported RX 9070 XT, FSR 4 Native AA and HDR setup has not been checked visually. Compare main and this head during Market motion, including translucent edges and HUD visibility, to establish that the reported color flicker is fixed and assess the retained background.
  • L4 (minor) gpu/vk/vk_framegen.cpp:1555: The changed frame-generation path has not been checked in gameplay on Linux NVIDIA, AMD RADV or an HDR-capable Steam Deck. Exercise Native HDR where available, SDR HUD visibility, and the transition back to Expanded HDR or SDR; compare the visible HUD and translucent edges.

Checks: they run again on this head (Guide screenshots / Guide images and local UI source review (pull_request), CI / Website build and checks (pull_request) failed on the last one); a failure shows on the pull request.

Also noticed (1; not asked for, not blocking)
  • The Linux build and UTF-8 path check, same-spot screenshots, full suite and CI results remain outstanding.
More: does it help, other systems, switches, what was read

Does it help: Unproven for the reported visual bug. The source-backed regression reportedly fails on main and passes on the PR; matched Windows RTX 4070 runs recorded 600 HUD-marked frames in each settled Native HDR sample, with learned-layer use falling from 600 to 0. The original RX 9070 XT and FSR 4 setup has not been checked visually.

Other systems: SDR and Expanded HDR retain the learned layer, and the Windows run reports 600 learned-layer presents after returning to Expanded HDR. Linux NVIDIA, AMD RADV and an HDR-capable Steam Deck still need gameplay coverage, including HUD visibility and transitions.

Switches: RX_VK_FSR_FG_HUDLESS and RX_VK_FSR_FG_HUD_LAYER remain on by default; Native HDR now bypasses their learned-layer behavior when a HUD copy is available. Their descriptions and the upscaler reference document the exception.

Reviewed: da3928c97b against dd5ffe6a29: Read the repository rules and PR template, the HUD fixture and relevant frame-generation code, switch descriptions and upscaler reference. Skimmed the base-to-head diff and commits; the diff also includes intervening main-branch changes. Did not read every changed file in full. The referenced Tooling rules were not available in the checkout.; nothing run (a code review).

Checked and fine:

  • The Native HDR path selects the marked presented frame when a HUD copy is ready and clears the previous-pair flag before a later learned fit.
  • The pixel fixture reads the shader and patch definitions from the selected source directory.
  • The updated switch descriptions identify the Native HDR exception.

Testing: No commands that build or run tests were executed. The author reports the game-free regression and Windows renderer build passed; CI has not yet run on this head.

Overlaps and merge order: none found


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The regression fixture and Windows runs support the routing change, but the reported AMD setup and affected Linux systems still need visual gameplay checks. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is da3928c97b6d. I rebased it onto `main` (dd5ffe6a2907). I edited its description to match the change. **Changed** - **Native HDR switch descriptions**: Updated gpu/vk/switches.def:452 and docs/dev/reference/upscalers.md:247 to describe the Native HDR exceptions and marked-frame fallback. - **Selected source for pixel fixture**: Updated tests/test_fsr3fi_hud_mask.py:392 to read the shader and patches from the selected source directory. Tests were not run, as requested. Nothing was built or run: the checks run again on the new head. Native HDR frame generation uses presented PQ pixels for marked HUD pixels instead of fitting a layer from linear captures. This avoids mixing color encodings, at the cost of retaining some source-frame background at translucent HUD edges. **Before merging: testing (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** (minor) `gpu/vk/vk_framegen.cpp:1492`: The reported RX 9070 XT, FSR 4 Native AA and HDR setup has not been checked visually. Compare main and this head during Market motion, including translucent edges and HUD visibility, to establish that the reported color flicker is fixed and assess the retained background. - **L4** (minor) `gpu/vk/vk_framegen.cpp:1555`: The changed frame-generation path has not been checked in gameplay on Linux NVIDIA, AMD RADV or an HDR-capable Steam Deck. Exercise Native HDR where available, SDR HUD visibility, and the transition back to Expanded HDR or SDR; compare the visible HUD and translucent edges. **Checks:** they run again on this head (`Guide screenshots / Guide images and local UI source review (pull_request)`, `CI / Website build and checks (pull_request)` failed on the last one); a failure shows on the pull request. <details> <summary>Also noticed (1; not asked for, not blocking)</summary> - The Linux build and UTF-8 path check, same-spot screenshots, full suite and CI results remain outstanding. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the reported visual bug. The source-backed regression reportedly fails on main and passes on the PR; matched Windows RTX 4070 runs recorded 600 HUD-marked frames in each settled Native HDR sample, with learned-layer use falling from 600 to 0. The original RX 9070 XT and FSR 4 setup has not been checked visually. **Other systems:** SDR and Expanded HDR retain the learned layer, and the Windows run reports 600 learned-layer presents after returning to Expanded HDR. Linux NVIDIA, AMD RADV and an HDR-capable Steam Deck still need gameplay coverage, including HUD visibility and transitions. **Switches:** RX_VK_FSR_FG_HUDLESS and RX_VK_FSR_FG_HUD_LAYER remain on by default; Native HDR now bypasses their learned-layer behavior when a HUD copy is available. Their descriptions and the upscaler reference document the exception. **Reviewed:** da3928c97b6d against dd5ffe6a2907: Read the repository rules and PR template, the HUD fixture and relevant frame-generation code, switch descriptions and upscaler reference. Skimmed the base-to-head diff and commits; the diff also includes intervening main-branch changes. Did not read every changed file in full. The referenced Tooling rules were not available in the checkout.; nothing run (a code review). **Checked and fine:** - The Native HDR path selects the marked presented frame when a HUD copy is ready and clears the previous-pair flag before a later learned fit. - The pixel fixture reads the shader and patch definitions from the selected source directory. - The updated switch descriptions identify the Native HDR exception. **Testing:** No commands that build or run tests were executed. The author reports the game-free regression and Windows renderer build passed; CI has not yet run on this head. **Overlaps and merge order:** none found </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
HumanBean changed title from WIP: fix(vk): preserve Native HDR HUD colors in FSR frame generation to fix(vk): preserve Native HDR HUD colors in FSR frame generation 2026-11-22 00:15:25 +00:00
HumanBean deleted branch codex/fsr-native-hdr-hud 2026-11-22 00:15:36 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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
MagicBeanDev/Longshot!2169
No description provided.