gpu(shadow): add VICTORY_WC_BAR=3 (smart) for small read-only WC buffers #4527
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4527"
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 tikD1337 on 2026-11-30T21:59:32Z.
Adds
VICTORY_WC_BAR=3(smart), an opt-in mode authored by @POMXARK in #3556 and contributed underGPL-3.0-or-later.What it does
len < wc_no_back_cutoff(), default< 64 KiB): placed directly in CPU-mapped ReBAR VRAM (GPU_UPLOAD) only when(desc.flags & 0x4) == 0(!D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, i.e., shader read-only buffers). Small UAV-capable buffers (allow_uav == true, such as mip feedback or compute hair) stay two-sided so GPU→CPU write-backs remain intact.len >= wc_no_back_cutoff(), default>= 64 KiB): same policy asVICTORY_WC_BAR=1regardless ofallow_uav.gpu_writes/shader_writes: undersmart,self.mappedbuffers below the cutoff skip thewc_no_backearly-drop branch in case a non-UAV buffer receives a GPU copy write.dead_codewarnings from the draft diff (#[cfg(test)]onwc_bar_allowedandBuffers::insert, removed unusedShadow::is_guarded).Discussion #3556 context & acknowledgements
Thank you to everyone in #3556 who investigated, tested, and isolated the bottlenecks leading to this PR:
VICTORY_WC_BAR=3(smart),victory-city-bench, theD3D12Core.dll(23H2) ReBAR finding,FRESH_FIRST,EMISSIVE_FALLBACK, and ran theRTX 5080(Win 11 22631)--releasebenchmarks (SUBMIT_SPLIT=1:73.7 msframe /58.5 msprep ->SUBMIT_SPLIT=1 + WC_BAR=3:57.5 msframe /50.0 msprep,23–24peak /18–20interior fps).MEM_WRITE_WATCH, verified the 23H2D3D12Core.dllfinding, reviewed the memory/copy-back constraints (#4515), and offered to run paired 5080 A/B + picture checks on this PR.RTX 4090VICTORY_GUARD_LEARNA/B tests (48 -> 110 ms/85 -> 850 MB/fat every asking;47 -> 52 ms/85 -> 134 MB/fonce per frame), independently confirming the dynamic-buffer over-copy wall and showing that~43 msof submitting-thread time sits in per-frame dynamic refreshes/copies/copy-backs.0001–0003(41adb551),WC_BAR=1/SUBMIT_SPLIT=1/FRESH_FIRST=1(84bd61e2), isolatedSUBMIT_SPLIT=1alone (73.5 -> 33.6 msdiag), and verifiedSUBMIT_SPLIT=1 + WC_BAR=3in--release(e1251c31).Local
--releaseverification (RTX 4070 Ti SUPER / Ryzen 5 7600 / 32 GB, Windows 1126300, driver621.1.0)Same binary (
e1251c31+ this diff),--console series-s,--dlss quality, warm shader cache, 90 s runs reaching 3D atframe=16384:16384(elapsed)prepmedian (last 4)refreshesmedcard_copies/sendSUBMIT_SPLITthread medVICTORY_SUBMIT_SPLIT=1~71.8 f/s)135–210)VICTORY_SUBMIT_SPLIT=1+VICTORY_WC_BAR=3~98.1 f/s)25.5–28.8)(Note: visual inspection of meshes/hair/mip feedback in-game with
WC_BAR=3was not captured in that headless log run — @Marsietiss noted they will check the picture on 5080.)Checks run on this branch (
87aae32c)cargo check -p victory-gpu— clean (0 new warnings)cargo test -p victory-gpu --lib -- write_combined_tests— 2 passed, 0 failed (1,197 filtered)cargo test -p victory-gpu --lib -- land_tests— 2 passed, 0 failed, 1 ignored (1,196 filtered)(AI-assisted PR preparation, cleanup, and log analysis.)
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tikD1337 on 2026-12-01T12:34:03Z.
Quick re-verification & compatibility check on current
origin/main(5fabb46e):5bb09130(VICTORY_WC_BAR=3smart) applies with 0 conflicts onto5fabb46eeven when stacked together with PR#4855(THIN_PEEPHOLE=1/SUBMIT_STAGE_SPLIT=1) and#3556's01/03/04patches, and builds cleanly in--release.victory-gpu(watch::tests43/43,peep_4/4,host::pipeline::tests5/5) andvictory-hle(xmem::tests::private_32_bit1/1) PASS.621.1.0, ReBAR ON + Ryzen 5 7600, Win1126300, DLSS Quality, 105 s steady 3D runs):When combined with
VICTORY_THIN_PEEPHOLE=1andLOW_L0_DMA/GUARD_SHARDED/DESC_MIRROR_CAP+SOFT_BATCH(VICTORY_PORT_CONSTANTS=0), the stacked build hit 27.52 FPS steady (36.34 ms/f), 27.90 FPS at5.5k–6.5kdraws (5 s peaks 28.8 FPS), 21.7 FPS at~10.9kdraws,card=21.1 ms(75%busy),card_cp=0.7 ms, across 3/3 105 s runs with 0 crashes.Cross-notes posted in #3556 and #4855.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:38:32Z.
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed