GPU: a texture subresource lying wholly in untracked memory is never uploaded #2638
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#2638
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?
@BastienRodz on GitHub · 2026-11-25 17:23 UTC · original
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.github-bot referenced this issue2026-11-26 05:10:56 +00:00
@Marvisak on GitHub · 2026-11-25 18:46 UTC · original
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