Repository navigation
FidelityFX: answer the upscale calls with DLSS through Streamline (stacked on #1868) - #1704
marquezinii wants to merge 4 commits into
Conversation
|
In-title result for this PR, since the description says it had not been run in the title: DLSS answers the title's upscale calls in Series S mode on an 8 GB card, and the picture is clean. Setup
From the log (one run, about 5 minutes, opening cutscene then the first gameplay room)
Picture and speed
One error, once in the run Not tested
No game data. AI-assisted: Claude Code applied the commit, made the run, read the log and wrote this comment. |
7e6e578 to
cdd62a3
Compare
cdd62a3 to
be878d3
Compare
|
Automated triage for the maintainers. Needs work: needs the maintainer's decision. This answers the title's FidelityFX upscale calls with DLSS. It loads Update after your reply (head
The picture itself is still unchecked, since the frames are dark in your runs. A side-by-side with FidelityFX would help whoever decides. 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.
be878d3 to
5800bd7
Compare
|
Updated, taking the triage's three points and @sagouindupm's run (thanks for testing it in the title, and for catching the Streamline error):
The title runs used |
…rvisak/VIctory#1704) The commit 7e6e578 of Marvisak/VIctory#1704 by marquezini, applied on top of this branch's port of the PC upscaler (#86). With VICTORY_DLSS_DIR naming the bin\x64 folder of NVIDIA's Streamline SDK, the title's FidelityFX upscale calls are answered by DLSS. One conflict, in the module comment of crates/victory-hle/src/modules/ffx.rs. Built (release). Not run in the title yet: the SDK is not on this machine. (cherry picked from commit 5825e5d95bec89bcbce4d99963436c11cc50d772) Onto feat/render, after the port of #86 there: one conflict in the module comment and module list of crates/victory-gpu/src/ffx.rs (the RGB9E5 packing is not ported here, so no rgb9e5 module). README conflict: ours kept. Co-Authored-By: marquezini <marquezinii@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signé-par: Sagouindupm
Stacked on #1868: its two commits come first here. This PR's own commits are the last two,
1812694and5800bd7, onmainat940d32f. #1868 writes an RGB9E5 output that NVIDIA can't store to through an FP16 texture (victory_gpu::rgb9e5), and makes that texture where the host refuses it with the title's uses. DLSS reuses both, so there's one copy of the bridge.What
With
VICTORY_DLSS_DIRpointing atbin\x64of NVIDIA's public Streamline SDK (2.x), the title's FidelityFX upscale calls are answered by DLSS instead of AMD's PC upscaler. The SDK isn't in the tree. It is loaded from that folder, the wayVICTORY_FIDELITYFX_DIRloads AMD's.victory_hle::modules::fidelityfxdoes what it already does for AMD's DLL. The title's textures become their host copies in the states the title gives, its command list becomes the host one, and an RGB9E5 output the host can't store to becomes FidelityFX: write an RGB9E5 output NVIDIA cannot store to through an FP16 texture (fixes a device removal) #1868's FP16 texture. Then it hands the description tovictory_gpu::dlssinstead offfxDispatchfrom the PC DLL, and packs the output afterwards as it does for AMD's.slSetD3DDevice), with frame-based resource tagging.slUpgradeInterface), as Streamline's manual hooking guide recommends, so itspresentCommonruns on each present. Without that, Streamline logspresentCommon() was not observedand its per-frame bookkeeping never runs (reported in the comments).8 * ratio²phases, Halton(2, 3)), so the title renders the frames it would for FSR.const-asserted against MSVC's values.Tested
Windows 11 26300, RTX 5070 (driver 621.40), Streamline SDK 2.14.16:
victory-hle/tests/dlss.rsis new, built frommain'stests/fidelityfx.rs.RGB9E5 output written through an FP16 texture.VICTORY_DLSS_DIR.victory-gpu's unit tests pass: the FSR formulas, the DLSS mode per ratio, the dispatch mapping, and a DLSS upscale on a device made before Streamline starts.cargo test -p victory-gpupasses (except the two NVIDIA heap-cap failuresmainhas, Test report: RTX 5070 (Blackwell), Windows 11, 70564ae: 471 passed, 5 failed, 7 ignored (4 from the 1,000,000 view heap cap) #1744), and so doescargo test -p victory-hle.-D warningspasses, with and without--all-features.In the title (
mainat940d32fplus #1775 and #1751, without whichmainremoves the device at boot on NVIDIA (#1753); Series S profile, which takes the FidelityFX path):dlss: Streamline initialised on the host devicedlss: presenting through Streamlinedlss: upscale context on the host GPU viewport=0 render=[1280, 720] upscale=[1920, 1080] mode=MaxQualityFidelityFX: first upscaling, host formats of its textures formats=[10, 19, 34, 67]dlss: first upscale recorded on the host GPUpresentCommonerror and no Streamline error came up over about 4½ minutes in the world.a resource has no host texture in its state; the upscaling did not run.VICTORY_SKIP_PIPELINES=f607780aa8e502d0. Without it, the GPU hangs within a minute of entering the world on this card, on an indirect dispatch of that pipeline, with or without DLSS (DRED names it).Not tested: Series X (it doesn't take the FidelityFX path without #1793's picker change), other DLSS modes, AMD (DLSS needs NVIDIA).