Preserve DLSS Frame Generation inputs through presentation #1978
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1978"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by SkivHisink on 2026-11-29T05:39:14Z.
Related to #1917.
What it changes
VICTORY_FRAMEGEN_SNAPSHOT=1. The snapshot pool is capped at eight pairs.How it was tested
0x0.Checked for overlap
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Yoshi-233 on 2026-11-29T07:20:56Z.
I tested the snapshot from
eff3eb293on an RTX 4070 Ti SUPER, driver 617.42, with 2560×1440 input, 3840×2160 output and DLSS FG 2×. I alternated direct/snapshot tagging every 20 seconds in one process and verified which path reached present with separate counters. The WARP lifetime test also passes on the backport.I recorded three matched-length camera pans per setting on a porch with a sliding door and foliage. During the six 4.7-second pans the renderer submitted 43–52 frames each, while a high-rate physical capture saw 89–109 distinct center-region images each. Streamline reported 2× in the sampled intervals of every pan. The first three captures also overlapped 94, 86 and 99 Windows presentation events, respectively.
The picture result is mixed on this scene. After registering moving edges and matching direction and speed, five of eight cross-setting pairs had lower temporal edge error with snapshots, while three had higher error. Camera paths varied slightly between pans. The path ran with generated output here. Reproduction of the reported 4090 grain on this card remains open.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by SkivHisink on 2026-11-29T08:20:20Z.
On my RTX 4090, I reproduced the visible grain and flicker during camera turns with DLSS Quality and FG 2× at 2560×1440. I went back to the same spot with the earlier snapshot test build and the grain was gone with FG still running at 2×. Streamline logged 34 presents and 68 displayed frames in one sampled interval. An independent report of the camera-turn flicker on upstream came from a player on an RTX 5060 Ti. See #1917.
The mixed temporal edge-error results on the 4070 Ti SUPER describe a different scene and a different measurement. A direct cross-check of the grain would start with a scene where it visibly reproduces on the stock path, then switch only the snapshot tagging while keeping FG at 2×.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Yoshi-233 on 2026-11-29T09:43:18Z.
Thanks, @SkivHisink. Which checkpoint or landmark did you use on the 4090, and what were you panning past when the grain was easiest to see? That would let me match the view on my 4070 Ti SUPER and toggle only snapshot tagging at 2560×1440, DLSS Quality, FG 2×.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Kassiter on 2026-11-29T10:26:30Z.
Root cause, from a bisect of the same grain (RTX 4080 16 GB, Series X, 2560×1440, DLSS Quality, DLSS FG 2×). It may help with the mixed results above and with picking a default.
It comes from #1147's render-target aliasing (alias_rt). We bisected main between
63b902f(clean) ande1f2eb6(grain), first-parent and judged in game. The last clean step was7463e5eand the first with grain1da44b0. That leaves #971, #328 and #1147, which don't build on their own. With VICTORY_ALIAS_TARGETS=0 one1f2eb6, everything else unchanged, the grain was gone.Why: on the console, depth and motion vectors are transient targets in the physical page pool, and nothing reads them after the upscale, so later passes of the frame reuse their 64 KiB pages. #1147 copies that onto the host with reserved resources on shared Tier-2 heap tiles. Frame generation reads depth and motion at the present, after those passes, so generated frames get whatever was written to those pages last. Rendered frames are fine, which is why screenshots don't show it, and it fits the windowed-mode report in #1917.
What that means for this PR:
The snapshot is the right fix, and it's needed whenever aliasing is on (the default). That argues for the snapshot being on by default, or at least on when alias_rt::on(). Otherwise everyone with FG and the default aliasing sees the grain.
It can be limited to aliased inputs. HostTexture::aliased_rt says whether the depth or motion texture is on shared tiles. Copying only those skips the copies when aliasing is off or falls back to committed (tile count, MSAA, section size). We did that in our fork, copying at note() into two of our own textures in turn and tagging Source::Fixed(copy, COPY_DEST). It's in game-tested commit 4f7e5a1 on https://github.com/Kassiter/VIctory-NVIDIA/tree/gpu-detile-upstream if a second reference helps. Yours handles discarded recordings and fences, which ours doesn't.
For A/B runs: whether a scene shows the grain depends on whether its depth and motion actually landed on aliased tiles and got overwritten before the present. That may explain why one scene shows it clearly and another gives mixed numbers. VICTORY_ALIAS_TARGETS=0 against =1 with the snapshot off makes a clean control, and the aliased RT … debug names on the textures show which inputs are aliased.
Caveat: this was on
e1f2eb6. Main has since changed alias_rt (e.g.bf8a6d6b, physical-page ownership for aliasing barriers), and we haven't checked current main.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by SkivHisink on 2026-11-29T12:28:51Z.
Follow-up on the RTX 4090 repro after the merge. I tested at 2560×1440 output with DLSS Quality and FG set to 2×. These were local test builds from the PR worktree.
B3 and B4 used the same executable. B3 selected the snapshot pair automatically. B4 used
VICTORY_ALIAS_TARGETS=0and forced the pair withVICTORY_FRAMEGEN_SNAPSHOT=1. Streamline confirmed that both depth and motion snapshots were tagged in both runs. This agrees with Kassiter's aliasing toggle result. With aliasing enabled here, snapshotting both inputs still left visible artifacts.The counts are Streamline log intervals with FG enabled throughout. In B4, 82 intervals reported exactly 2×, 73 reported 1×, and 7 had mixed ratios. One B4 interval reported 12 presents and 24 displayed frames. These summaries cover the recorded run segments independently of the visual checks. There were no snapshot-pool exhaustion warnings in these four runs.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by SkivHisink on 2026-11-29T12:33:30Z.
@Yoshi-233 The grain was easiest to see along object edges while turning the camera. I don’t have the exact checkpoint or landmark to share yet.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by SkivHisink on 2026-11-29T12:35:06Z.
@Kassiter Thanks for the bisect. One detail to add to my test results above: the local B3/B4 build already included
bf8a6d6b. On my RTX 4090, the edge grain persisted in B3 with aliasing on and both depth and motion snapshots tagged. In B4, disabling aliasing while forcing the snapshot pair cleared both grain and flashes. The aliasing-off run with direct tags is still untested on this build.GitHub returns 404 for both your
Kassiter/VIctory-NVIDIAfork and thegpu-detile-upstreambranch from my account. Could you share an accessible link to4f7e5a1or the patch?Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Kassiter on 2026-11-29T12:59:38Z.
@SkivHisink
@SkivHisink Sorry, the fork is private. Here's the patch, rebased onto current main (
829188e9). It's one file,crates/victory-gpu/src/streamline.rs.What it does differently from your snapshot:
note(), i.e. when the upscale is recorded, before DLSS evaluates. So the copy sits in the same host list, right behind the title's last write to depth and motion.HostTexture::aliased_rtis set (VICTORY_FRAMEGEN_HOLD_INPUTS=1, the default).=2copies always,=0never.COPY_DEST.The caveat that matters for your table: we verified it in game only on
e1f2eb6, which is beforebf8a6d6band the otheralias_rtchanges. There it removed the grain completely with aliasing on. On current main we haven't confirmed it yet; that test is running now.Your B3 result, with grain and flashes still there with both snapshots on, suggests that on current main aliasing corrupts more than frame generation's inputs. #1976 ("Transient RT aliasing leaves warm memory visible (bright image, coloured sparkle on reflections)") sounds like that second problem. Your bright flashes would fit stale tile contents showing up in the rendered frame itself, not only in generated ones. If so, the snapshot fixes the part that's specific to frame generation, and the rest needs a fix in
alias_rt. A quick way to separate the two: an A2-style run with frame generation off and aliasing on. If the flashes are still there, they're not about frame generation.Patch (git am)
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T13:05:17Z.
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch
janus-prs, on top of829188e9plus a couple of local fixes). Read the full diff first: no network, process spawning, binaries, build/CI/dependency changes or game data. Builds with--profile diag --features diagnostics; merged as-is (2 files,VICTORY_FRAMEGEN_SNAPSHOToff by default); the WARP test passes. Frame-generation runs on an RTX 4090 need the window in the foreground on our side, so those numbers will come a bit later.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by SkivHisink on 2026-11-29T16:49:09Z.
@Kassiter I tested the copy timing from your patch in B5 on my RTX 4090. Both runs used 2560×1440, DLSS Quality, FG set to 2×, and RT aliasing enabled. I kept B3's snapshot pool and copied both depth and motion in both runs.
Streamline reported exact 2× in 49/73 intervals for B3 and 39/56 for B5, counting intervals with at least one FG-enabled present. Restricting the totals to intervals with zero FG-off presents gives 49/70 and 39/53. Neither run logged snapshot-pool exhaustion.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by CubeB on 2026-11-29T17:18:05Z.
Tested this PR with
VICTORY_FRAMEGEN_SNAPSHOT=1on an RTX 5070 Ti / 9800X3D, Windows 11, Series X profile at 1440p, DLSS Quality, DLSS-FG 2x. It was on top of the foxhound base plus a few other PRs. I found two things.1. When the pool runs dry, FG switches off for the rest of the run.
note()returns whensnapshot_fg_inputsgivesNone, so that upscaling is never noted.all input snapshots are in flightonce, about a second after FG came on. FG then stayed off for all 7 minutes of play (0 of the presents had it on).This fallback fixed that for me: tag the live depth and motion, as the switch-off path does.
With it, a 27-minute run had FG on in 99% of gameplay intervals: about 21 fps rendered and about 43 fps shown.
2. The snapshots seem never to come back, so the pool is exhausted almost permanently.
so_far=32768over that 29-minute run.SNAPSHOT=0.fg_snapshotonly reuses an entry whenArc::strong_count == 1. My guess is that something keeps a clone alive past its present, such as the noted upscaling or a per-present record that is never dropped. I haven't confirmed which.Logs available if useful.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by CubeB on 2026-11-29T23:01:40Z.
Follow-up to my earlier comment about the snapshot pool running dry: I found who holds the
Arc<FgSnapshot>clones.Deferred::clear()resets every per-list record exceptfg_snapshots, so a pooled host list keeps every snapshotkeep_fg_snapshotgave it, and the 8 slots are all held about 30 s into a run.The fix is one line,
self.fg_snapshots.clear();besideself.kept.clear().HostList::resetruns only after the list's last submission has finished, and the present path holds its own clone, so it is safe there. I opened it against this PR's branch: SkivHisink/VIctory-NVIDIA#1. Built andvictory-gputests pass on my fork on top of this PR; not yet play-tested with frame generation.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Yoshi-233 on 2026-11-30T01:09:46Z.
@SkivHisink Thanks, that answers my question about where to look: the moving silhouette against the background during a camera turn. My earlier 4070 Ti SUPER pans had mixed edge-error results, and I don’t have a matching checkpoint or a new run to report. Your B3/B4 comparison also makes it worth recording the RT-aliasing setting explicitly in any follow-up on my card.