Repository navigation
Large title textures are made without their most detailed levels when the card is short of room (VICTORY_TEXTURE_DROP_LEVELS) - #1219
Open
Steenax6 wants to merge 6 commits into
Conversation
… up to date (VICTORY_TEXTURE_HOLD_READS) texture.rs `upload` returns early when a texture's staging is uploaded and not dirty. A list that uploads a texture holds its host copy through the transition it records; a list that takes the early return recorded nothing that holds it, though it reads the texture all the same (through a table copied as it is recorded). Nothing but the sweep's idle time then kept the host copy alive between the recording and the moment the list runs, and with VICTORY_ASYNC_SUBMIT a list is sent later than it is recorded. A host copy released under a list not yet sent is a read of memory that is gone when the list runs. The list now keeps the texture until it is reset. VICTORY_TEXTURE_HOLD_READS=0: not held, as before. Where this comes from: Steenax6/VIctory-NVID lost the device in the opening cutscene, 102 to 108 s after the start, in 3 of about 30 runs on an RTX 4070 Ti (the System event log, nvlddmkm id 13: "MMU Fault"). Two things were closed there in one commit (0d45621), this one and a rewrite of view slots under lists in flight that only textures made level by level have; which of the two faulted is not known. A counter there saw 570,000 reads a run of 185 s that no list held. Nine runs through the fault point after it without a loss, frame times unchanged. On this base: compiled, linted and tested (clippy with and without diagnostics, cargo test), not run with the title. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… when the card is short of room The title's textures did not all fit on a 12 GB card beside the targets and the buffer copies: some 22,000 picked by index waited for room in every run, and which ones were there differed from run to run (the first room came up lit in one run and dark in the next). Placed, title-filled, block-compressed 2D textures of 1024 and more a side are now made as reserved textures (tiles.rs) and, past a line of host-copy bytes, without their one or two most detailed levels: their views keep the title's first level and clamp the level of detail, so sizes read by shaders stay the title's. Levels come back while there is room (VICTORY_TEXTURE_PROMOTE_MB). VICTORY_TEXTURE_DROP_LEVELS=0 turns it off; force1/force2 leave levels out whatever the room. Two runs on an RTX 4070 Ti: both lit and complete, 17,458 title textures alive in 2,964 MB (9,521 in 3,932 MB before), no slot held back for room, the card at 8.5 of 10.3 GB, 11-11.8 fps in the first room. show_from no longer lowers the title's level-of-detail clamp when it moves a view: the clamp counts the texture's levels, not the view's. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…tting thread The sweep let go of hundreds of host copies in one call and released each there: for a reserved texture two calls into the kernel (its allocation, its range of the card's address space), 20 ms a frame of the submitting thread in the opening cutscene, and 6 ms for the staging state. They now wait for the next landing and are dropped on the thread that buries (host::retire_later). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…s are not staged With nothing held back for room, the opening cutscene made twice as many host copies and uploaded three times as many, and each cost calls into the kernel: 210 ms a frame against 107 with the levels switch off. - staging buffers up to 64 MiB come from a pool of VICTORY_STAGING_POOL_MB (1024); a reused one is zeroed only if nothing has filled it by its first check; - a texture made without its top levels stages only the levels its upload writes (VICTORY_STAGE_LEFT_OUT=1: all); - a reserved texture let go is unmapped in one call and kept by description for the next one of that shape (VICTORY_RESERVED_REUSE, 4096 kept); - tiles are mapped a heap at a time, not a level at a time; - a reduced texture's views are clamped from their making, so its first upload remakes no slot (slots rewritten under lists already sent are the likeliest cause of the one lost device seen with the levels switch on); - copies without memory of their own wait VICTORY_TILED_IDLE_MS (5000) before the sweep lets them go. Cutscene with the switch on: 210 -> 158 ms a frame (146,047 staging buffers reused, 12,405 made; 12,479 reserved textures reused, 4,817 made). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…slots are remade with nothing in flight Three runs in about thirty lost the device 102-108 s after the start, in the opening cutscene, since textures are made level by level; the driver's log says "MMU Fault": a shader read an address that was not there. Two ways the code allowed that (which one faulted is not known). One is general and is the commit before this series (lists hold the textures they read, VICTORY_TEXTURE_HOLD_READS); the other belongs to textures made level by level and is closed here: a host view slot was rewritten from the texture pass while lists already sent might read it, and widened to a level whose tiles were mapped but whose upload had not run: 15,000 such rewrites a run. A view now follows its tiles only once the submission that gave them has landed (VICTORY_TILED_VIEW_PUBLISH=0: at once, as before), slots are remade by the sweep when no submission is in flight, and a view of a reduced texture changes in its clamp alone (VICTORY_TEXTURE_DROP_VIEWS=keep|shift: the earlier ways). The line "views of textures made level by level" counts the rewrites while submissions were in flight (0 since) and the reads lists now hold. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…(VICTORY_TEXTURE_DROP_LEVELS) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
fxceless
added a commit
that referenced
this pull request
Nov 26, 2026
… under a submission in flight; VICTORY_VIEWS_REMADE_QUIET=1 puts the pass off (off by default) texture_views_remade writes live slots of the heap the card reads, at a moment of the layer's own choosing: a list already sent may be reading the slot (Direct3D 12 wants such a descriptor left alone until the list has run). Fork PR #1219's author lost the device that way (with a driver event, which ours lack). Now every 1,024 slots made again a line says how many were made with a submission in flight; with the switch the pass waits until none is, and what is due stays due. Whether this is behind the losses here is not known. Not run in a game. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
dkdknight
pushed a commit
to dkdknight/victory-fork
that referenced
this pull request
Nov 26, 2026
… under a submission in flight; VICTORY_VIEWS_REMADE_QUIET=1 puts the pass off (off by default) texture_views_remade writes live slots of the heap the card reads, at a moment of the layer's own choosing: a list already sent may be reading the slot (Direct3D 12 wants such a descriptor left alone until the list has run). Fork PR fxceless#1219's author lost the device that way (with a driver event, which ours lack). Now every 1,024 slots made again a line says how many were made with a submission in flight; with the switch the pass waits until none is, and what is due stays due. Whether this is behind the losses here is not known. Not run in a game. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit 4679615)
mrtacoguy01
added a commit
to mrtacoguy01/victory-fork
that referenced
this pull request
Nov 26, 2026
…issing textures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On a 12 GB card the title's textures do not all fit beside the targets and the buffer copies. In our runs some 22,000 textures picked by index waited for room in every run, and which ones were there differed from run to run: the first room came up lit in one run and dark in the next.
Placed, title-filled, block-compressed 2D textures of 1024 and more a side are now made as reserved textures (
tiles.rs, the machinery ofVICTORY_LEVELS_ON_DEMAND) and, past a line of host-copy bytes, without their one or two most detailed levels. Their views keep the title's first level and clamp the level of detail, so the sizes shaders read stay the title's. Levels come back while there is room (VICTORY_TEXTURE_PROMOTE_MB).VICTORY_TEXTURE_DROP_LEVELS=0turns it off;force1/force2leave levels out whatever the room.This is a different answer to the same shortage than spilling into system memory or the Series S profile, and it does not exclude either.
Commits
The first commit is #1218 (lists hold the textures they read); this branch is stacked on it, and it drops out of the diff once that one is merged. Then:
show_fromno longer lowers the title's level-of-detail clamp when it moves a view (the clamp counts the texture's levels, not the view's).host::retire_later): the sweep let go of hundreds of host copies in one call, 20 ms a frame of the submitting thread in the cutscene for reserved textures, 6 ms for staging state.VICTORY_STAGING_POOL_MB(1,024), a reused one zeroed only if nothing has filled it by its first check; reserved textures kept by description (VICTORY_RESERVED_REUSE); tiles mapped a heap at a time; only the levels an upload writes are staged (VICTORY_STAGE_LEFT_OUT=1: all). 210 -> 158 ms.VICTORY_TILED_VIEW_PUBLISH=0: at once), slots are remade by the sweep when no submission is in flight, and a view of a reduced texture changes in its clamp alone (VICTORY_TEXTURE_DROP_VIEWS=keep|shift: the earlier ways).Measured (in our tree, RTX 4070 Ti 12 GB, Ryzen 7 9800X3D)
=0is dark again.What I can and cannot say for this tree
cargo clippy --workspace --all-targets --lockedand the same with--all-featuresgive exactly the warningsmaingives (11 there, none new).cargo test --workspace --locked: the tests of the modules touched pass;indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fieldsfails here onmainas well, and two WARP tests inwatch.rs/inplace.rsfailed once in a full run and pass when run by name (other builds were running on the machine). The tests oftiles.rscover the view shapes and the publish order on the software adapter.texture.rs: this tree'sVICTORY_STAGING_POOL=altis kept, the pool's sizes are the new ones. In our tree commit 3 also carried hooks for placed textures (Host textures of placed textures come out of 64 MiB heaps (VICTORY_PLACED_TEX=1, off by default) #903, not ours, still open here); they are taken out, so this stands without it.🤖 Generated with Claude Code