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

Merged
jhon17parizotto-byte merged 2 commits from upstream-pr/558 into main 2026-11-28 19:39:39 +00:00
jhon17parizotto-byte commented 2026-11-28 00:54:00 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by jhon17parizotto-byte on 2026-11-28T00:54:00Z.


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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5535118229 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/558). Originally posted by [jhon17parizotto-byte](https://github.com/jhon17parizotto-byte) on 2026-11-28T00:54:00Z. --- 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).
ANDREANIADS commented 2026-11-28 01:48:17 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ANDREANIADS on 2026-11-28T01:48:17Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7231927896 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/558#issuecomment-7231927896). Originally posted by [ANDREANIADS](https://github.com/ANDREANIADS) on 2026-11-28T01:48:17Z. --- 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.
jhon17parizotto-byte commented 2026-11-28 02:00:33 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by jhon17parizotto-byte on 2026-11-28T02:00:33Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7232065120 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/558#issuecomment-7232065120). Originally posted by [jhon17parizotto-byte](https://github.com/jhon17parizotto-byte) on 2026-11-28T02:00:33Z. --- 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.
ANDREANIADS commented 2026-11-28 08:13:10 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ANDREANIADS on 2026-11-28T08:13:10Z.


Thanks for the cache fix in cd02cc3a. With a 1920×1080 output and synthetic settings that return a 960×540 optimum and a 1920×1080 maximum, the 1280×720 scene still prints optimal Some([1920, 1080]). A small diagnostic patch reports both values: optimal Some([960, 540]), offered Some([1920, 1080]).

I checked both scene-size orders. Each reused the six cached queries on the second frame. Both versions selected DLAA when all modes reported identical sizes. With standard settings, 1280×720 selected Quality and 960×540 selected Performance. With range fallback disabled, the reduced-optimum fixture rejected 1280×720. Each revision passed 11 frames across six synthetic sequences. This exercised the selection and the CLI message on CPU. Driver acceptance and rendered output remain unverified.

Diagnostic-only patch · Reproduction commands and output

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7236440909 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/558#issuecomment-7236440909). Originally posted by [ANDREANIADS](https://github.com/ANDREANIADS) on 2026-11-28T08:13:10Z. --- Thanks for the cache fix in `cd02cc3a`. With a 1920×1080 output and synthetic settings that return a 960×540 optimum and a 1920×1080 maximum, the 1280×720 scene still prints `optimal Some([1920, 1080])`. A small diagnostic patch reports both values: `optimal Some([960, 540]), offered Some([1920, 1080])`. I checked both scene-size orders. Each reused the six cached queries on the second frame. Both versions selected DLAA when all modes reported identical sizes. With standard settings, 1280×720 selected Quality and 960×540 selected Performance. With range fallback disabled, the reduced-optimum fixture rejected 1280×720. Each revision passed 11 frames across six synthetic sequences. This exercised the selection and the CLI message on CPU. Driver acceptance and rendered output remain unverified. [Diagnostic-only patch](https://github.com/ANDREANIADS/VIctory-NVIDIA/commit/31edc0e52c87ff4947615da4f9d44f0883d85f6c) · [Reproduction commands and output](https://github.com/ANDREANIADS/VIctory-NVIDIA/blob/f45e7ef460999772e723ab31c401a467907be9c6/docs/reviews/2026-11-28/README.md)
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
trustno1-coder/VIctory-NVIDIA!558
No description provided.