GPU: a texture sampled before an in-list title memory copy is uploaded again after it #2297
No reviewers
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!2297
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2297"
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?
@denkencar-sketch on GitHub · 2026-11-25 10:05 UTC · original
denkencar-sketch:fix/host-002→main· +22 −2 · 1 files · 1 commits · openSummary
The list's per-texture first-use set was kept across
defer_copyanddefer, so a later draw skipped the upload of a texture sampled before an in-list title memory copy and read the pre-copy pixels. A title memory copy now makes textures due again. Cost: every later sampled texture is copied again after each title-memory write step; not measured.Testing
Test
a_title_memory_copy_makes_textures_due_againfails onmainand passes with this change.cargo test --workspace --lockedpasses apart from known flakes:modules::dstorage::tests::a_page_list_filled_after_its_request_startsfails now and then onmaintoo, and so does a parallel-run flake invictory-gpu's lib tests (watch::anddescriptor::host::tests, 2 of 40 runs on pristinemain).Not tried: a run in the game.
AI-assisted.
@welisonzika14-jpg on GitHub · 2026-11-25 12:00 UTC · original
First run on NVIDIA hardware here, as far as I can see (the reviews above are static or WARP). RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC, no game files. Head
a5c7e71merged ontomain940d32f,cargo test -p victory-gpu -p victory-shader --lib --no-fail-fast.The PR's test
host::tests::a_title_memory_copy_makes_textures_due_againpasses on this card. The rest is the same asmainon this card: the 5 known NVIDIA failures from #1744 (2 view heap cap tests invictory-gpu, 3 invictory-shader), nothing new.One run, unit tests only, title not run.
Written with AI help (Claude/Kiro); the numbers are from runs on my machine.
@Marvisak on GitHub · 2026-11-25 15:25 UTC · original · edited 2026-11-26 03:23 UTC
Automated triage for the maintainers.
Verdict: needs work. The rebase is clean, but I don't think the change makes a later draw see the copied pixels.
texture::uploadsends a texture again after the copy becausefirst_useis true again, and it pushes a secondStep::Texturefor it.HostList::run_deferredskipsStep::Texture("brought up to date before the submission's lists were made"). The submit path inhost.rscollects every list's texture steps intobindless::uploads, which removes duplicates by staging buffer. That upload list runs before all of the submission's lists, so it also runs before this list'sStep::Copy. The documented shortcut intexture::upload("a title copy into texture memory recorded in the same submission shows from the next one on") still holds.Clearing
deferred.texturesalso clears the odd keys thattexture::alias_copyuses, so alias copies get recorded again after every copy or deferred step. That is extra cost with no test.The new test checks only that
first_usereturns true again, not that a draw reads the post-copy texels. To fix the bug described, the upload would have to be ordered after the copy, for example by a per-step upload or by splitting the submission at the copy. A test that samples the texture after an in-list copy would show it.CI: passing (
check).Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.