perf(texture): stream proven tight linear uploads directly into staging #655
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!655
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-655"
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 00:57 UTC · original
tommiehansen:perf/phase13-linear-texture-stream-20261206→main· +290 −4 · 2 files · 6 commits · openWhy
The watched texture refresh path materializes an intermediate CPU snapshot and detiles it even when the guest layout is already identical to the final upload footprint. Avoiding that redundant work reduces CPU preparation time without changing the GPU upload.
What changes
Opt-in
VICTORY_LINEAR_TEXTURE_STREAM=1admits only tightly packed single-mip, single-layer, single-sample 2D linear textures with exactly matching row pitch, zero footprint offset and checked byte extent. Copy directly into mapped staging and preserve the existing dirty flags and GPU copy. Guarded/aliased and unsupported layouts retain their original path.Benchmark results
Windows D3D12 WARP, eight alternating ABBA/BAAB blocks per size, four arms/block, 96/96 byte-exact actual texture uploads/readbacks. Median per-arm preparation times and median paired block reduction:
Paired end-to-end reductions: 1.42%, 6.87%, 12.74% (5/8, 7/8, 6/8 wins). Small case median absolute totals 415.05 vs 421.40 us; timing is noisy. Larger case medians 512.10 vs 469.65 us and 1676.85 vs 1483.60 us. No physical GPU or gameplay FPS claim.
Why this should be merged
Eliminates a redundant CPU snapshot and conversion on a narrowly proven layout, preserves existing fallback and dirty tracking, and leaves default behavior unchanged.
Validation
CI 47589934748: actual texture upload and GPU readback exact; cargo check --locked -p victory-gpu --all-targets passed. Raw CSV/log. Earlier buffer-readback fixture 47589319395 independently passed 96 exact arms. This exercises the admission helper and copy mechanism, not full title activation.
Compatibility and dependencies
Independent of other optimization PRs; base
8c4e663, default off. Physical title activation, alias stress and full-scene timing remain validation gates. Not zero-copy into VRAM.Current production-refresh validation and repeat measurement
dcbc7c9 CI 47592700737 passed. The actual Staging::refresh_timed path executed with the switch off/on, two independent replicas of the same watched address, three changed and three clean passes, dirty/claim-upload assertions, actual texture copies and byte-exact readback. The enabled arm requires six direct refresh activations; disabled requires zero. Decommitted source-tail copy preserves the reference's zero-fill behavior. The test submits both texture lists together; it does not establish asynchronous title lifetime or physical alias mapping. Production compile passed.
Repeated 96 exact paired texture uploads; median block medians (µs), paired percentages:
Ready for review as a scoped opt-in CPU preparation improvement. Keep default off pending representative title eligibility and independent AMD validation; no gameplay FPS or physical upload speed claim. Reproduce with
VICTORY_LINEAR_TEXTURE_STREAM=0/1 cargo test --locked -p victory-gpu --features diagnostics --lib linear_stream_production_refresh_exact -- --ignored --nocapture --test-threads=1on Windows with WARP selected.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.