gpu: VICTORY_TEXTURE_DROP_MIPS leaves out the largest levels of big title textures #1950
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1950
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1950"
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?
@bekandev on GitHub · 2026-11-29 04:01 UTC · original
bekandev:feat/texture-drop-mips→main· +505 −24 · 5 files · 3 commits · open[pr-feature] gpu: VICTORY_TEXTURE_DROP_MIPS leaves out the largest levels of big title textures
What it changes
On an 8 GB card the textures picked by index stop at the memory budget with thousands more due, and the world shows bare geometry.
VICTORY_TEXTURE_DROP_MIPS=N(0, off by default; at most 4) makes the host copy of a 2D texture the title fills (arrays and cubes included, at least 512 texels on its shorter side, whole 4-texel blocks after halving) begin N levels down, about a quarter of the bytes per level left out. Views shift their levels, copies between such a texture and another go level by level or are skipped, read-backs map to the title's levels, and the copies-between step keeps its arithmetic at N=0.Ported from soldsawn/victory-nvidia-8gb (originally fxceless/victory-fork#610), adapted to this tree's held-level machinery (
copy.base,Staging.first), credited in the code and the README. Off by default: with N=0 every new branch is an identity.How it was tested
8fc2254+ this change + #76.no roomfor the rest of the run.no room.cargo testpassed for the crates it touches: yes. Five pure tests incrates/victory-gpu/src/resource.rs(eligibility rules, the subresource and read-back maps, the view shift against the oldfrom_basearithmetic over 1,008 shapes, views shifting down). On GitHubwindows-latest(my fork):cargo build --workspace --locked --all-targetsok; the only failing test isemit::wave64_tests::nv05d1_native_readlane_gpu_reference, which also fails and passes at random on main (568c5e5) with the same workflow, in a crate this does not touch.Known limits, checked by an independent review of the port: a view of a 2D array held-level texture now shifts like the 2D one did (a correction: before it could name mips the host copy does not have); a droppable placed-view texture that aliases a host-written one loses the alias copy and falls back to the title-memory fill; a copy from a dropped texture into a non-dropped one leaves the dropped levels unwritten (inherent to the size change).
Checked for overlap
@CuteBooty on GitHub · 2026-11-29 20:57 UTC · original
A review of this PR's diff (head
098fb6ba0), plus a port of it that we read in full. The findings below come from reading the source. No game run was made withVICTORY_TEXTURE_DROP_MIPSset, and the PR's own tests are index-arithmetic tests, so none of this is measured. With the switch at 0 the new branches looked like identities to us.The common thread: when a GPU write lands in a texture whose host copy has its largest levels left out, or a texture is read through a path that needs those levels, the data can be lost, and the surface shows black or stale texels.
fillslimits the reduction to textures the title fills, but a GPU-written texture can still reach one through a copy, a resolve, a readback, or an alias in another format.copy_resource/copy_levelsinlist.rs).copy_levelscopies only the levels both host copies have. The destination's level 0 is not written, but as far as we read, the destination is still treated as written by the copy. A later read of level 0 sees old or uninitialized contents.resolveinlist.rs). The operation is skipped when either side is reduced. A 512x512 multisampled source resolving into level 1 of a 1024x1024 destination (host level 0 when one level is dropped) is a valid write that is lost.read_back). The destination buffer is left untouched, so a title that reads back a level the host copy does not have gets whatever the buffer held.aliasintexture.rs). The alias is declined when the drop counts differ, and the fallback uploads from title memory, where the latest GPU writes do not exist. Even the retained levels can read black or stale.In our port we closed the first three by copying from the source box at the source's pitch, resolving into the host level numbering, and preparing every needed source level before the copy writes. For case 4 we retired the reduced copy when a writer over the same memory appears. Those fixes are also unrun. Two limits remain in our port: a write that targets an omitted destination level is still skipped, and retiring a reduced copy does not bring across GPU-only writes it already took.
On the test hardware we use, an RTX 3070 8 GB with a Ryzen 7 5800X3D, 32 GB, Windows 11 26200, driver 621.24, we have not tried this PR in play. We rated it "do not try" for GPU-written textures, on these reading-only grounds. We would be glad to hear if the author has seen these cases in a run.
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.