FidelityFX: DLSS frame generation on frames the title upscales (stacked on #1704) #1714

Open
marquezinii wants to merge 5 commits from upstream-pr/1715 into main
marquezinii commented 2026-11-24 21:08:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by marquezinii on 2026-11-24T21:08:56Z.


Stacked on #1704 (DLSS upscaling), which is stacked on #1868, all on main at 940d32f. Only the last commit (6aaec93) is new here.

What

With VICTORY_DLSS_FG=<n> beside VICTORY_DLSS_DIR, DLSS frame generation (DLSS-G) adds n frames between the presented ones: 1 for 2x, 2 for 3x, 3 for 4x on GPUs that offer multi frame generation. It needs an RTX 40 or newer and hardware-accelerated GPU scheduling. Streamline reports when either is missing, and the log says frame generation is unavailable.

The title asks for no frame generation, so the inputs come from the title's upscale.

  • Inputs. At each DLSS upscale, depth and motion vectors are tagged as eOnlyValidNow, so Streamline copies them on the list. The title may reuse them before the present. The frame's constants are the upscale's.
  • Swap chain. #1704 now makes the presenter's swap chain from Streamline's proxy factory whenever DLSS is on, so presentCommon runs. DLSS-G needs it too, since in manual hooking that is how it gets the back buffer and inserts its frames. This PR adds the start of the first frame there.
  • Pacing. Each present gets the PCL markers and Reflex's sleep (low latency mode), which DLSS-G requires. Frames are numbered by present instead of by upscale, so all the upscales of one presented frame share its token.
  • Off outside the world. DLSS-G is switched on for frames that had an upscale and off for the others (menus, videos, loading), as the DLSS-G guide asks.

Without VICTORY_DLSS_FG nothing changes from #1704: no markers, no Reflex, and the upscale numbers frames per dispatch.

Tested

Windows 11 26300, RTX 5070 (driver 621.40), Streamline SDK 2.14.16, on this branch rebased on 940d32f:

  • dlss::tests::frame_generation_presents_generated_frames opens a window and gets its swap chain from the proxy factory. It then runs 120 frames, each with a DLSS upscale on the list, a present and the markers, and checks that DLSS-G reports n + 1 frames among the last 10 presents, and never more. It passes for VICTORY_DLSS_FG=1, 2 and 3, that is 2x, 3x and 4x. It skips without both variables.
    • It is flaky on this machine. About one run in five, sometimes several in a row, DLSS-G reports status 0 and one frame on every present: it is on and reports no failure, but generates nothing. The failure message now prints the last presents and the status. It came and went while I used the machine, which points at the test window's focus or occlusion rather than the code, but I haven't confirmed that.
  • With VICTORY_DLSS_FG=1, #1704's title-shaped test (victory-hle/tests/dlss.rs, FP16 and RGB9E5 outputs) still passes, and so does the upscale-only path without it.
  • Clippy with -D warnings passes, with and without --all-features.

Not tested: frame generation in the title. #1704 ran there (see its description), but I didn't turn DLSS-G on in the title. Several things are unchecked:

  • How generated frames look with its motion vectors and depth.
  • That its HUD is part of the back buffer. No HUD-less buffer is tagged, so UI may smear in generated frames.
  • That its swap chain format is one DLSS-G accepts. dlss: frame generation presenting logs the status.
  • The camera matrices are identity, as in #1704.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6591457232 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1715). Originally posted by [marquezinii](https://github.com/marquezinii) on 2026-11-24T21:08:56Z. --- Stacked on #1704 (DLSS upscaling), which is stacked on #1868, all on `main` at `940d32f`. Only the last commit (`6aaec93`) is new here. ## What With `VICTORY_DLSS_FG=<n>` beside `VICTORY_DLSS_DIR`, DLSS frame generation (DLSS-G) adds `n` frames between the presented ones: 1 for 2x, 2 for 3x, 3 for 4x on GPUs that offer multi frame generation. It needs an RTX 40 or newer and hardware-accelerated GPU scheduling. Streamline reports when either is missing, and the log says frame generation is unavailable. The title asks for no frame generation, so the inputs come from the title's upscale. - **Inputs.** At each DLSS upscale, depth and motion vectors are tagged as `eOnlyValidNow`, so Streamline copies them on the list. The title may reuse them before the present. The frame's constants are the upscale's. - **Swap chain.** #1704 now makes the presenter's swap chain from Streamline's proxy factory whenever DLSS is on, so `presentCommon` runs. DLSS-G needs it too, since in manual hooking that is how it gets the back buffer and inserts its frames. This PR adds the start of the first frame there. - **Pacing.** Each present gets the PCL markers and Reflex's sleep (low latency mode), which DLSS-G requires. Frames are numbered by present instead of by upscale, so all the upscales of one presented frame share its token. - **Off outside the world.** DLSS-G is switched on for frames that had an upscale and off for the others (menus, videos, loading), as the DLSS-G guide asks. Without `VICTORY_DLSS_FG` nothing changes from #1704: no markers, no Reflex, and the upscale numbers frames per dispatch. ## Tested Windows 11 26300, RTX 5070 (driver 621.40), Streamline SDK 2.14.16, on this branch rebased on `940d32f`: - `dlss::tests::frame_generation_presents_generated_frames` opens a window and gets its swap chain from the proxy factory. It then runs 120 frames, each with a DLSS upscale on the list, a present and the markers, and checks that DLSS-G reports `n + 1` frames among the last 10 presents, and never more. It passes for `VICTORY_DLSS_FG=1`, `2` and `3`, that is 2x, 3x and 4x. It skips without both variables. - **It is flaky on this machine.** About one run in five, sometimes several in a row, DLSS-G reports status 0 and one frame on every present: it is on and reports no failure, but generates nothing. The failure message now prints the last presents and the status. It came and went while I used the machine, which points at the test window's focus or occlusion rather than the code, but I haven't confirmed that. - With `VICTORY_DLSS_FG=1`, #1704's title-shaped test (`victory-hle/tests/dlss.rs`, FP16 and RGB9E5 outputs) still passes, and so does the upscale-only path without it. - Clippy with `-D warnings` passes, with and without `--all-features`. **Not tested:** frame generation in the title. #1704 ran there (see its description), but I didn't turn DLSS-G on in the title. Several things are unchecked: - How generated frames look with its motion vectors and depth. - That its HUD is part of the back buffer. No HUD-less buffer is tagged, so UI may smear in generated frames. - That its swap chain format is one DLSS-G accepts. `dlss: frame generation presenting` logs the status. - The camera matrices are identity, as in #1704.
Marvisak commented 2026-11-25 02:06:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:35:00Z.


Automated triage for the maintainers.

Needs work: needs the maintainer's decision. This adds DLSS frame generation (VICTORY_DLSS_FG) on top of #1704 (DLSS upscaling through Streamline), which sits on #1868. The diff against main therefore carries all three: the new crates/victory-gpu/src/dlss.rs, rgb9e5.rs, and changes to resource.rs, host.rs and victory-hle's fidelityfx.rs. Only 6aaec93 is new here. The stack makes VICTORY load and run third-party native code: LoadLibraryW on sl.interposer.dll and its plugins, from the folder VICTORY_DLSS_DIR names (dlss.rs). The swap chain then comes from Streamline's proxy factory. Loading outside DLLs is the maintainer's call, so this cannot be a merge candidate on its own. Two more things before a content review is worth it:

  • #1704 and #1868 need to be decided first; this PR is best re-reviewed once only its own commit differs from main.
  • frame_generation_presents_generated_frames fails about one run in five, by the description's own account, with no cause found. Please confirm the cause (window focus or occlusion) or make the test tolerate it before it lands.

Thanks for the rebase and the clear notes on what is untested. It merges cleanly with main now.

CI: passing (check).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149714179 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1715#issuecomment-7149714179). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:35:00Z. --- <!-- victory-triage v1 head=6aaec938f0c396116209d4ca585a53ff36335d05 verdict=needs-work at=2026-11-25T06:26:10Z --> Automated triage for the maintainers. **Needs work: needs the maintainer's decision.** This adds DLSS frame generation (`VICTORY_DLSS_FG`) on top of #1704 (DLSS upscaling through Streamline), which sits on #1868. The diff against `main` therefore carries all three: the new `crates/victory-gpu/src/dlss.rs`, `rgb9e5.rs`, and changes to `resource.rs`, `host.rs` and `victory-hle`'s `fidelityfx.rs`. Only `6aaec93` is new here. The stack makes VICTORY load and run third-party native code: `LoadLibraryW` on `sl.interposer.dll` and its plugins, from the folder `VICTORY_DLSS_DIR` names (`dlss.rs`). The swap chain then comes from Streamline's proxy factory. Loading outside DLLs is the maintainer's call, so this cannot be a merge candidate on its own. Two more things before a content review is worth it: - #1704 and #1868 need to be decided first; this PR is best re-reviewed once only its own commit differs from `main`. - `frame_generation_presents_generated_frames` fails about one run in five, by the description's own account, with no cause found. Please confirm the cause (window focus or occlusion) or make the test tolerate it before it lands. Thanks for the rebase and the clear notes on what is untested. It merges cleanly with `main` now. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
marquezinii commented 2026-11-25 05:06:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by marquezinii on 2026-11-25T04:48:27Z.


Rebased on 940d32f with #1704, which is now stacked on #1868. The host.rs conflict is gone, because #1704 now routes the swap chain through Streamline whenever DLSS is on, and this PR only adds the frame-generation start there. The FG test now checks the last 10 presents and prints DLSS-G's status when it fails. Its flakiness is described in the updated description.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153181557 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1715#issuecomment-7153181557). Originally posted by [marquezinii](https://github.com/marquezinii) on 2026-11-25T04:48:27Z. --- Rebased on `940d32f` with #1704, which is now stacked on #1868. The `host.rs` conflict is gone, because #1704 now routes the swap chain through Streamline whenever DLSS is on, and this PR only adds the frame-generation start there. The FG test now checks the last 10 presents and prints DLSS-G's status when it fails. Its flakiness is described in the updated description.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1715:upstream-pr/1715'
git switch 'upstream-pr/1715'

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 'upstream-pr/1715'
git switch 'upstream-pr/1715'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1715'
git switch 'upstream-pr/1715'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1715'
git switch 'main'
git merge --squash 'upstream-pr/1715'
git switch 'main'
git merge --ff-only 'upstream-pr/1715'
git switch 'main'
git merge 'upstream-pr/1715'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
Marvisak/VIctory!1714
No description provided.