perf(texture): stream large BC tile bands into mapped staging #659
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/lobomfz--VIctory-xmem!659
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-659"
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?
@tommiehansen on GitHub · 2026-12-06 01:36 UTC · original
tommiehansen:perf/phase13-bc-band-stream-20261206→main· +513 −6 · 3 files · 9 commits · openWhy
Large BC texture uploads can spend substantial CPU time on intermediate guest snapshots and detiling. Issue #636 reports that SW_4KB_S and SW_64KB_D BC account for most detiled bytes in its streaming bursts; this does not establish coverage of the narrower admitted family here.
What changes
Opt-in VICTORY_BC_BAND_STREAM=1 streams contiguous non-XOR BC tile-row bands directly into mapped staging. Admission requires a single watched 2D subresource of at least 8 MiB and checked compatible layout/extents. Four leased reusable buffers bound retained band scratch to 4 MiB total, at most 1 MiB per lease; saturation falls back without blocking. Ordinary fallback scratch and run metadata are separate. Unsupported/guarded layouts retain existing conversion and fault handling.
Benchmark results
Final head
5a86dd5, Windows D3D12 WARP, 4096², eight alternating ABBA/BAAB blocks per shape. Median block medians, paired total reductions:All 32 paired blocks improve total time. Prep reductions 27.66%, 29.31%, 49.49%, 48.25%. Small 512² rejected controls remain byte-exact and do not activate; two warm changed passes 589.4/500.2 µs disabled versus 618.9/520.3 µs enabled are insufficient to establish a reliable small-path overhead estimate.
Why this should be merged
Avoids full texture snapshot scratch storage on the admitted route, reduces measured large-upload preparation and total software-fixture time, and retains bounded memory, dirty tracking and existing fallback. Ready for review as a scoped opt-in improvement, not default-on.
Validation
Final-head CI 47594645326 both jobs passed: 384 exact CPU arms, 128 exact WARP paired arms, 24 actual Staging::refresh_timed production passes and four fault controls, two replicas of a shared watched address, repeated updates, dirty/claim-upload assertions, rejected smaller texture and lease saturation. Actual readbacks are exact. Earlier CI 47592749020 provides independent prior measurements.
Compatibility and dependencies
Independent main-based branch; no dependency on #655. Default off. Actual title coverage, physical AMD timing and distinct physical aliases remain open. No gameplay FPS or zero-copy claim.
Asynchronous compatibility
The original combined async test exposed an existing upstream first-upload alias barrier error for committed resources, reproduced on unchanged main. The independent #662 fix preserves placed/reserved barriers. Corrected baseline and all four combined switch arms pass D3D12 debug-layer exact asynchronous readback, committed/placed resources and deferred owner/fence retirement. This is not a full title lifetime proof.
Physical AMD capture
Test-only head
c1ec4acadds a strict actual DXGI AMD adapter identity gate, without changing production logic. Use the shared runner withPRC_AMD_GATES=bc_bandand eight internal paired blocks. Physical execution remains pending. Earlier tables retain their measured revision; negative paired time change means improvement.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.