GPU: reserve upload space only for dirty texture subresources #3136
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3136
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3136"
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?
@yyc160 on GitHub · 2026-11-26 09:43 UTC · original
yyc160:pr/pack-dirty-texture-uploads→main· +82 −28 · 2 files · 1 commits · openThe texture refresh already detiles and copies just the subresources affected by a write (#1135). It still takes upload space for the entire texture on every refresh. A burst of updates to small mips therefore leaves most of multiple 32 MiB upload chunks unused.
This change packs the selected footprints in subresource order. The detiler and
CopyTextureRegionuse the same offsets; a footprint keeps the driver's placement padding and the final footprint keeps its short final row. Full uploads keep their original size. It changes neither texture residency nor which mips are sampled, and it does not discard uploads, add a queue or change any fence.Measurement
Windows, physical GeForce RTX 5070 Ti (
10de:2c05), one process per arm. Synthetic 2048x2048 RGBA8, 12 mips, 12 calls to the actual detiler in one upload burst before recycling. The selected mip was 256x256. Counted distinct D3D12 staging resources and summedGetDesc().Width:For the partial case, the change in Windows private bytes was 384.75 versus 32.06 MiB. DXGI non-local usage increased by 384 versus 32 MiB, local usage by zero in both. The measurement excludes the input buffer, created before the baseline in each process. This is an upload burst, not a game memory or FPS benchmark.
Tests
cargo clippy --workspace --all-targets --locked -- -D warningsand the--all-featuresvariant pass;cargo xtask policypasses.cargo test --workspace --locked --offline --profile diagstops on two NVIDIA heap assertions invictory-gpu:dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views. Both fail with the same assertions on unmodified63bcca4. In the patched GPU suite 230 passed, 2 failed and 1 was ignored. The four targeted tests also pass withdiagnostics.AI-assisted by GPT-6.2 Astra.
@smaxxey on GitHub · 2026-11-26 10:13 UTC · original
Ran this on an RTX 4060 Laptop GPU (Ada, 8 GB, driver 32.0.16.1742), Windows 11 26300, Rust 1.98.1. No game files. Head
656a143merged locally ontomain63bcca4.draw::tests::a_write_into_one_mip_uploads_that_mip_alonepasses on the hardware device, with the new check that mip 1 reads back128/255. The twotexture::testscases pass too.cargo test -p victory-gpu --lib --locked: 230 passed, 2 failed, same asmain63bcca4on this card: only the two NVIDIA failures of #1835 (descriptor::host::tests::dynamic_slots_are_held_until_released,memory::tests::lists_share_a_table_and_copies_keep_their_views), nothing new.Tested with Claude Code's help.
@steven-seagull27 on GitHub · 2026-11-26 11:18 UTC · original
For anyone taking #3174 alongside this change, the tested merge keeps the packed offsets and passes the packed size to the retry-aware allocator. On the RTX 5080 and inbox WARP the retry reserved 128 KiB for nonadjacent slices 0 and 2, kept slice 1 intact, and recovered all 49,152 destination texels. Falling back to a full-texture reservation preserved the pixels but requested 192 KiB. Merge, regression and both controls on #3174
@Dukestar69 on GitHub · 2026-11-26 12:31 UTC · original · approved these changes
Verified on RTX 5090 against
origin/main(63bcca4):cargo test -p victory-gpu --lib texture:: -- --test-threads=1: 3/3 passed (includingsparse_upload_omits_clean_slices_and_keeps_the_short_last_row).cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20/20 passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly reserves staging upload space only for dirty texture subresources.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.