Skip to content

Textures under VRAM pressure: texture pool (#1562), batch-buffer pool (#1441), blurry instead of black, far copies shrink - #1759

Closed
crashoverride1995 wants to merge 4 commits into
trustno1-coder:mainfrom
crashoverride1995:pressure-levels
Closed

crashoverride1995 wants to merge 4 commits into
trustno1-coder:mainfrom
crashoverride1995:pressure-levels

Conversation

@crashoverride1995

Copy link
Copy Markdown

Includes #1562 (Mikael Järvinen) and #1441 (saltdam36). Their commits are in this branch unchanged, with their authors, and two commits of mine follow on top. Merging this merges all of them; the measurements below are of the whole set.

Commit Author What it does
Adaptive 16/8 MiB texture pool, block-aware idle eviction, and pop-in priority Mikael Järvinen (#1562) Texture pool for cards of 12 GB or less
Indirect batches: scratch buffers go to a pool when their list has run saltdam36 (#1441) Fixes the leak of indirect-batch scratch buffers
Textures: blurry instead of black when the card has no room Hitesh Thawani VICTORY_PRESSURE_LEVELS
Textures: copies keep only the levels their slots show while the card has no room Hitesh Thawani VICTORY_SHRINK_FAR

What it changes

On a card that is full, a texture the title picks by index that has no host copy yet waits for room, and draws black (or late, as pop-in) until it gets it. While driving on a 12 GB card the texture queue said "no room, new textures wait" in 70 % of its 5-second checks, with tens of thousands of slots held back every 5 seconds: black sign lettering, blank billboards, roads and leaves popping in late.

  1. Blurry instead of black (VICTORY_PRESSURE_LEVELS, default 2, 0 = off). When the card has no room, a first upload is tried without its largest level, then without its two largest: a quarter or a sixteenth of the bytes. The slot shows the texture at once, a little soft, instead of black. The smaller copy is tried first, so the 5-second first-upload window (shared by every slot of the pass) admits about four times as many textures, instead of a few large ones using it all up. want_level gives the levels back once the card has room again; while it has none, a view of level 0 leaves the small copy as it is instead of sending it back to waiting.
    • Only textures shown by a plain 2D view are reduced, and from_base now moves Texture2DArray views of one-layer textures to the copy's first level too. Without that, a one-layer texture shown as an array by another slot named levels the copy no longer had, and the device was removed about 70 s into a drive.
    • The "reduced" mark is an atomic on the texture (Hosted::reduced). A first version kept it in one table under one lock; every view looked it up, and that cost the submitting thread about 5 ms a frame.
  2. Copies of far textures shrink (VICTORY_SHRINK_FAR, default on, 0 = off). Copies only ever grew: when the title's streaming moved a far texture's views to a smaller level, the host copy kept the large levels. Now, while the card has no room, want_level remakes a copy without its larger levels once no slot shows them any more (lowest level over all slots, first_viewed). The room goes to textures near the player, and the copy grows back when a view asks for the levels and the card has room again.

A new line every 5 s says how many textures are reduced, how many got their levels back, and how many copies shrank, of how many MB.

How it was tested

  • PC: AMD Ryzen 5 7600X (6 cores / 12 threads), 32 GB DDR5-6000, NVIDIA GeForce RTX 4070 Ti 12 GB (VRAM budget about 10.9 GB), driver 610.74, Windows 11 Home 26200.
  • Profile: Series S (720p internal, DLSS upscaling), frame generation off, no ray tracing. Warm pipeline cache.
  • Runs: one save, driving by hand for 3–4 minutes per run on the same stretch of road, with the F3 panel on. Figures are from the 5-second log lines while in the world (frames with 1,000 or more draws).
    • Routes and traffic differ from run to run, and each build was run once, so differences of about 1 fps are noise.
    • The main run was longer (about 10 minutes) and started at night.
Build Card "no room" (5-s checks) Slots held back for room per 5 s (median) Textures given their levels back fps all / medium / heavy Preparing (ms/frame)
main (d4b5d51) 70 % (94/134) 7,958 – 18.9 / 18.3 / 13.8 33.9
+ #1562 51 % (26/51) 13,978 – 17.3 / 18.1 / 15.7 38.2
+ #1562 + blurry 64 % (38/59) 6,264 56 17.0 / 17.2 / 15.5 38.8
+ #1562 + #1441 + blurry 36 % (21/58) 6,391 65 17.2 / 18.2 / 16.9 37.9
+ #1562 + #1441 + blurry + shrink (this branch) 42 % (25/59) 181 1,188 17.9 / 17.9 / 15.9 38.2

Checked for overlap

Credits

mikael-jarvinen and others added 4 commits November 28, 2026 18:38
…PRESSURE_LEVELS)

A first upload the card has no room for is made without its largest level or two; its levels come back once the card has room. Array views of one-layer textures are moved to the copy's levels too.
A host list kept the scratch buffers of its busiest recording for good
(`batch_args` was only pushed to). With about 1,500 lists alive that was
12,719 buffers in eight minutes of play on an RX 7800 XT (16 GB) with
VICTORY_INDIRECT_BATCH=1: 3.2 GB of the card by the system's count
(256 KiB a buffer), past its budget, and 200 ms a frame on the card
from there. No counter saw them, so nothing could let them go.

Now a list gives them back when it is reset (every submission of it
has run, and its last recording left them in the common state), and
the next list to batch takes them, as scratch chunks and preludes
already do. 512 are kept; more than that are retired.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KfgN1FfW7f4Zv2hqXUsNr2
@github-actions github-actions Bot added the pr-performance Pull request: makes it faster or use less memory label Nov 28, 2026
@github-actions github-actions Bot changed the title [pr-performance] Textures under VRAM pressure: texture pool (#1562), batch-buffer pool (#1441), blurry instead of black, far copies shrink Textures under VRAM pressure: texture pool (#1562), batch-buffer pool (#1441), blurry instead of black, far copies shrink Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-performance Pull request: makes it faster or use less memory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants