vkback: refresh textures over a page remap's destination ranges (VKB_REMAP_REFRESH) #184
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/vktory6--VKtory!184
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-184"
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?
@lordra9-svg on GitHub · 2026-12-02 01:32 UTC · original
lordra9-svg:fix/remap-refresh→main· +67 −8 · 3 files · 1 commits · openWhat
Refresh the watched textures over a page remap's destination ranges when the remap is reached, so a texture whose pages a remap just supplied stops showing zeros (partly filled) until an unrelated WRITTEN event.
Why
refresh::title_written()(marks watched textures dirty, refilled from title memory) was called only on the PEWRITTENevent. Page remaps (live::remap_front->maporder::reached) never called it, andreacheddiscarded the remap's destination ranges. So a partly-filled texture stayed partly filled after its pages were remapped in.Change
maporder::reached(seq)returns the remap's destination ranges instead of dropping them (all counters/bookkeeping kept).live::remap_front: after the remap is reached, callbe.title_written(&ranges)(renderer thread, once per remap) -- but only when the present did not give up waiting (mapped), so it never reads pre-copy zeros and marks a texture clean.VKB_REMAP_REFRESH(default on;0= current behaviour), owner/reason/removal documented; WRITTEN path andrefresh_dirtybudgets unchanged.Measured (RX 7800 XT, combined with the tex-parity counter)
Partly-filled images sampled by draws,
VKB_REMAP_REFRESHoff vs on, 300 s world runs:No device loss; fps unchanged (~26). The first pair's larger drop was confounded by heavier streaming in the off run.
Honest scope: the remaining partly-filled samples are pages that are not remapped at all in the run (streamed out / never resident); this fixes only those a remap supplies. Modest but correct improvement, default-on with no measured cost.
Verified
cargo test -p vkback --lib: 169 passed (newmaporder::reached_returns_registered_ranges), policy 6 passed, clippy-D warnings;tools/build.shexit 0.@vktory6 on GitHub · 2026-12-02 16:02 UTC · original
Thanks, refreshing textures over a remap's destination ranges is closer to the console (the pages are there once the remap is reached), and the parity counter shows the effect. Two notes before merging:
maporder::reached. I'll merge holdfrees first, then this and #218 rebased on it, so the three don't fight. I'll do the rebase if it's mechanical.VKB_REMAP_REFRESH=0restores a behaviour we know is wrong, so it's an A/B switch with a removal condition. Please write that condition in the comment: removed once a validation run and the gates pass with it on.@TheRifai on GitHub · 2026-12-02 16:23 UTC · original
Local A/B data on current main
bc86e65for this switch (RX 9070 XT / RADV 26.3.1, GE-Proton11-16, Series X 3840x2160, boat saveboatsave-profile, warm store, 90 s each, no validation in either arm):VKB_REMAP_REFRESH=1No new VUID or loud kind,
LIVE_NOT_TITLEstayed 16, and the two runs had the same 10 rule-32 wave-wide lines. So on this scene the refresh path is slightly slower (~0.3 fps), not a measurable win; not a criticism of the correctness fix, just no local perf reason to default it on. Evidence:/home/shlong/Documents/VKtory-capture/hunt-{boatbase,boatremap}/.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.