DLSS: keep upscaling when a driver override shrinks the optimal render size #558

Open
github-bot wants to merge 2 commits from github-bot/gh-558 into main AGit
Owner

@⁠jhon17parizotto-byte on GitHub · 2026-11-28 00:54 UTC · original
jhon17parizotto-byte:fix/dlss-override-range → main · +82 −12 · 1 files · 2 commits · open

For #446.

An NVIDIA App DLSS override answers every mode with its own optimal render size (960x540 for 1080p on an RTX 3060 here). A 1280x720 scene then fits none of the modes, so every upscaling is dropped and the picture goes black.

Change (crates/victory-gpu/src/streamline.rs): when the scene size fits a mode's reported minimum..maximum range, offer that mode's maximum size instead of rejecting it. The sizes the call returns are now logged.

VICTORY_DLSS_RANGE=0 keeps the old behaviour.

Tested: RTX 3060 12 GB, Xeon E5-2680 v3, Series S 1080p, DLSS Performance + DLSS FG 2x, with the driver override on. Upscaling stays on instead of going black. Rebased onto 64d4931; cargo check -p victory-gpu is clean (not re-run in game on this base).

**@⁠jhon17parizotto-byte** on GitHub · 2026-11-28 00:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/558) `jhon17parizotto-byte:fix/dlss-override-range` → `main` · +82 −12 · 1 files · 2 commits · open For #446. An NVIDIA App DLSS override answers every mode with its own optimal render size (960x540 for 1080p on an RTX 3060 here). A 1280x720 scene then fits none of the modes, so every upscaling is dropped and the picture goes black. Change (`crates/victory-gpu/src/streamline.rs`): when the scene size fits a mode's reported minimum..maximum range, offer that mode's maximum size instead of rejecting it. The sizes the call returns are now logged. `VICTORY_DLSS_RANGE=0` keeps the old behaviour. Tested: RTX 3060 12 GB, Xeon E5-2680 v3, Series S 1080p, DLSS Performance + DLSS FG 2x, with the driver override on. Upscaling stays on instead of going black. Rebased onto `64d4931`; `cargo check -p victory-gpu` is clean (not re-run in game on this base).
An NVIDIA App DLSS override answers every mode with its own optimal size (960x540 for 1080p on an RTX 3060 here), so a 1280x720 scene fit none and every upscaling was dropped (a black picture). Where the scene fits the mode's minimum..maximum, offer the mode's maximum instead. VICTORY_DLSS_RANGE=0 keeps the old behaviour. Logs the sizes the call returns.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 00:55:37 +00:00
Author
Owner

@⁠ANDREANIADS on GitHub · 2026-11-28 01:48 UTC · original

Independent review on 3f4c5bc: the new fallback is computed with the current camera.render, but the cached Option<[u32; 2]> is keyed only by (output, mode). The same source size can therefore get different results depending on which frame populated the cache.

I exercised the actual record() and pick_mode() path on CPU with simulated SDK callbacks. With 1920×1080 output, optimum 960×540 and maximum 1920×1080, a fresh cache accepted 1280×720. Feeding 960×540 first and then 1280×720 at the same output rejected the second frame. In the reverse direction the cached maximum persisted, and in a separate case a below-minimum source was selected after a valid frame primed the cache. These are synthetic selection results, not observed failures in-game.

A narrow fix is to cache the raw optimum/min/max per (output, mode) and compute eligibility after lookup using the current camera.render. That made the transition tests pass without additional SDK queries and preserved VICTORY_DLSS_RANGE=0. With identical bounds across all modes, a fresh 1280×720 run still chooses DLAA by the existing tie order; that is separate from the cache fix. No game files or physical GPU evaluation were used.

**@⁠ANDREANIADS** on GitHub · 2026-11-28 01:48 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/558#issuecomment-7231927896) Independent review on `3f4c5bc`: the new fallback is computed with the current `camera.render`, but the cached `Option<[u32; 2]>` is keyed only by `(output, mode)`. The same source size can therefore get different results depending on which frame populated the cache. I exercised the actual `record()` and `pick_mode()` path on CPU with simulated SDK callbacks. With 1920×1080 output, optimum 960×540 and maximum 1920×1080, a fresh cache accepted 1280×720. Feeding 960×540 first and then 1280×720 at the same output rejected the second frame. In the reverse direction the cached maximum persisted, and in a separate case a below-minimum source was selected after a valid frame primed the cache. These are synthetic selection results, not observed failures in-game. A narrow fix is to cache the raw optimum/min/max per `(output, mode)` and compute eligibility after lookup using the current `camera.render`. That made the transition tests pass without additional SDK queries and preserved `VICTORY_DLSS_RANGE=0`. With identical bounds across all modes, a fresh 1280×720 run still chooses DLAA by the existing tie order; that is separate from the cache fix. No game files or physical GPU evaluation were used.
The cache keyed by (output, mode) held the size already chosen for the
render of the frame that filled it, so a later frame with another render
size got that stale answer: 1280x720 refused after 960x540, or a render
below the minimum accepted. Cache the optimum, minimum and maximum the SDK
answered and decide the fallback each frame with the current render.
Author
Owner

@⁠jhon17parizotto-byte on GitHub · 2026-11-28 02:00 UTC · original

Thanks, confirmed. Fixed in cd02cc3: the cache keyed by (output, mode) now holds only the optimum, minimum and maximum the SDK answered, and the range fallback is decided every frame with the current camera.render. No extra SDK queries; VICTORY_DLSS_RANGE=0 still restores the old behaviour. cargo check -p victory-gpu is clean; not re-run in game yet.

The DLAA tie order with identical bounds across modes is left out of this PR, as you noted it is a separate issue.

**@⁠jhon17parizotto-byte** on GitHub · 2026-11-28 02:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/558#issuecomment-7232065120) Thanks, confirmed. Fixed in cd02cc3: the cache keyed by `(output, mode)` now holds only the optimum, minimum and maximum the SDK answered, and the range fallback is decided every frame with the current `camera.render`. No extra SDK queries; `VICTORY_DLSS_RANGE=0` still restores the old behaviour. `cargo check -p victory-gpu` is clean; not re-run in game yet. The DLAA tie order with identical bounds across modes is left out of this PR, as you noted it is a separate issue.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/558/head:github-bot/gh-558'
git switch 'github-bot/gh-558'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-558'
git switch 'github-bot/gh-558'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-558'
git switch 'github-bot/gh-558'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-558'
git switch 'main'
git merge --squash 'github-bot/gh-558'
git switch 'main'
git merge --ff-only 'github-bot/gh-558'
git switch 'main'
git merge 'github-bot/gh-558'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.