GPU: bind texture readback to recorded mapping #63
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/DexNom--VIctory!63
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-63"
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?
@Cuebert on GitHub · 2026-11-26 02:28 UTC · original
Cuebert:fix/texture-copyback-mapping→main· +143 −16 · 3 files · 1 commits · openI found a lifetime gap in the texture readback path.
texture_writtenretained the resource, buttexback::recordcaptured the guest mapping ticket only when the command list closed. If the guest remapped the address between recording the GPU writer and closing the list, the later copyback could target the replacement pages.This change captures the
ResourceRef, layout, guest range andReadbackMappingwhen the first writer is recorded. The deferred copy uses that same target and the existing mapping check rejects a stale landing. I kept the copyback behavior and the existing overlap policy intact.The original water texture copyback came from Geckomacabre’s
vx-layerwork (commit); the related VIctory integration is fxceless/victory-fork#999. This PR carries that existing path forward and adds recorded-mapping lifetime protection.I added a Windows D3D12 WARP regression that records a texture writer, remaps the guest address before list close, and checks that replacement bytes survive while ordinary writes still copy back. The supplied validation record reports the focused fixture passing in synchronous and late stage 3 modes. This is synthetic validation; I have not verified a title or gameplay effect.
Could you review whether capturing the mapping at first writer is the right lifetime boundary for this path?
@Artking175 on GitHub · 2026-11-26 05:22 UTC · original
I reproduced this with
eefae24on RTX 2060 / driver 531.41 and WARP. I selectedVICTORY_TEXTURE_BACK=64x64f16and testedVICTORY_LATE_WAIT=0and3on both adapters. All four runs passed with the PR. Keeping the fixture and reverting the productionhost.rsandtexback.rschanges made all four fail at “the old list overwrote replacement pages”.That supports the first recorded writer as the lifetime boundary for one retained target in this fixture. The test also verifies a later command list can write the replacement mapping. The per-resource dedupe retains the first ticket for the entire list, so the same-list case with a second writer after remapping will need a separate policy if it should publish to the new pages. My test used the PR head based on
2e01ab4.@Cuebert on GitHub · 2026-11-26 06:03 UTC · original
Thanks for running the RTX 2060 and WARP matrix, and for calling out the same-list case. Your results independently support the first recorded writer as the target identity for this fixture.
I agree the current per-resource dedupe keeps the first target until list close. If the guest remaps and records another writer to the same texture before that list closes, this patch does not retain a second target or promise publication to the replacement pages. The regression covers rejecting the stale landing and a successful write from a later command list; it does not cover a second write in the same list. I’ll keep that limitation explicit and avoid claiming same-list replacement behavior. A follow-up should add a fixture that records both writers around the remap before closing one list.
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.