GPU: back hidden, uncommitted BC1 mips on demand #704
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!704
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-704"
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?
@ryotdev on GitHub · 2026-11-25 05:07 UTC · original
ryotdev:codex/sparse-sampled-mips→main· +693 −2 · 6 files · 1 commits · draftChange
VICTORY_SPARSE_BC1=1lets a restricted BC1 shader resource view use a D3D12 reserved resource when its hidden high-resolution levels have no committed source pages. The default uses the existing allocator.The D3D12 texture retains its original size, format, mip numbering and identity. The initial mapping covers every sampleable level and the entire packed mip tail. A broader view or nonzero source content promotes the missing standard levels on the existing direct queue. Every heap stays alive with its resource. Initial allocation failure falls back to committed backing. If a later allocation fails on a healthy device, resident levels continue receiving updates and the failed wider view cannot replace the last usable view of that resource. This last case does not retry a refused allocation every draw.
The initial scope is internal single-slice, single-sample, read-only BC1 at least 512 texels on each side. Unsupported tilings and any layout that would cost more than conventional backing when fully promoted fall back. #610 deliberately trades away high-resolution detail. #676 improves full-card scheduling and is related but orthogonal.
Windows results
RTX 5070 12 GB, driver 610.88, Series X. I used the same checkpoint, independent copies of a warm cache, matched frame offsets and the same executable within each pair. FPS is 140 frames divided by elapsed wall time in the post-loading window.
Separate instrumented runs observed about 1.4–1.5 GiB less physical backing for the affected textures. The renderer admitted extra resources and whole-process dedicated usage increased, while shared usage fell. The camera, some geometry and surfaces varied across independent loads. Existing visual defects remain. These are checkpoint-specific observations on one adapter. The final source additionally compares the actual held D3D12 object after a rejected promotion to handle irrelevant description padding. This failure case was validated synthetically after the timed runs.
Verification
victory-gputests passed with the switch on and off; four were ignored by the normal runner. Both new process-isolated ignored regressions passed when run explicitly with the switch on. The fixtures check object identity and valid old/new views, later content promotion, allocation failure, descriptor replacement with different padding and resident mip updates.cargo xtask policy --stagedandcargo xtask policypassed. No game data or captures are included.AI-assisted. Further testing on different adapters and additional scenes would help before considering any change to the default.
@CuteBooty on GitHub · 2026-11-25 05:55 UTC · original
It cannot be combined with #610 as written
From reading
770e1940next to #610's 5971e08b; not from a run.sparse_hostcreates the reserved texture at full size, without #610's dropped levels, butdropped()stillreports the drop for that texture. The view level shift in
descriptor/host.rs(shift_view_levels) andStaging::detile(mip + self.drop) would then address the wrong levels: black or wrong textures with bothswitches on.
The smallest guard is to take the sparse path only where
dropped() == 0; a real combination (sparse for thelevels the drop keeps) would be the better end state for 8 GB cards, where the drop is what makes the title usable.
Not tested on this card yet; tiled-resources tier not checked here.
Setup: RTX 3070 8 GB (driver 621.24, 32-lane waves), Ryzen 5 3600, 32 GB, Windows 11, Series X mode, 1920x1080, relay at its default (stage 2), card buffers 1 / 1024 MB, a diagnostics build.
@ryotdev on GitHub · 2026-11-25 06:06 UTC · original
@CuteBooty confirmed on the merged source of
770e1940and5971e08b. Git combines them without a conflict. When a 2048×2048 three-level BC1 resource qualifies for a one-level drop, the committed path makes a 1024×1024 two-level texture. The reserved path instead passes 2048×2048 and all three levels to D3D12. The SRV and staging code both still apply the one-level drop. Please use just one of these switches on this combination. I haven't run both switches on an RTX 3070.Main now has its own opt-in level residency implementation in
8dd30ab(VICTORY_LEVELS_ON_DEMAND=1), including pooled tiles and promotion on upload. This draft conflicts with it inresource.rsandtexture.rs. I'm keeping the draft open for comparison with main's implementation. The RTX results in the description only cover this draft on its pinned base. Thanks for catching the interaction before anyone used both.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.