Repository navigation
FidelityFX: DLSS frame generation on frames the title upscales (stacked on #1704) - #1715
marquezinii wants to merge 5 commits into
Conversation
2fed932 to
b3db101
Compare
|
Automated triage for the maintainers. Needs work: needs the maintainer's decision. This adds DLSS frame generation (
Thanks for the rebase and the clear notes on what is untested. It merges cleanly with CI: passing ( 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.
b3db101 to
6aaec93
Compare
|
Rebased on |
Stacked on #1704 (DLSS upscaling), which is stacked on #1868, all on
mainat940d32f. Only the last commit (6aaec93) is new here.What
With
VICTORY_DLSS_FG=<n>besideVICTORY_DLSS_DIR, DLSS frame generation (DLSS-G) addsnframes 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.
eOnlyValidNow, so Streamline copies them on the list. The title may reuse them before the present. The frame's constants are the upscale's.presentCommonruns. 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.Without
VICTORY_DLSS_FGnothing 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_framesopens 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 reportsn + 1frames among the last 10 presents, and never more. It passes forVICTORY_DLSS_FG=1,2and3, that is 2x, 3x and 4x. It skips without both variables.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.-D warningspasses, 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:
dlss: frame generation presentinglogs the status.