Skip to content

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

Open
marquezinii wants to merge 5 commits into
Marvisak:mainfrom
marquezinii:gpu/dlss-frame-generation
Open

marquezinii wants to merge 5 commits into
Marvisak:mainfrom
marquezinii:gpu/dlss-frame-generation

Conversation

@marquezinii

@marquezinii marquezinii commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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. FidelityFX: answer the upscale calls with DLSS through Streamline (stacked on #1868) #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, FidelityFX: answer the upscale calls with DLSS through Streamline (stacked on #1868) #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:

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

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:

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

…n FP16 texture

The title upscales into an RGB9E5 texture with render-target and
unordered-access uses. NVIDIA creates such a texture, so its host copy
takes UNORDERED_ACCESS, but it cannot store to RGB9E5 through a typed
unordered access view: the host upscaler writing it removes the device
(0x887A0005 in the test below).

Where the host does not store to the output's format (format support:
typed UAV and UAV typed store), the output is moved to COPY_DEST and the
upscaler writes an FP16 texture of ours instead. Its rows are copied to
a buffer, a compute shader packs them into RGB9E5 by D3D's rule, and a
buffer-to-texture copy writes the title's texture. The packer is a 5.1
shader with its root signature inside, as indirect.rs does, and needs no
descriptor heap. Hosts that store RGB9E5 write it directly, as before.

tests/fidelityfx.rs upscales into an RGB9E5 output too, made with the
title's uses, and checks every pixel of both outputs.
… without it

Formats such as RGB9E5 and B4G4R4A4 support neither render targets nor
typed unordered views on NVIDIA. An RTX 5070 still makes such a texture
with those flags, unless a clear value comes with it, and the title
passes one: 2560x1440 B4G4R4A4 and RGB9E5 targets got no host texture.
An RTX 3070 refuses them with either flag.

When creation fails, make_texture retries without the render target and
unordered access flags that D3D12_FEATURE_FORMAT_SUPPORT doesn't list
for the format, and without the clear value. The texture then exists and
is written by copies. An RGB9E5 upscaler output goes through the FP16
bridge. Render target views are not made on such a texture, because one
would remove the device: set_targets leaves it unbound and a clear
skips it.
With VICTORY_DLSS_DIR pointing at bin\x64 of NVIDIA's public Streamline
SDK, the title's FidelityFX upscaler calls are answered by DLSS instead of
AMD's PC upscaler. Nothing of the SDK is in the tree: it is loaded from
that folder, and its structures are declared from its MIT headers with
their sizes checked.

victory_hle's FidelityFX module turns the dispatch into host objects as
it does for AMD's DLL (textures swapped for their host copies, the list
for the host one, an RGB9E5 output the host cannot store to swapped for
victory_gpu::rgb9e5's FP16 texture) and hands it to victory_gpu::dlss,
which maps the description onto DLSS options, constants and resource
tags. Jitter and render sizes are answered with FSR's formulas, so the
title renders as it does for FSR.
…ns each frame

With manual hooking, Streamline's common plugin only does its per-frame
bookkeeping in presentCommon, which runs from its swap chain proxy's
Present. Nothing called it, so a run in the title logged "presentCommon()
was not observed". With DLSS on, the presenter now makes its swap chain
from Streamline's proxy for the DXGI factory (slUpgradeInterface), as
the manual hooking guide recommends. Without DLSS nothing changes.
With VICTORY_DLSS_FG set beside VICTORY_DLSS_DIR, DLSS-G adds 1 to 3
frames between the presented ones. The title asks for no frame
generation, so the inputs are the DLSS upscale's: depth and motion
vectors are tagged at each upscale for Streamline to copy (they may be
reused before the present), and the frame's constants are the upscale's.

The presenter's swap chain comes from Streamline's proxy factory, and
each present gets Reflex's sleep and the PCL markers DLSS-G paces with.
Frames are numbered by present instead of by upscale, so the upscales of
a presented frame share its token. DLSS-G is on for frames that had an
upscale and off for the others (menus, videos).

A GPU test presents 120 frames to a window through the proxy swap chain,
with an upscale each, and checks that DLSS-G reports n + 1 frames for
the last present; it skips without VICTORY_DLSS_DIR and VICTORY_DLSS_FG.
@marquezinii
marquezinii force-pushed the gpu/dlss-frame-generation branch from b3db101 to 6aaec93 Compare November 25, 2026 04:46
@marquezinii

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants