fidelityfx: switches for the upscaler's own exposure and its pre-exposure #442

Manually merged
github merged 2 commits from github-bot/gh-442 into gh-pr/442/base 2026-12-04 19:38:01 +00:00 AGit
Owner

@⁠TreXito on GitHub · 2026-12-04 04:28 UTC · original
TreXito:pr/fsr4-exposure → main · +67 −0 · 2 files · 2 commits · merged 2026-12-04 19:36 UTC

Two opt-in switches for the host upscaler. Nothing changes unless they are set.

  • VICTORY_FSR_AUTO_EXPOSURE=0: the upscaler is made without its own exposure. The title creates it with flags 0x29 (HDR, inverted depth, own exposure).
  • VICTORY_FSR_PRE_EXPOSURE=<value>: the pre-exposure each upscaling tells the host, in place of the title's 1. The upscaler divides its input by it and multiplies its output by it again, so the picture keeps its level.
  • The first-dispatch log line now also shows the pre-exposure and the creation flags.

Why

On an RX 7800 XT, FSR 4's INT8 build made the shade about half as bright as without FSR, or with FSR 3.1 on the same inputs. Sunlit surfaces and sky barely changed. Without the upscaler's own exposure, the shade came back to 80-90%. A pre-exposure of 0.25 on top brought it level with no FSR, which points at the INT8 path losing precision on dark values.

Mean grey (0-255) of four regions of the same spawn view, newest save, ray tracing off, 2560x1440 output:

sky porch ceiling wall floor
no FSR 148.0 21.9 15.7 21.2
FSR 3.1 144.3 22.1 17.6 22.7
FSR 4 140.5 10.3 5.7 8.8
FSR 4, AUTO_EXPOSURE=0 141.1 16.8 13.7 19.6
FSR 4, AUTO_EXPOSURE=0, PRE_EXPOSURE=0.25 138.5 22.0 16.3 21.7

The camera spawns a few degrees apart between runs, so the sky moves by about 3%.

Cost

Release, 300 s standing, two runs per side (ABAB), i5-13600KF, RX 7800 XT, VICTORY_OUTPUT=2560x1440 with VICTORY_FSR_4K=quality (1706x960 to 1440p) and both switches, against no FSR: 25.50 fps vs 26.71 (-4.5%), p10 22.2 vs 23.1, no crashes. It also ran with VICTORY_FRAME_GEN=1 and VICTORY_UI_PLANE=3840x2160.

FSR 4 on RDNA 3 depends on the Wine runtime

Wine loads its own builtin amdxc64.dll, not the copy setup.sh fsr4 puts in system32. GE-Proton10-34's builtin checks for wave-matrix support and logs FSR4 not supported on this system! on RDNA 3, so the upscaler stays at 3.1.6. Valve's experimental_11.0 bridge (auto-enable on Navi 3x, September 2026) upgrades with FSR4_UPGRADE=1 and logs Replaced FSR3 with FSR4! under WINEDEBUG=warn+amdxc; the provider then reports 4.1.1.

Not checked

RDNA 4 (FP8): whether its shade changes with the upscaler's own exposure is not known, so both switches stay off by default.

Checked

  • Diagnostics build without warnings; cargo fmt --check clean for the changed file.
  • A run of this branch (main plus the switches) with both set logs pre_exposure=0.25 flags=0x9 and gives 146.2 / 22.0 / 16.4 / 21.6 in the table's regions.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNCfbX5dPKJzSkgbf16GX4

**@⁠TreXito** on GitHub · 2026-12-04 04:28 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/442) `TreXito:pr/fsr4-exposure` → `main` · +67 −0 · 2 files · 2 commits · merged 2026-12-04 19:36 UTC Two opt-in switches for the host upscaler. Nothing changes unless they are set. - `VICTORY_FSR_AUTO_EXPOSURE=0`: the upscaler is made without its own exposure. The title creates it with flags `0x29` (HDR, inverted depth, own exposure). - `VICTORY_FSR_PRE_EXPOSURE=<value>`: the pre-exposure each upscaling tells the host, in place of the title's 1. The upscaler divides its input by it and multiplies its output by it again, so the picture keeps its level. - The first-dispatch log line now also shows the pre-exposure and the creation flags. ### Why On an RX 7800 XT, FSR 4's INT8 build made the shade about half as bright as without FSR, or with FSR 3.1 on the same inputs. Sunlit surfaces and sky barely changed. Without the upscaler's own exposure, the shade came back to 80-90%. A pre-exposure of 0.25 on top brought it level with no FSR, which points at the INT8 path losing precision on dark values. Mean grey (0-255) of four regions of the same spawn view, newest save, ray tracing off, 2560x1440 output: | | sky | porch ceiling | wall | floor | |---|---:|---:|---:|---:| | no FSR | 148.0 | 21.9 | 15.7 | 21.2 | | FSR 3.1 | 144.3 | 22.1 | 17.6 | 22.7 | | FSR 4 | 140.5 | 10.3 | 5.7 | 8.8 | | FSR 4, `AUTO_EXPOSURE=0` | 141.1 | 16.8 | 13.7 | 19.6 | | FSR 4, `AUTO_EXPOSURE=0`, `PRE_EXPOSURE=0.25` | 138.5 | 22.0 | 16.3 | 21.7 | The camera spawns a few degrees apart between runs, so the sky moves by about 3%. ### Cost Release, 300 s standing, two runs per side (ABAB), i5-13600KF, RX 7800 XT, `VICTORY_OUTPUT=2560x1440` with `VICTORY_FSR_4K=quality` (1706x960 to 1440p) and both switches, against no FSR: 25.50 fps vs 26.71 (-4.5%), p10 22.2 vs 23.1, no crashes. It also ran with `VICTORY_FRAME_GEN=1` and `VICTORY_UI_PLANE=3840x2160`. ### FSR 4 on RDNA 3 depends on the Wine runtime Wine loads its own builtin `amdxc64.dll`, not the copy `setup.sh fsr4` puts in `system32`. GE-Proton10-34's builtin checks for wave-matrix support and logs `FSR4 not supported on this system!` on RDNA 3, so the upscaler stays at 3.1.6. Valve's `experimental_11.0` bridge (auto-enable on Navi 3x, September 2026) upgrades with `FSR4_UPGRADE=1` and logs `Replaced FSR3 with FSR4!` under `WINEDEBUG=warn+amdxc`; the provider then reports 4.1.1. ### Not checked RDNA 4 (FP8): whether its shade changes with the upscaler's own exposure is not known, so both switches stay off by default. ### Checked - Diagnostics build without warnings; `cargo fmt --check` clean for the changed file. - A run of this branch (main plus the switches) with both set logs `pre_exposure=0.25 flags=0x9` and gives 146.2 / 22.0 / 16.4 / 21.6 in the table's regions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WNCfbX5dPKJzSkgbf16GX4
FSR 4's INT8 build (RDNA 3) made the shade about half as bright as
without FSR. VICTORY_FSR_AUTO_EXPOSURE=0 makes the host upscaler without
the exposure of its own the title asks for (80-90% of the shade back);
VICTORY_FSR_PRE_EXPOSURE=0.25 on top brings it level. Both off by
default. The first-dispatch log shows the pre-exposure and flags.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNCfbX5dPKJzSkgbf16GX4
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 04:29:51 +00:00
Author
Owner

@⁠WillyBrown69 on GitHub · 2026-12-04 08:27 UTC · original

This fixes #350 for me, thank you

**@⁠WillyBrown69** on GitHub · 2026-12-04 08:27 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/442#issuecomment-7405969783) This fixes #350 for me, thank you
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 11:28 UTC · original

Clean and small, and the index is right: settings[3] at crates/victory-hle/src/modules/fidelityfx.rs:760 is pre_exposure per the test's named struct (crates/victory-hle/tests/fidelityfx.rs:96-120), [4] is reset, the 0x1b0 size assertion is untouched. The mask also lands on the copy that is kept (:463-465 before :531), so the first-dispatch log shows the masked 0x9 rather than the title's original, and clearing bit 0x20 cannot change which dispatches the frame generator treats as temporal (framegen.rs:67 keys on 0x1e).

One nit worth a line: values it ignores are silent — VICTORY_FSR_AUTO_EXPOSURE=off/false/1 and VICTORY_FSR_PRE_EXPOSURE=0/-1/nan. 0 is the one that will bite, because the sibling switch uses 0 as "off" while pre_exposure() rejects it, and the docs row says only "a number above 0" without saying what happens otherwise. A warn line, or one clause in the row, is enough.

Both rows would also read better saying they affect the title's own temporal dispatch path only, not every FSR path.

**@⁠Luxuride** on GitHub · 2026-12-04 11:28 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/442#issuecomment-7410146096) Clean and small, and the index is right: `settings[3]` at `crates/victory-hle/src/modules/fidelityfx.rs:760` is `pre_exposure` per the test's named struct (`crates/victory-hle/tests/fidelityfx.rs:96-120`), `[4]` is `reset`, the `0x1b0` size assertion is untouched. The mask also lands on the copy that is kept (`:463-465` before `:531`), so the first-dispatch log shows the masked 0x9 rather than the title's original, and clearing bit `0x20` cannot change which dispatches the frame generator treats as temporal (`framegen.rs:67` keys on `0x1e`). One nit worth a line: values it ignores are silent — `VICTORY_FSR_AUTO_EXPOSURE=off/false/1` and `VICTORY_FSR_PRE_EXPOSURE=0/-1/nan`. `0` is the one that will bite, because the sibling switch uses `0` as "off" while `pre_exposure()` rejects it, and the docs row says only "a number above 0" without saying what happens otherwise. A warn line, or one clause in the row, is enough. Both rows would also read better saying they affect the title's own temporal dispatch path only, not every FSR path.
- VICTORY_FSR_AUTO_EXPOSURE: values other than 0 (and 1) log a warning
  instead of passing silently.
- VICTORY_FSR_PRE_EXPOSURE: 0, negative, non-finite and non-numbers log a
  warning (0 does not mean off here); the title's value is kept.
- Both settings rows say they cover the title's own temporal upscaling
  only, not frame generation, and what happens to ignored values; the
  pre-exposure row says it was measured without frame generation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNCfbX5dPKJzSkgbf16GX4
Author
Owner

@⁠TreXito on GitHub · 2026-12-04 12:01 UTC · original

Thanks. Addressed in 66ca20c:

  • VICTORY_FSR_AUTO_EXPOSURE values other than 0 (and 1) now log a warning instead of passing silently.
  • VICTORY_FSR_PRE_EXPOSURE=0, negative, non-finite and non-numeric values now log a warning that says 0 does not mean off; the title's value is kept. An empty value still counts as unset.
  • Both rows now say they cover only the title's own temporal upscaling (VICTORY_FSR_4K, VICTORY_FSR_HOST), not frame generation, and what happens to ignored values.

Checked with a release build, booting with VICTORY_FSR_AUTO_EXPOSURE=off VICTORY_FSR_PRE_EXPOSURE=0: both warnings are logged once, FSR 4 runs as before, 215 s in the world, no crash.

One caveat I found after opening this, now noted in the pre-exposure row. With AMD frame generation on (VICTORY_FIDELITYFX_FRAMEGEN=1), the shade still came out at about 45% in 4 of 5 runs, even with both switches. That is the same level as without them.

  • Setup: RX 7800 XT, FSR 4 INT8, 1706x960 to 1440p, VICTORY_BVH_BUILDER=0.
  • Without frame generation it was right in 5 of 5 runs.
  • Dark and normal runs log exactly the same lines, so the cause is still open. I'll follow up if I find it.

@⁠WillyBrown69 good to hear. I haven't linked #350, since that report doesn't say which upscaler it uses.

AI-assisted: yes

**@⁠TreXito** on GitHub · 2026-12-04 12:01 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/442#issuecomment-7410859196) Thanks. Addressed in 66ca20c: - `VICTORY_FSR_AUTO_EXPOSURE` values other than `0` (and `1`) now log a warning instead of passing silently. - `VICTORY_FSR_PRE_EXPOSURE=0`, negative, non-finite and non-numeric values now log a warning that says `0` does not mean off; the title's value is kept. An empty value still counts as unset. - Both rows now say they cover only the title's own temporal upscaling (`VICTORY_FSR_4K`, `VICTORY_FSR_HOST`), not frame generation, and what happens to ignored values. Checked with a release build, booting with `VICTORY_FSR_AUTO_EXPOSURE=off VICTORY_FSR_PRE_EXPOSURE=0`: both warnings are logged once, FSR 4 runs as before, 215 s in the world, no crash. One caveat I found after opening this, now noted in the pre-exposure row. With AMD frame generation on (`VICTORY_FIDELITYFX_FRAMEGEN=1`), the shade still came out at about 45% in 4 of 5 runs, even with both switches. That is the same level as without them. - Setup: RX 7800 XT, FSR 4 INT8, 1706x960 to 1440p, `VICTORY_BVH_BUILDER=0`. - Without frame generation it was right in 5 of 5 runs. - Dark and normal runs log exactly the same lines, so the cause is still open. I'll follow up if I find it. @⁠WillyBrown69 good to hear. I haven't linked #350, since that report doesn't say which upscaler it uses. AI-assisted: yes
github-bot changed target branch from main to gh-pr/442/base 2026-12-04 19:37:56 +00:00
github manually merged commit 66ca20c5f5 into gh-pr/442/base 2026-12-04 19:38:00 +00:00
Author
Owner

@⁠danfq on GitHub · 2026-12-05 21:15 UTC · original

A data point from an RX 7600 XT (RDNA 3, FSR 4.1.2, 1280x720 to 1920x1080, xmem b581f7e, ray tracing off at the time):

  • VICTORY_FSR_AUTO_EXPOSURE=0 with VICTORY_FSR_PRE_EXPOSURE=0.25: in daylight, the highlights clipped to white (a sunlit patch of road, a white pickup, white clothes), while the shade stayed dark.
  • VICTORY_FSR_AUTO_EXPOSURE=0 alone: the highlights kept their detail and the picture looked balanced. That's the one I kept.

So 0.25 doesn't seem to carry over to every card or scene. It may be worth noting next to the setting that the pre-exposure value depends on the card. Both runs were in daylight at different spots and judged by eye from screenshots, so I have no brightness numbers to add.

**@⁠danfq** on GitHub · 2026-12-05 21:15 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/442#issuecomment-7445493145) A data point from an RX 7600 XT (RDNA 3, FSR 4.1.2, 1280x720 to 1920x1080, xmem `b581f7e`, ray tracing off at the time): - `VICTORY_FSR_AUTO_EXPOSURE=0` with `VICTORY_FSR_PRE_EXPOSURE=0.25`: in daylight, the highlights clipped to white (a sunlit patch of road, a white pickup, white clothes), while the shade stayed dark. - `VICTORY_FSR_AUTO_EXPOSURE=0` alone: the highlights kept their detail and the picture looked balanced. That's the one I kept. So 0.25 doesn't seem to carry over to every card or scene. It may be worth noting next to the setting that the pre-exposure value depends on the card. Both runs were in daylight at different spots and judged by eye from screenshots, so I have no brightness numbers to add.
This discussion has been locked. Commenting is limited to contributors.
No description provided.