gpu: physical-page transient RT aliasing, lazy depth-UAV twins, and idle RT reclamation #1147
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1147"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mikael-jarvinen on 2026-11-28T14:15:40Z.
Summary
Reduces non-texture VRAM consumption on 8–12 GB GPUs by ~509 MB (
−355 MBfrom transient render-target aliasing +~154 MBfrom lazy depth-UAV twins and unmapped/idle RT reclamation) with 0 GPU faults and 0 D3D12 errors.What Changed
crates/victory-gpu/src/alias_rt.rs,inplace.rs,resource.rs,host.rs):XMemMapPhysicalPagesphysical sections (inplace::aliased_section_pages).heap_tier >= 2), creates them viaCreateReservedResourceand maps their 64 KiB tiles synchronously onto lazily allocated 16 MiBD3D12_HEAP_FLAG_NONEchunks viaUpdateTileMappings(plus a small private overflow tile pool for minor pitch padding), mirroring the title's physical-page aliasing on the host GPU.D3D12_RESOURCE_BARRIER_TYPE_ALIASINGbarriers inHostList::transitionandHostList::preludewhen switching between aliased resources sharing physical backing.VICTORY_ALIAS_TARGETS(default ON; setVICTORY_ALIAS_TARGETS=0to disable and fall back to committed resources).crates/victory-gpu/src/resource.rs,host.rs):twin_textureallocation for depth textures withALLOW_UNORDERED_ACCESSuntil the texture is actually bound as a UAV (resource::ensure_twin), avoiding unused color-twin allocations on plain depth draws.crates/victory-gpu/src/resource.rs):let_go_idle(every 5 s), and accountsalias_rt::allocated_bytes()intargets_room_kept().Verification
cargo clippy -p victory-gpu --all-targets --locked(0 warnings in touched files)cargo clippy -p victory-gpu --all-targets --all-features --locked(0 warnings in touched files)cargo test -p victory-gpu --lib --locked: 454 passed, 0 failed (36 ignored), includingalias_rt::tests::coalesce_runs_merges_contiguous_tile_rangescargo xtask policy: 295 files okcargo build --release -p victory: 0 warningsA/B Benchmark (
origin/main63b902fvs this PR)Hardware: NVIDIA RTX 3080 10 GB, Windows 11, 1440p DLSS Performance, identical 115 s scripted startup + world run (
VICTORY_WARMUP_RESTART=0,VICTORY_POOL_STATS=1).origin/main(63b902f)6ba7fa8)731 MBvirtual →376 MBphysical)8,336 − 3,648)8,083 − 3,904)held back for room(total)Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by rahmondg45 on 2026-11-28T14:17:53Z.
good work
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mikael-jarvinen on 2026-11-28T21:45:15Z.
Rebased cleanly onto
main(923e38c, head724e51f; 1/1alias_rt+ 29/29resource::testspass, 0 new warnings) and re-measured on RTX 3080 10 GB + Ryzen 7 7800X3D (diagbuild, warm shader cache, 1440p DLSS Performance, FG off, 115 s scripted run):main(923e38c)724e51f)Kept for render targetsImported from trustno1-coder/VIctory-NVIDIA. Originally posted by mikael-jarvinen on 2026-11-29T08:17:14Z.
Note: this PR was merged into
mainind6e0670(so this PR can be closed). Opened follow-up #2042 to fix the missing intra-list aliasing barrier on first aliased RT write and makeVICTORY_ALIAS_TARGETSopt-in until DCC/DiscardResourcetracking is added.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-29T08:28:10Z.
Thank you! An earlier version of this pull request was merged into main with its original commits and is part of v2026.11.29.01, where you are credited. GitHub does not show it as merged because new commits were pushed here after that merge. It stays open so those newer commits can be looked at next.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mikael-jarvinen on 2026-11-29T08:42:11Z.
Thanks for merging the earlier commits into v2026.11.29.01! The only remaining commit on this branch (
96fb6722) was half-superseded bymain'salias_tracker.record_touch, and its other half (makingVICTORY_ALIAS_TARGETSopt-in=1untilDiscardResource/DCC clearing is verified) is cleanly rebased onto latestmainin #2042. Closing this PR to keep things tidy.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by AlexeyYuditsky on 2026-11-29T12:21:18Z.
Because of this PR, ripples started appearing when enabling frame gen 2x and higher.

Pull request closed