Textures keep the room that frame generation already holds: fewer textures load again after eviction #3918
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3918"
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 paales on 2026-11-30T11:34:58Z.
Written by 🤖:
What it changes
With frame generation, the launcher sets
VICTORY_TEXTURE_ROOM_PERCENT=80(86 when it is ready but off) andVICTORY_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 isline_for(budget), the line without frame generation. Confirmed: a present returnedS_OKand Streamline's state reports more than one presented frame, after a first sample (tyr0nsur's commitf2674725). 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: whenVICTORY_SLOT_EVICT_PERCENTis unset, eviction starts at the queue's line. WhenVICTORY_SLOT_EVICT_LOW_PERCENTis unset too, it stops 6 % under that line. Set values hold as before.Textures still load in at scene cuts. In the intro's montage the card is at the line, and new textures wait for memory while eviction makes room. This change lowers how often eviction lets go of a texture that a shader reads again; it does not make new textures load sooner.
The trade: shaders read a texture that eviction let go a fraction as often (with frame generation off, 276 to 1,633 slots against 7,229 to 9,314), the frame time stays the same, and new textures wait 10 to 40 % longer for memory, because eviction starts later and stops higher.
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 % withVICTORY_TEXTURE_ROOM_PERCENT=80in 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
sampledline's "queued again", from the hold to the end).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
f2674725, 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:
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 #3043, #3553 and this change. The code this change touches is the same there as on
main41adb551.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 onmain. 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
slot_evict's plan counts the use; this changes its lines. Git reports a conflict of adjacent lines with each. Both parts stay.VICTORY_SAMPLED_EVICTon by default up to 10 GB): merge cleanly.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mstrmoos on 2026-11-30T12:22:39Z.
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
41adb551plus a stack of other open PRs; the only difference between the runs below is this commit.(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: unsetVICTORY_SLOT_EVICT_PERCENTnow 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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T13:05:04Z.
I checked the initial DLSSG budget transition at
9bab225c.FG_ON_ALLincrements inpresent_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
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by paales on 2026-11-30T14:11:34Z.
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_forthe 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.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 (
f2674725). 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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by paales on 2026-11-30T19:03:40Z.
Written by 🤖:
The combination that I play with now, and what each step did. These runs measure the steps one after the other on one PC, not this PR alone. A bench of each PR alone, on one base with and without it, comes later.
PC: RTX 5070 Ti 16 GB, 32 GB RAM, Windows 11. Series X, 1440p, DLSS Performance.
Build:
main84bd61e2+ this PR + #1727 (HDR10) + #3553 (soft views) + #3043 (BC copies through a buffer) + #4206 (scoped writes, fill ahead).Effective switches that differ from the launcher's:
The launcher sets
VICTORY_SLOT_EVICT=1andVICTORY_TEXSPK_PASS_MS=8.Each run: a new game (settings save, no story save), one A press, the first cutscene for 60 s from its first frame, a screenshot every 5 s. A new build ran once before its measured run, to fill the shader cache and the pipeline library.
VICTORY_TEXSPK_PASS_MS=24(my earlier setting)VICTORY_FILL_AHEAD=1VICTORY_MENU_FPS=30)victory preloadafter a translator change took 2 minutes (25,789 shaders, 1,502 pipelines). Before it, the frames after the title's logo were 1.0 to 2.4 s: pipelines made in the run, at 167 to 234 ms each. After it, 100 to 114 ms.main): in the intro's dialogue, no slot is put to null and read again. Earlier it was 7,000 to 9,000 a run.VICTORY_SOFT_VIEWS=0reads texture memory faster (3.2 against 2.1 GB/s), but the run had 25 seconds with a frame over 100 ms, against 2.What is left, from #3703's line with
VICTORY_LONG_FRAME_MS=50: at each cut, the texture pass (1,460 ms over 56 long frames) and waits for new memory to be resident (944 ms). Textures that are due wait 0.5 to 1.9 frames on average and up to 14: that is the pop-in at a cut.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mstrmoos on 2026-12-01T01:53:36Z.
Thanks for running it. A 16 GB card with frame generation off is the case I had in mind, and your table answers it better than I could: with this PR, textures get read and made again after eviction a fraction as often, the frame time is unchanged, and textures wait longer because eviction starts later. That's a fair trade to state in the PR text.
I won't add a run of my own for now. My bench can't exercise this change:
A route that streams, like your intro with replayed input, is the right test. I haven't built one yet. If I do, I'll run this PR on it with and without, alternated.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Trillazill on 2026-12-01T10:07:54Z.
An A/B of this PR on a 16 GB card at 4K with DLSS frame generation, the case it targets.
VICTORY_TEXTURE_ROOM_PERCENT=80,VICTORY_FRAMEGEN_ROOM_RESERVE=1).5fabb46eand of5fabb46ewith this PR's headc698f177merged (it merged cleanly).VICTORY_KEYS_FILE, 62 five-second lines in the world each. Alternated main, PR, main, PR on one shader cache, after a first start of the PR build for its preload.no room, new textures waitWhat this shows
no roomin 12 checks of 75 instead of 63.Exceeded VRAM budget, device removed ordid not closeline in any of the four runs, and none crashed.What it does not show
VICTORY_SLOT_EVICTlet go 0 textures in all four runs, so this card never reached it, and these runs say nothing about the re-reads after eviction in your table.AI use: Claude Code (Claude Opus 5.5) drove the runs through the game's key file, parsed the logs and wrote this comment.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:47:54Z.
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed