[pr-feature][frame-generation][AMD] FSR 4 frame generation on an HDR10 output #113
Loading…
Reference in a new issue
No description provided.
Delete branch "dutchmega/Darner:fsr4-hdr-framegen"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.rsthen kept ordinary presents: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:
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.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).surface_formatalready maps R10G10B10A2.FG_HIGH_DYNAMIC_RANGEstays as it was: only for a float back buffer.How it was tested
--profile fastbuild of the first version of this change, which dropped the format check entirely. The current05a65fcallows only SDR and HDR10, so HDR10 takes the same path. Not run again on05a65fc.main(40ed13b).cargo clippy -p darner-gpu --all-targets --locked -- -D warnings: no warnings (on05a65fc).cargo clippy --workspace --all-targets --locked -- -D warnings: no warnings (gate 1, ond80420d, before the rebase).cargo xtask policy --staged: ok.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: no warnings (gate 2, ond9d7aac, before the rebase; it differs fromd80420donly in README.md).cargo test --workspace --locked --no-fail-fast(gate 3, ond9d7aac, same note): every test target passes except two lib test binaries, which crash withSTATUS_ACCESS_VIOLATION(0xc0000005):-p darner-gpu --lib: crashes the same way onmainon this PC.-p darner-shader --lib: this PR does not changedarner-shader, and the crate does not depend ondarner-gpu, so it is the same binary as onmain.DARNER_RELAY=2.mainwith other, unrelated changes, same PC and settings):only the donor's SDR swap-chain format is supported, and frame generation stayed off.format=24isDXGI_FORMAT_R10G10B10A2_UNORM(HDR10) andcolor_space=12isDXGI_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).fsr4falls back to AMD's default frame generation.DARNER_RELAY=0by 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. WithDARNER_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. WithDARNER_RELAY=0neither happens.Checklist
main.docs/asset-policy.md.Checked for overlap
crates/darner-gpu/src/streamline/fsr.rs.Contributor role (optional)
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.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.
[pr-feature][frame-generation][AMD] FSR 4 frame generation on an HDR10 output; README: the HDR brightness switchesto [pr-feature][frame-generation][AMD] FSR 4 frame generation on an HDR10 outputPR updated
d9d7aacd33to05a65fc9ae