GPU: a texture subresource lying wholly in untracked memory is never uploaded #2636
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-25T17:23:32Z.
What happens
Since
280b150, a change tracker leaves untracked any 64 KiB page that touches memory other than the runtime's. Such parts are "copied whole at each use" (watch.rs,Tracked::untracked), and such a tracker is "never clean". Buffer copies follow this;shadow::tests::bytes_off_the_runtimes_memory_are_copied_at_each_usechecks it.Texture staging does not.
Staging::refresh_now(texture.rs) asks onlyTracked::takefor changed pages, and sincecc5f961it reads and re-detiles only the subresources those pages touch. A subresource whose bytes lie only in untracked pages is therefore never touched, so it is never uploaded, not even at the first refresh, and its host texture keeps its initial (zero) contents. Beforecc5f961, the first refresh read the whole texture.Example: a linear RGBA8 128×128 texture with two mips, placed at
p + 48 KiB, where[p, p + 64 KiB)is only reserved (the runtime's) and[p + 64 KiB, p + 128 KiB)is plain committed memory. The first submission uploads mip 1 only. Mip 0 is never uploaded, even after the title writes it.Expected
As for buffer copies: untracked parts are read at each refresh, and their subresources are uploaded at first and whenever their bytes change.
Where
crates/victory-gpu/src/texture.rs,Staging::refresh_now: therangesfromt.take(..)and thetouchedfilter.280b150measured no memory copied whole in boot-to-world runs, so like that commit this is about robustness. AI-assisted (Claude Opus 5.5 found it, Claude Code reviewed and verified it); synthetic test only, no game data.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T18:46:46Z.
Automated triage for the maintainers.
Confirmed in main (
13f91ca):Staging::refresh_nowincrates/victory-gpu/src/texture.rsbuilds its candidate ranges only fromt.take(start, start + size), and thetouchedfilter keeps only subresources that overlap those ranges. Untracked parts are never consulted there (unlike buffer copies), so a subresource lying wholly in untracked pages is never read or uploaded.Fix PRs: #2639 (open, by the reporter) adds
t.untracked(..)ranges as candidates and keeps the whole-page shortcut for tracked pages only. #2689 was closed unmerged as a duplicate of #2639, so nothing for this issue is in main yet.Generated by Claude Code