FidelityFX: answer the upscale calls with DLSS through Streamline (stacked on #1868) #1703

Open
marquezinii wants to merge 4 commits from upstream-pr/1704 into main
marquezinii commented 2026-11-24 20:57:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by marquezinii on 2026-11-24T20:57:39Z.


Stacked on #1868: its two commits come first here. This PR's own commits are the last two, 1812694 and 5800bd7, on main at 940d32f. #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_DIR pointing at bin\x64 of 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 way VICTORY_FIDELITYFX_DIR loads AMD's.

  • Routing. victory_hle::modules::fidelityfx does 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 #1868's FP16 texture. Then it hands the description to victory_gpu::dlss instead of ffxDispatch from the PC DLL, and packs the output afterwards as it does for AMD's.
  • Streamline setup.
    • Manual hooking on VIctory's own host device (slSetD3DDevice), with frame-based resource tagging.
    • Each FidelityFX context is one Streamline viewport. Its DLSS mode comes from the context's largest upscale (1.5x → Quality, 2x → Performance and so on).
    • With DLSS on, the presenter makes its swap chain from Streamline's proxy factory (slUpgradeInterface), as Streamline's manual hooking guide recommends, so its presentCommon runs on each present. Without that, Streamline logs presentCommon() was not observed and its per-frame bookkeeping never runs (reported in the comments).
  • Description mapping. The FidelityFX flags become DLSS options and constants: HDR, inverted depth, auto exposure, jittered vectors.
    • Jitter passes through, since both APIs take the camera's offset in pixels.
    • FidelityFX's motion vector scale converts vectors to pixels, and DLSS's converts them to [-1, 1]. So the scale is divided by the size the vectors are rendered at.
  • Queries. The title asks for its jitter sequence and render sizes, which DLSS has no calls for. They are answered with FSR's own formulas (8 * ratio² phases, Halton(2, 3)), so the title renders the frames it would for FSR.
  • Bindings. The Streamline structures are declared from the SDK's MIT-licensed headers. Their sizes, and the offsets that matter, are const-asserted against MSVC's values.

Tested

Windows 11 26300, RTX 5070 (driver 621.40), Streamline SDK 2.14.16:

  • victory-hle/tests/dlss.rs is new, built from main's tests/fidelityfx.rs.
    • It calls our exports as the title does: the title's descriptions, console device, queue and list, the jitter queries, and two upscalings (1280x720 → 1920x1080) of a flat colour.
    • One upscaling goes into an FP16 output, the other into an RGB9E5 output made with the title's uses (render target and unordered access). Every pixel of both, read back in the same list, is checked within 0.05.
    • It runs with the debug layer on, with no errors from it. Here the log reads RGB9E5 output written through an FP16 texture.
    • It passes, and it skips without 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-gpu passes (except the two NVIDIA heap-cap failures main has, #1744), and so does cargo test -p victory-hle.
  • Clippy with -D warnings passes, with and without --all-features.

In the title (main at 940d32f plus #1775 and #1751, without which main removes the device at boot on NVIDIA (#1753); Series S profile, which takes the FidelityFX path):

  • The log reads, in order:
    1. dlss: Streamline initialised on the host device
    2. dlss: presenting through Streamline
    3. dlss: upscale context on the host GPU viewport=0 render=[1280, 720] upscale=[1920, 1080] mode=MaxQuality
    4. FidelityFX: first upscaling, host formats of its textures formats=[10, 19, 34, 67]
    5. dlss: first upscale recorded on the host GPU
  • No presentCommon error and no Streamline error came up over about 4½ minutes in the world.
  • Before this was stacked on #1868, the same run never upscaled. The title's RGB9E5 output had no host texture (the RTX 5070 refuses it with a clear value), and the log read a resource has no host texture in its state; the upscaling did not run.
  • These runs used 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).
  • The world's frames are still dark on this machine, so the picture couldn't be judged here. An RTX 3050 run in the comments found it clean.

Not tested: Series X (it doesn't take the FidelityFX path without #1793's picker change), other DLSS modes, AMD (DLSS needs NVIDIA).

<!-- greyfinch-sync:Marvisak/VIctory:issue:6591261951 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1704). Originally posted by [marquezinii](https://github.com/marquezinii) on 2026-11-24T20:57:39Z. --- **Stacked on #1868**: its two commits come first here. This PR's own commits are the last two, `1812694` and `5800bd7`, on `main` at `940d32f`. #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_DIR` pointing at `bin\x64` of NVIDIA's public [Streamline SDK](https://github.com/NVIDIA-RTX/Streamline) (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 way `VICTORY_FIDELITYFX_DIR` loads AMD's. - **Routing.** `victory_hle::modules::fidelityfx` does 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 #1868's FP16 texture. Then it hands the description to `victory_gpu::dlss` instead of `ffxDispatch` from the PC DLL, and packs the output afterwards as it does for AMD's. - **Streamline setup.** - Manual hooking on VIctory's own host device (`slSetD3DDevice`), with frame-based resource tagging. - Each FidelityFX context is one Streamline viewport. Its DLSS mode comes from the context's largest upscale (1.5x → Quality, 2x → Performance and so on). - With DLSS on, the presenter makes its swap chain from Streamline's proxy factory (`slUpgradeInterface`), as Streamline's manual hooking guide recommends, so its `presentCommon` runs on each present. Without that, Streamline logs `presentCommon() was not observed` and its per-frame bookkeeping never runs (reported in the comments). - **Description mapping.** The FidelityFX flags become DLSS options and constants: HDR, inverted depth, auto exposure, jittered vectors. - Jitter passes through, since both APIs take the camera's offset in pixels. - FidelityFX's motion vector scale converts vectors to pixels, and DLSS's converts them to [-1, 1]. So the scale is divided by the size the vectors are rendered at. - **Queries.** The title asks for its jitter sequence and render sizes, which DLSS has no calls for. They are answered with FSR's own formulas (`8 * ratio²` phases, Halton(2, 3)), so the title renders the frames it would for FSR. - **Bindings.** The Streamline structures are declared from the SDK's MIT-licensed headers. Their sizes, and the offsets that matter, are `const`-asserted against MSVC's values. ## Tested Windows 11 26300, RTX 5070 (driver 621.40), Streamline SDK 2.14.16: - `victory-hle/tests/dlss.rs` is new, built from `main`'s `tests/fidelityfx.rs`. - It calls our exports as the title does: the title's descriptions, console device, queue and list, the jitter queries, and two upscalings (1280x720 → 1920x1080) of a flat colour. - One upscaling goes into an FP16 output, the other into an RGB9E5 output made with the title's uses (render target and unordered access). Every pixel of both, read back in the same list, is checked within 0.05. - It runs with the debug layer on, with no errors from it. Here the log reads `RGB9E5 output written through an FP16 texture`. - It passes, and it skips without `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-gpu` passes (except the two NVIDIA heap-cap failures `main` has, #1744), and so does `cargo test -p victory-hle`. - Clippy with `-D warnings` passes, with and without `--all-features`. **In the title** (`main` at `940d32f` plus #1775 and #1751, without which `main` removes the device at boot on NVIDIA (#1753); Series S profile, which takes the FidelityFX path): - The log reads, in order: 1. `dlss: Streamline initialised on the host device` 2. `dlss: presenting through Streamline` 3. `dlss: upscale context on the host GPU viewport=0 render=[1280, 720] upscale=[1920, 1080] mode=MaxQuality` 4. `FidelityFX: first upscaling, host formats of its textures formats=[10, 19, 34, 67]` 5. `dlss: first upscale recorded on the host GPU` - No `presentCommon` error and no Streamline error came up over about 4½ minutes in the world. - Before this was stacked on #1868, the same run never upscaled. The title's RGB9E5 output had no host texture (the RTX 5070 refuses it with a clear value), and the log read `a resource has no host texture in its state; the upscaling did not run`. - These runs used `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). - The world's frames are still dark on this machine, so the picture couldn't be judged here. An RTX 3050 run in the comments found it clean. **Not tested:** Series X (it doesn't take the FidelityFX path without #1793's picker change), other DLSS modes, AMD (DLSS needs NVIDIA).
upstream-sync changed title from [PR #1704] FidelityFX: answer the upscale calls with DLSS through Streamline (stacked on #1284) to [PR #1704] FidelityFX: answer the upscale calls with DLSS through Streamline, RGB9E5 outputs included 2026-11-25 00:05:55 +00:00
sagouindupm commented 2026-11-25 00:06:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sagouindupm on 2026-11-24T23:19:01Z.


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

  • NVIDIA GeForce RTX 3050 8 GB, Intel Core i5-12400F, 32 GB RAM, Windows 11 Pro 26200.
  • Tree: fxceless/victory-fork main at 2119b0e, plus its #32 (RGB9E5 stand-in), its #86 (the port of #1284), its #188 (second present plane), and 7e6e578 from this PR applied on top (one conflict, in the module comment of victory-hle/src/modules/ffx.rs). Release build.
  • Streamline SDK 2.14.16: sl.interposer.dll, sl.common.dll, sl.dlss.dll, nvngx_dlss.dll in the folder VICTORY_DLSS_DIR names. --console series-s, no other switch.
  • cargo test --release -p victory-gpu: 116 passed, 0 failed, 1 ignored.

From the log (one run, about 5 minutes, opening cutscene then the first gameplay room)

  • dlss: Streamline initialised on the host device
  • dlss: upscale context on the host GPU viewport=0 render=[1280, 720] upscale=[1920, 1080] flags=41 mode=MaxQuality
  • ffx: jitter phase count ... count=Some(18)
  • dlss: first upscale recorded on the host GPU render=[1280, 720] upscale=[1920, 1080] mode=MaxQuality, then ffx: first upscale recorded ... result=0 ... format=10 packed=false (the output is the FP16 stand-in of #32, so no RGB9E5 packing here).
  • No device removal, no host GPU error.

Picture and speed

  • Compared by eye with a plain bilinear stretch of the same input and with the PC FSR path of #86 (which picked provider 3.1.6 on this card): no grain, straight edges, no visible shake or smearing on a slow camera. So the jitter sign and the motion vector scale look right at this frame rate; I did not check a fast camera.
  • 510 to 650 ms a frame in the world in most samples, two samples near 3 s; the same range as the stretch (588 ms median) and FSR (569 ms median) on this machine. 6.9 GB of video memory, the card about 60 % busy. The frame time is not the upscaler's here.

One error, once in the run
[streamline][error] commonInterface.cpp:559 [slEvaluateFeatureInternal] Streamline presentCommon() was not observed. Ensure the common plugin's presentCommon() function is invoked every frame. Without presentCommon(), internal bookkeeping and garbage collect...
Nothing visible came of it in 5 minutes. I did not measure memory over a long run.

Not tested

  • More than one run; runs longer than 5 minutes; a fast-moving camera.
  • Series X (it does not take the FidelityFX path without the picker override).
  • Other DLSS modes, other cards.

No game data. AI-assisted: Claude Code applied the commit, made the run, read the log and wrote this comment.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7147260554 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1704#issuecomment-7147260554). Originally posted by [sagouindupm](https://github.com/sagouindupm) on 2026-11-24T23:19:01Z. --- 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** - NVIDIA GeForce RTX 3050 8 GB, Intel Core i5-12400F, 32 GB RAM, Windows 11 Pro 26200. - Tree: `fxceless/victory-fork` `main` at `2119b0e`, plus its #32 (RGB9E5 stand-in), its #86 (the port of #1284), its #188 (second present plane), and `7e6e578` from this PR applied on top (one conflict, in the module comment of `victory-hle/src/modules/ffx.rs`). Release build. - Streamline SDK 2.14.16: `sl.interposer.dll`, `sl.common.dll`, `sl.dlss.dll`, `nvngx_dlss.dll` in the folder `VICTORY_DLSS_DIR` names. `--console series-s`, no other switch. - `cargo test --release -p victory-gpu`: 116 passed, 0 failed, 1 ignored. **From the log (one run, about 5 minutes, opening cutscene then the first gameplay room)** - `dlss: Streamline initialised on the host device` - `dlss: upscale context on the host GPU viewport=0 render=[1280, 720] upscale=[1920, 1080] flags=41 mode=MaxQuality` - `ffx: jitter phase count ... count=Some(18)` - `dlss: first upscale recorded on the host GPU render=[1280, 720] upscale=[1920, 1080] mode=MaxQuality`, then `ffx: first upscale recorded ... result=0 ... format=10 packed=false` (the output is the FP16 stand-in of #32, so no RGB9E5 packing here). - No device removal, no host GPU error. **Picture and speed** - Compared by eye with a plain bilinear stretch of the same input and with the PC FSR path of #86 (which picked provider 3.1.6 on this card): no grain, straight edges, no visible shake or smearing on a slow camera. So the jitter sign and the motion vector scale look right at this frame rate; I did not check a fast camera. - 510 to 650 ms a frame in the world in most samples, two samples near 3 s; the same range as the stretch (588 ms median) and FSR (569 ms median) on this machine. 6.9 GB of video memory, the card about 60 % busy. The frame time is not the upscaler's here. **One error, once in the run** `[streamline][error] commonInterface.cpp:559 [slEvaluateFeatureInternal] Streamline presentCommon() was not observed. Ensure the common plugin's presentCommon() function is invoked every frame. Without presentCommon(), internal bookkeeping and garbage collect...` Nothing visible came of it in 5 minutes. I did not measure memory over a long run. **Not tested** - More than one run; runs longer than 5 minutes; a fast-moving camera. - Series X (it does not take the FidelityFX path without the picker override). - Other DLSS modes, other cards. No game data. AI-assisted: Claude Code applied the commit, made the run, read the log and wrote this comment.
Marvisak commented 2026-11-25 04:06:58 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Needs work: needs the maintainer's decision. This answers the title's FidelityFX upscale calls with DLSS. It loads sl.interposer.dll and its plugins with LoadLibraryW from VICTORY_DLSS_DIR (crates/victory-gpu/src/dlss.rs), about 1,400 lines in that file alone. Loading external code is the maintainer's call, so this cannot be a merge candidate on review alone.

Update after your reply (head 5800bd7):

  • presentCommon: the presenter now makes its swap chain through slUpgradeInterface, which answers the earlier point. Your run reports no Streamline errors.
  • The separate RGB9E5 copy is gone. The branch is now stacked on #1868 and carries its commits (rgb9e5.rs, the resource.rs change), so it should be reviewed and merged after #1868.
  • CI passes on this 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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152051290 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1704#issuecomment-7152051290). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T03:35:09Z. --- <!-- victory-triage v1 head=5800bd731650a39be98610c7bcc967a42013f226 verdict=needs-work at=2026-11-25T07:19:14Z --> Automated triage for the maintainers. **Needs work: needs the maintainer's decision.** This answers the title's FidelityFX upscale calls with DLSS. It loads `sl.interposer.dll` and its plugins with `LoadLibraryW` from `VICTORY_DLSS_DIR` (`crates/victory-gpu/src/dlss.rs`), about 1,400 lines in that file alone. Loading external code is the maintainer's call, so this cannot be a merge candidate on review alone. Update after your reply (head `5800bd7`): - `presentCommon`: the presenter now makes its swap chain through `slUpgradeInterface`, which answers the earlier point. Your run reports no Streamline errors. - The separate RGB9E5 copy is gone. The branch is now stacked on #1868 and carries its commits (`rgb9e5.rs`, the `resource.rs` change), so it should be reviewed and merged after #1868. - CI passes on this 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](https://claude.ai/code)_
upstream-sync changed title from [PR #1704] FidelityFX: answer the upscale calls with DLSS through Streamline, RGB9E5 outputs included to [PR #1704] FidelityFX: answer the upscale calls with DLSS through Streamline (stacked on #1868) 2026-11-25 05:05:27 +00:00
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:07Z.


Updated, taking the triage's three points and @sagouindupm's run (thanks for testing it in the title, and for catching the Streamline error):

  • presentCommon() was not observed. 5800bd7: with DLSS on, the presenter makes its swap chain from Streamline's proxy factory (slUpgradeInterface). That's what the manual hooking guide recommends, so presentCommon runs on each present. In a Series S run on an RTX 5070 the log now reads dlss: presenting through Streamline, then the context and dlss: first upscale recorded on the host GPU. Over about 4½ minutes in the world, no presentCommon or other Streamline error came up.
  • One copy of the RGB9E5 bridge. This PR is now stacked on #1868 and uses its victory_gpu::rgb9e5. dlss/rgb9e5.rs is gone, and the FidelityFX module does the bridging for both backends. The stacking turned out to be needed in the title anyway. Without #1868's new commit, the RTX 5070 refused the title's RGB9E5 output texture (it comes with a clear value), so DLSS never ran: a resource has no host texture in its state; the upscaling did not run.
  • CI. The failures were the victory-shader hardware tests that failed on main at the time (fixed in 42363ab/ccfb029). Rebased on 940d32f.

The title runs used main plus #1775 and #1751, since plain main removes the device at boot on NVIDIA (#1753). On this card the world also hangs the GPU within a minute on an indirect dispatch of compute pipeline f607780aa8e502d0, with or without DLSS (DRED names it). The runs skipped that pipeline with VICTORY_SKIP_PIPELINES. I couldn't judge the picture because the world's frames are still dark here, so @sagouindupm's comparison remains the picture check.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153176440 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1704#issuecomment-7153176440). Originally posted by [marquezinii](https://github.com/marquezinii) on 2026-11-25T04:48:07Z. --- Updated, taking the triage's three points and @sagouindupm's run (thanks for testing it in the title, and for catching the Streamline error): - **`presentCommon() was not observed`.** 5800bd7: with DLSS on, the presenter makes its swap chain from Streamline's proxy factory (`slUpgradeInterface`). That's what the manual hooking guide recommends, so `presentCommon` runs on each present. In a Series S run on an RTX 5070 the log now reads `dlss: presenting through Streamline`, then the context and `dlss: first upscale recorded on the host GPU`. Over about 4½ minutes in the world, no `presentCommon` or other Streamline error came up. - **One copy of the RGB9E5 bridge.** This PR is now stacked on #1868 and uses its `victory_gpu::rgb9e5`. `dlss/rgb9e5.rs` is gone, and the FidelityFX module does the bridging for both backends. The stacking turned out to be needed in the title anyway. Without #1868's new commit, the RTX 5070 refused the title's RGB9E5 output texture (it comes with a clear value), so DLSS never ran: `a resource has no host texture in its state; the upscaling did not run`. - **CI.** The failures were the `victory-shader` hardware tests that failed on `main` at the time (fixed in 42363ab/ccfb029). Rebased on `940d32f`. The title runs used `main` plus #1775 and #1751, since plain `main` removes the device at boot on NVIDIA (#1753). On this card the world also hangs the GPU within a minute on an indirect dispatch of compute pipeline `f607780aa8e502d0`, with or without DLSS (DRED names it). The runs skipped that pipeline with `VICTORY_SKIP_PIPELINES`. I couldn't judge the picture because the world's frames are still dark here, so @sagouindupm's comparison remains the picture check.
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/1704:upstream-pr/1704'
git switch 'upstream-pr/1704'

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/1704'
git switch 'upstream-pr/1704'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1704'
git switch 'upstream-pr/1704'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1704'
git switch 'main'
git merge --squash 'upstream-pr/1704'
git switch 'main'
git merge --ff-only 'upstream-pr/1704'
git switch 'main'
git merge 'upstream-pr/1704'
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!1703
No description provided.