[pr-feature][frame-generation][AMD] FSR 4 frame generation on an HDR10 output #113

Manually merged
TrustNo1 merged 1 commit from dutchmega/Darner:fsr4-hdr-framegen into main 2026-12-04 02:13:46 +00:00
Contributor

What it changes

HDR & FSR4 combined was not supported.

With FRAME GEN TYPE FSR 4 and HDR on, the swap chain is R10G10B10A2. crates/darner-gpu/src/streamline/fsr.rs then kept ordinary presents:

WARN darner_gpu::streamline::fsr: FSR 4 frame generation: only the donor's SDR swap-chain format is supported; using ordinary presents format=24

The check now takes HDR10 (R10G10B10A2_UNORM) as well as SDR (R8G8B8A8_UNORM). Other formats, such as a float (scRGB) back buffer, still get ordinary presents: they are not tested. Why I think HDR10 is safe:

  • AMD's FSR Frame Generation 4.0.2 documentation (Kits/FidelityFX/docs/techniques/frame-interpolation-ml.md, SDK v2.4.0) lists Windows 11, an RX 9000 card and Agility SDK 1.4.9+ as limitations. It does not mention HDR.
  • AMD's frame interpolation swap chain takes the transfer function from SetColorSpace1 (G2084_NONE_P2020 → PQ). darner already calls that. When the app sets no HDR metadata, it reads the monitor's luminance range itself (FrameInterpolationSwapchainDX12.cpp, SDK v2.4.0; that is the open 3.1 swap chain, the 4.0.0 one is closed).
  • The FSR 3 path never had this check. surface_format already maps R10G10B10A2.

FG_HIGH_DYNAMIC_RANGE stays as it was: only for a float back buffer.

How it was tested

  • Tested revision: the game run used a --profile fast build of the first version of this change, which dropped the format check entirely. The current 05a65fc allows only SDR and HDR10, so HDR10 takes the same path. Not run again on 05a65fc.
  • Rebased on main (40ed13b). cargo clippy -p darner-gpu --all-targets --locked -- -D warnings: no warnings (on 05a65fc).
  • Commands and results:
    • cargo clippy --workspace --all-targets --locked -- -D warnings: no warnings (gate 1, on d80420d, before the rebase).
    • cargo xtask policy --staged: ok.
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: no warnings (gate 2, on d9d7aac, before the rebase; it differs from d80420d only in README.md).
    • cargo test --workspace --locked --no-fail-fast (gate 3, on d9d7aac, same note): every test target passes except two lib test binaries, which crash with STATUS_ACCESS_VIOLATION (0xc0000005):
      • -p darner-gpu --lib: crashes the same way on main on this PC.
      • -p darner-shader --lib: this PR does not change darner-shader, and the crate does not depend on darner-gpu, so it is the same binary as on main.
  • Gameplay: AMD Radeon RX 9070, driver 26.11.2, display Alienware AW3424DWF, Series X profile, 2560x1440 output, FG TYPE FSR 4 (PC FSR 4.1.2 upscaler, performance scale), frame generation 2x, ray tracing off, HDR on (display reports 455 nits peak), DARNER_RELAY=2.
    • Before (a build of main with other, unrelated changes, same PC and settings): only the donor's SDR swap-chain format is supported, and frame generation stayed off.
    • After:
      FSR 4 frame generation: FidelityFX confirmed swap-chain provider 4.0.0
      swap chain color space set color_space=12 format=24 support=1 frame=1
      FSR 4 frame generation: FidelityFX confirmed generator provider 4.0.2
      FSR 3 frame generation: its context was made display=[2560, 1440] max_render=[1280, 720] format=24 hudless_format=24 flags=0x8
      FSR 4 frame generation: 212 presents with it on (212 with the colour without the interface), 0 off, 0 prepare dispatches failed
      
    • format=24 is DXGI_FORMAT_R10G10B10A2_UNORM (HDR10) and color_space=12 is DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 (PQ). The context line is the FidelityFX frame interpolation context, made on that HDR10 swap chain (the log says "FSR 3" because FSR 4 frame generation goes through the same code).
    • The picture is as bright with frame generation on as with it off. The HUD looked right with frame generation on. Colours were not checked separately. (HDR as a whole looked darker than SDR on this display; that is the HDR output, not this change.)
  • Coverage gaps:
    • Only RX 9070 (RDNA 4). Not tested on RDNA 2/3, where fsr4 falls back to AMD's default frame generation.
    • No float (scRGB) back buffer tested.
    • Note: on AMD, darner sets DARNER_RELAY=0 by default (AMD loss guard, play.rs). Without the relay, FSR frame generation does not start ("the line of submissions did not start"), with HDR or without. For this test the relay was set to 2. With DARNER_RELAY=2, this RX 9070 also has device hangs (0x887A0006). They also happen with SDR and without frame generation, so this change does not cause them. F3 also shows long SUBMISSION LOCK WAIT times with the relay. With DARNER_RELAY=0 neither happens.

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 (the README part, split off from this PR). Otherwise none found. Searched open and closed issues and PRs for "HDR", "FSR 4", "R10G10B10A2" and "frame generation AMD". No open PR changes crates/darner-gpu/src/streamline/fsr.rs.

Contributor role (optional)

  • Fluxer ID: 1575942915249680389
## What it changes HDR & FSR4 combined was not supported. With FRAME GEN TYPE FSR 4 and HDR on, the swap chain is R10G10B10A2. `crates/darner-gpu/src/streamline/fsr.rs` then kept ordinary presents: ``` WARN darner_gpu::streamline::fsr: FSR 4 frame generation: only the donor's SDR swap-chain format is supported; using ordinary presents format=24 ``` The check now takes HDR10 (R10G10B10A2_UNORM) as well as SDR (R8G8B8A8_UNORM). Other formats, such as a float (scRGB) back buffer, still get ordinary presents: they are not tested. Why I think HDR10 is safe: - AMD's FSR Frame Generation 4.0.2 documentation (`Kits/FidelityFX/docs/techniques/frame-interpolation-ml.md`, SDK v2.4.0) lists Windows 11, an RX 9000 card and Agility SDK 1.4.9+ as limitations. It does not mention HDR. - AMD's frame interpolation swap chain takes the transfer function from `SetColorSpace1` (`G2084_NONE_P2020` → PQ). darner already calls that. When the app sets no HDR metadata, it reads the monitor's luminance range itself (`FrameInterpolationSwapchainDX12.cpp`, SDK v2.4.0; that is the open 3.1 swap chain, the 4.0.0 one is closed). - The FSR 3 path never had this check. `surface_format` already maps R10G10B10A2. `FG_HIGH_DYNAMIC_RANGE` stays as it was: only for a float back buffer. ## How it was tested - Tested revision: the game run used a `--profile fast` build of the first version of this change, which dropped the format check entirely. The current `05a65fc` allows only SDR and HDR10, so HDR10 takes the same path. Not run again on `05a65fc`. - Rebased on `main` (`40ed13b`). `cargo clippy -p darner-gpu --all-targets --locked -- -D warnings`: no warnings (on `05a65fc`). - Commands and results: - `cargo clippy --workspace --all-targets --locked -- -D warnings`: no warnings (gate 1, on `d80420d`, before the rebase). - `cargo xtask policy --staged`: ok. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: no warnings (gate 2, on `d9d7aac`, before the rebase; it differs from `d80420d` only in README.md). - `cargo test --workspace --locked --no-fail-fast` (gate 3, on `d9d7aac`, same note): every test target passes except two lib test binaries, which crash with `STATUS_ACCESS_VIOLATION` (0xc0000005): - `-p darner-gpu --lib`: crashes the same way on `main` on this PC. - `-p darner-shader --lib`: this PR does not change `darner-shader`, and the crate does not depend on `darner-gpu`, so it is the same binary as on `main`. - Gameplay: AMD Radeon RX 9070, driver 26.11.2, display Alienware AW3424DWF, Series X profile, 2560x1440 output, FG TYPE FSR 4 (PC FSR 4.1.2 upscaler, performance scale), frame generation 2x, ray tracing off, HDR on (display reports 455 nits peak), `DARNER_RELAY=2`. - Before (a build of `main` with other, unrelated changes, same PC and settings): `only the donor's SDR swap-chain format is supported`, and frame generation stayed off. - After: ``` FSR 4 frame generation: FidelityFX confirmed swap-chain provider 4.0.0 swap chain color space set color_space=12 format=24 support=1 frame=1 FSR 4 frame generation: FidelityFX confirmed generator provider 4.0.2 FSR 3 frame generation: its context was made display=[2560, 1440] max_render=[1280, 720] format=24 hudless_format=24 flags=0x8 FSR 4 frame generation: 212 presents with it on (212 with the colour without the interface), 0 off, 0 prepare dispatches failed ``` - `format=24` is `DXGI_FORMAT_R10G10B10A2_UNORM` (HDR10) and `color_space=12` is `DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020` (PQ). The context line is the FidelityFX frame interpolation context, made on that HDR10 swap chain (the log says "FSR 3" because FSR 4 frame generation goes through the same code). - The picture is as bright with frame generation on as with it off. The HUD looked right with frame generation on. Colours were not checked separately. (HDR as a whole looked darker than SDR on this display; that is the HDR output, not this change.) - Coverage gaps: - Only RX 9070 (RDNA 4). Not tested on RDNA 2/3, where `fsr4` falls back to AMD's default frame generation. - No float (scRGB) back buffer tested. - Note: on AMD, darner sets `DARNER_RELAY=0` by default (AMD loss guard, `play.rs`). Without the relay, FSR frame generation does not start ("the line of submissions did not start"), with HDR or without. For this test the relay was set to 2. With `DARNER_RELAY=2`, this RX 9070 also has device hangs (0x887A0006). They also happen with SDR and without frame generation, so this change does not cause them. F3 also shows long SUBMISSION LOCK WAIT times with the relay. With `DARNER_RELAY=0` neither happens. ## 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 (the README part, split off from this PR). Otherwise none found. Searched open and closed issues and PRs for "HDR", "FSR 4", "R10G10B10A2" and "frame generation AMD". No open PR changes `crates/darner-gpu/src/streamline/fsr.rs`. ## Contributor role (optional) - Fluxer ID: 1575942915249680389
With FG TYPE FSR 4 and HDR on, the swap chain is R10G10B10A2 and fsr.rs
kept ordinary presents ("only the donor's SDR swap-chain format is
supported"). AMD's FSR Frame Generation 4.0.2 documentation lists no such
limit, its swap chain takes the PQ transfer function from SetColorSpace1,
and the monitor's luminance range when the app sets no HDR metadata
(FrameInterpolationSwapchainDX12.cpp in SDK v2.4.0, the 3.1 swap chain).

- crates/darner-gpu/src/streamline/fsr.rs: the check takes HDR10
  (R10G10B10A2_UNORM) besides SDR (R8G8B8A8_UNORM). Other formats, such
  as a float (scRGB) back buffer, keep ordinary presents as before: not
  tested. FG_HIGH_DYNAMIC_RANGE stays as it was: only for a float back
  buffer.

Seen on an RX 9070 with HDR on and DARNER_RELAY=2 (2026-12-03): swap-chain
provider 4.0.0 and generator 4.0.2 confirmed, context made with format=24,
"212 presents with it on, 0 off" after the first upscalings. The picture is
as bright with frame generation on as with it off.
Both are read in crates/darner-gpu/src/host/hdr.rs and were not documented.
The max nits is the peak the game is given (display.rs) and tunes its HDR
picture to; paper white is the brightness of the SDR parts on an HDR output.
Owner

Before merging: please split this into two PRs, one for the HDR10 frame generation change (fsr.rs) and one for the README text.

For the fsr.rs change, which card, driver and display did you test it on, with HDR10 on and FSR 4 frame generation running? Please include the play log line that says the FidelityFX frame-interpolation swap chain was made with an HDR10 format, and say whether the picture (brightness, colours, HUD) looked right with frame generation on.

Before merging: please split this into two PRs, one for the HDR10 frame generation change (fsr.rs) and one for the README text. For the fsr.rs change, which card, driver and display did you test it on, with HDR10 on and FSR 4 frame generation running? Please include the play log line that says the FidelityFX frame-interpolation swap chain was made with an HDR10 format, and say whether the picture (brightness, colours, HUD) looked right with frame generation on.
dutchmega changed title from [pr-feature][frame-generation][AMD] FSR 4 frame generation on an HDR10 output; README: the HDR brightness switches to [pr-feature][frame-generation][AMD] FSR 4 frame generation on an HDR10 output 2026-12-03 21:41:10 +00:00
Author
Contributor

PR updated

PR updated
dutchmega force-pushed fsr4-hdr-framegen from d9d7aacd33 to 05a65fc9ae 2026-12-03 22:39:13 +00:00 Compare
TrustNo1 manually merged commit 838fb926fe into main 2026-12-04 02:13:46 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 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
TrustNo1/Darner!113
No description provided.