perf(gpu): cap backlog staging bursts and pace mip-upgrade replacements #626
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!626
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-626"
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?
@chefulano on GitHub · 2026-12-05 20:27 UTC · original
chefulano:perf/storm-upload-and-mip-pacing→main· +184 −25 · 3 files · 1 commits · openDuring heavy streaming transitions (
on_time >= 1024),draw.rspreviously unlocked a 3× upload burst (576 MiB / 750 msper frame on 8 GiB cards) whiledescriptor/host.rsunconditionally triggeredresource::want_level()full-mip replacements on every bound placed texture. In 8 GiB outdoor streaming bursts, that combination produced single-frame texture upload spikes up to 254 MB, pushed staging heaps to 352–592 MB, and caused multi-hundred-millisecond CPU-bound stalls (gpu_wait_ms = 0.0).This change bounds backlog upload passes and paces mip-upgrade replacements:
crates/victory-gpu/src/draw.rs:backlog_upload_budget()keepson_time >= 1024capped at 1× (192 MiB / 250 mson 8 GiB) instead of unlocking 3×, and tightens to128 MiB / 150 mswheneverlive_staging_bytes() >= 128 MiB. EntersMipUpgradeBacklogGuardduring non-baking backlog passes and retries deferred mip upgrades viahost.texture_slot_later(..., 16)while keeping the existing smaller-mip host copy visible.crates/victory-gpu/src/descriptor/host.rs&crates/victory-gpu/src/resource.rs:placed_texture_paced()+want_level_paced()pace full-mip replacements (<= 16/frameduring backlog, paused whilelive_staging_bytes() >= 128 MiB), never deferring first-time allocations (made.is_none()) or copy-origin textures.Live measurements (8 GiB RX 7600 XT, Linux RADV + vkd3d-proton, 4-minute outdoor streaming route)
254 MBsingle-frame upload spikes during the115–130 soutdoor streaming burst.-96 to -112 MB(352–400 / 266–319 MB->256–288 / 163–232 MB).MemAvailableheadroom by+162 MiB(753.8->915.9 MiB).120–125 s) by+0.80 FPS(8.50->9.30 FPS) and late-world (150–240 s) by+0.56 FPS(24.81->25.36 FPS).(Measured on an integrated test build; unit tests below directly cover the standalone budget and mip-pacing rules on
main.)Queue check
VICTORY_SMALL_BACKLOG, which makes first-time copies small-first rather than bounding backlog upload bursts and full-mip upgrade replacements).Checks
cargo xtask policy— pass (368 files ok)cargo check --locked --release --target x86_64-pc-windows-msvc -p victory-gpu -p victory --tests(default and--features diagnostics) — passcargo clippy --no-deps --locked --release --target x86_64-pc-windows-msvc -p victory-gpu --all-targets— 0 new warningsPKG=victory-gpu ./build.sh test --lib -- backlog_upload_budget_caps_storm_burst_and_high_staging— 1/1 passedPKG=victory-gpu ./build.sh test --lib -- mip_upgrade_pacing_caps_backlog_and_high_staging— 1/1 passed>= 128 MiBlive staging take a few extra frames to step up while keeping the lower-mip copy shown.Created with Gemini 4 Neon in T3 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.