Skip to content

Textures keep the room that frame generation already holds: no gray flicker in cutscenes on a 16 GB card - #3918

Open
paales wants to merge 2 commits into
trustno1-coder:mainfrom
paales:fg-room-once
Open

paales wants to merge 2 commits into
trustno1-coder:mainfrom
paales:fg-room-once

Conversation

@paales

@paales paales commented Nov 30, 2026 •

Copy link
Copy Markdown

Written by 🤖:

What it changes

With frame generation, the launcher sets VICTORY_TEXTURE_ROOM_PERCENT=80 (86 when it is ready but off) and VICTORY_FRAMEGEN_ROOM_RESERVE=1: a fifth of the budget stays free for frame generation. DLSS Frame Generation keeps its resources while it is off (DLSSG_RETAIN_RESOURCES_WHEN_OFF). Once it has presented, they are in the card's use, and the budget that the system reports is the one with frame generation on. On an RTX 5070 Ti at 1440p, at the first present the use went from 10,689 to 11,029 MB and the budget from 15,227 to 14,033 MB. The fifth (2.8 GB there) then keeps the same memory free a second time.

Slot eviction starts at min(VICTORY_SLOT_EVICT_PERCENT, the queue's line), 85 when unset, and stops at most at 75 %. With the fifth, it ran between 78 and 72 % of the budget. In the intro's dialogue the camera cuts between two faces every 5 to 10 s. Eviction let go of textures of the face that was off screen, a shader read them again at the next cut, and each one showed the neutral texture until it was made again. The player sees textures go gray and load again within a few frames.

Now:

  • room_line: with the launcher's share (VICTORY_FRAMEGEN_ROOM_RESERVE), once DLSS Frame Generation is confirmed (streamline::framegen_made), the line is line_for(budget), the line without frame generation. Confirmed: a present returned S_OK and Streamline's state reports more than one presented frame, after a first sample (tyr0nsur's commit f267472). Until then the share holds. A resize, a rearm or a new swap chain brings the share back until the next confirmation. A percent that the player sets (F1 menu or --set) holds as before, because the launcher then sets no share. FSR frame generation keeps the share.
  • slot_evict_settings: when VICTORY_SLOT_EVICT_PERCENT is unset, eviction starts at the queue's line. When VICTORY_SLOT_EVICT_LOW_PERCENT is unset too, it stops 6 % under that line. Set values hold as before.

On a card of 8 GB with frame generation, the line after the first present is 90 % of the budget (line_for), where it was 80 %. I did not test this on an 8 GB card. A player can keep 80 % with VICTORY_TEXTURE_ROOM_PERCENT=80 in the F1 menu.

How it was tested

  • GPU and profile: RTX 5070 Ti 16 GB (budget 14.0 to 14.6 GB with frame generation on), 32 GB RAM, Windows 11; Series X 2560x1440, DLSS Performance, DLSS frame generation 2X, ray tracing off; VICTORY_SLOT_EVICT=1 (launcher), VICTORY_SAMPLED_EVICT=1, VICTORY_SOFT_VIEWS=1. Each run: the intro with replayed input, A held to skip the first scene, about 100 s from the hold into the boat scene, saves restored first. Launcher defaults for the texture and eviction lines in both builds.

  • Flicker: slots picked by index that eviction put to null and that a shader read again (the sampled line's "queued again", from the hold to the end).

    runs slots read again after eviction card's use, most frames over 100 ms
    before (lines 78 and 72 %) 6 7,767 to 9,282 11.9 to 12.1 GB 36 to 108
    after (92 and 86 % after the first present) 3 1,796 to 1,967 13.8 to 14.0 GB 43 to 102
  • The card stayed under its budget in every run.

  • Textures that show the neutral texture (due plus waiting for their memory, slot-seconds from the hold): 72,000 to 140,000 before, 59,000 to 110,000 after. This number varies much between runs of one build.

  • With f267472, one run: the share went after the first generated frames (Streamline's state: 6 frames presented a query), the card's use rose to 13.8 GB, slots read again 1,002, textures waiting 56,635 slot-seconds, 107 frames over 100 ms.

  • Frame generation off in the F1 menu (the launcher sets no share; eviction lines 85 and 75 % before, 92 and 86 % after), 3 runs each, alternated:

    before after
    median frame 25.9 to 26.2 ms 25.8 to 26.7 ms
    frames over 100 ms 48 to 71 45 to 75
    preparing, mean of the fps lines 28.8 to 31.5 ms 31.4 to 33.2 ms
    slots read again after eviction 7,229 to 9,314 276 to 1,633
    textures waiting, slot-seconds 106,835 to 110,080 118,850 to 149,700
    card's use, most 12.9 to 13.0 GB 13.6 to 13.7 GB

    Without frame generation, textures wait for memory 10 to 40 % longer: eviction starts later and stops higher. Sweeps of 1,024 MB (VICTORY_SLOT_EVICT_MB) gave no clear gain, with or without frame generation.

  • Build of these runs: v2026.11.29.04 with gpu: bounce cross-format CopyTextureRegion and CopyResource through a temporary buffer (#2914) #3043, Soft views: DirectStorage reads into memory the title mapped write through the section's view #3553 and this change. The code this change touches is the same there as on main 41adb55.

  • For shader changes, the wave sizes tested: no shader change.

  • cargo test -p victory-gpu --lib: 923 passed, 1 failed: shader_cache::tests::every_switch_of_the_translator_is_in_the_key, which also fails on main. New tests: the_frame_generation_share_goes_once_dlss_frame_generation_has_presented, budget_waits_for_generated_frames_on_the_current_swap_chain.

Checked for overlap

DLSS Frame Generation keeps its resources while it is off, so once it has presented they are in the card's use and the budget is the one with it on. The launcher's share for it (a fifth of the budget) then counted it twice, and slot eviction, whose high line stopped at 85 %, let go of textures in use far under the texture queue's line: in a cutscene they turned gray and loaded again. The share now holds until frame generation has presented, and unset eviction lines follow the queue's line.
PranThow added a commit to PranThow/VIctory-NVIDIA that referenced this pull request Nov 30, 2026
PranThow added a commit to PranThow/VIctory-NVIDIA that referenced this pull request Nov 30, 2026
…ation already holds: no gray flicker in cutscenes on a 16 GB card

# Conflicts:
#	crates/victory-gpu/src/resource.rs
@mstrmoos

Copy link
Copy Markdown

A data point from a different setup, in case it helps: RTX 5080 16 GB, 9800X3D, Series X profile, 1440p output, DLSS Balanced, frame generation off. Same 150 s route each run, settings file unchanged between runs. Built on 41adb55 plus a stack of other open PRs; the only difference between the runs below is this commit.

build median frame CPU preparing copies' "MB unmapped" a frame fallbacks a frame
without #3918 32.8 ms / 34.3 ms (two runs) 24.1 / 25.4 ms 0.01 / 0.10 0.1 / 0.4
with #3918 39.1 ms / 73.1 ms (two runs) 28.1 / 67.9 ms 7.11 (second run) 5.5 (second run)

(The "unmapped" and "fallbacks" figures are from the copies per frame: line of the diagnostics log.)

With frame generation off, framegen_made() never becomes true, so if I read it right the visible change on this setup is the eviction defaults: unset VICTORY_SLOT_EVICT_PERCENT now follows the texture queue's line instead of 85 %, and the low line is that less 6 instead of less 10. A narrower band near the top would fit eviction running more often in smaller steps, which is what the unmapping figure looks like. Keeping the old 85/75 defaults when frame generation has not presented might avoid it, but I have not tested that.

Use successful present and Streamline readbacks to distinguish allocation from an attempted frame. Preserve the reserve during the first sample and restore it when a swap-chain resize or rearm can discard the resources.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@tyr0nsur

Copy link
Copy Markdown
Contributor

I checked the initial DLSSG budget transition at 9bab225c. FG_ON_ALL increments in present_begins, after accepting SetOptions (including warning 39), before DXGI Present or a Streamline state read. It can therefore remove the automatic reserve after a refused or non-generating present. It also survives a resize or rearm, which sends Off without the retain flag.

The follow-up requires the final DXGI Present (including the tearing retry) to return S_OK and Streamline to report a healthy generated frame count after a baseline sample. The baseline matters because the count covers the interval since the previous query. The confirmation survives ordinary Off with retain, and clears on resize, rearm and swap-chain replacement. It uses the existing state query and leaves the user-selected percentage path intact.

The synthetic test reproduces the early true value on the PR head. The companion tests cover rejected, occluded and out-of-VRAM samples, native-only frames, retention and reset. At a synthetic 7,000 MiB DXGI budget the automatic increase is 700 MiB, so the ordering carries more weight on the 8 GB configuration. The focused diagnostics suite passed 99 tests. This has not been measured in a title run.

Companion commit · NVIDIA Streamline DLSS-G guide

moritz-eckhard-nickel added a commit to moritz-eckhard-nickel/VIctory-NVIDIA that referenced this pull request Nov 30, 2026
…follow the texture queue's line

Our VICTORY_FG_ROOM_ONCE (framegen_counted) already lifts the launcher's frame-generation
share once its memory is in the card's use, so trustno1-coder#3918's room_line change and framegen_made
are left out. Kept: VICTORY_SLOT_EVICT_PERCENT unset no longer means a fixed 85 %, which
let go of textures in use under a higher queue line (gray textures in cutscenes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paales

paales commented Nov 30, 2026

Copy link
Copy Markdown
Author

Written by 🤖:

@mstrmoos I ran your case on the RTX 5070 Ti: frame generation off in the F1 menu. The launcher then sets no share, the queue's line is line_for the budget, and slot eviction runs between 92 and 86 % with this change, between 85 and 75 % without it. Each run: the intro with replayed input, about 100 s from the hold, 3 runs a build, alternated, saves restored first.

frame generation off without #3918 with #3918
median frame 25.9 to 26.2 ms 25.8 to 26.7 ms
frames over 100 ms 48 to 71 45 to 75
preparing, mean of the fps lines 28.8 to 31.5 ms 31.4 to 33.2 ms
slots read again after eviction 7,229 to 9,314 276 to 1,633
textures made again after eviction 7,480 to 11,716 286 to 1,836
textures waiting, slot-seconds 106,835 to 110,080 118,850 to 149,700
card's use, most 12.9 to 13.0 GB 13.6 to 13.7 GB

The frame time did not go up here. Two costs: textures wait for memory 10 to 40 % longer, because eviction starts later and stops higher, and preparing was 1.7 ms higher on average (the ranges touch). My release build has no copies per frame: line, so I have no numbers for "MB unmapped" or fallbacks. Eviction makes each texture again from title memory: the row "textures made again" counts those reads.

I also tried sweeps of 1,024 MB (VICTORY_SLOT_EVICT_MB) as the default for this change. Textures waiting, slot-seconds: without frame generation 79,680 to 135,180 (3 runs); with frame generation 77,305 to 134,725 (3 runs) against 58,620 to 110,175 with 256 MB (6 runs). No clear gain, so the default stays 256.

@tyr0nsur I took the commit (f267472). The state query runs after every present while frame generation is on, so the share goes two presents after the first generated frame. After a resize or a rearm the share comes back until frame generation presents again. The sweep runs once a second, so that costs at most one eviction sweep. One run with frame generation on and the commit: the card's use rose to 13.8 GB after the first generated frames; slots read again 1,002, textures waiting 56,635 slot-seconds, 107 frames over 100 ms, all in the range of the runs without it. cargo test -p victory-gpu --lib: your test passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants