perf(victory-gpu): tile ambient gather in groupshared, cache coarse depth in raise, and scope UAV barriers #475
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!475
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-475"
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?
@mauroalvare on GitHub · 2026-11-27 01:19 UTC · original
mauroalvare:rt/passes/resolve-lighting-perf→main· +707 −45 · 2 files · 1 commits · openChange
Eliminates overly broad global UAV barriers and repeated per-pixel/per-point work in the lighting resolve pass (
third_party/victory/crates/victory-gpu/src/ambient.rsanddraw.rs, active both without RT and with RT underVICTORY_AMBIENT_RT) while preserving bit-for-bit identicalR9G9B9E5output:groupsharedcell tiling + full-warp occupancy ingather(ambient.rs):gatherused[numthreads(8, 2, 1)](16 threads/group — half a 32-lane NVIDIA warp) and every one of the160x90 = 14,400threads looped over all2,304cells directly from global UAV memory (66.35Mglobalfloat4loads / frame).[numthreads(8, 8, 1)](64 threads/group,Dispatch(20, 12, 1)) with cooperative 64-cellgroupsharedtiling in the exact0..2304accumulation order (64xfewer global UAV loads, full warp occupancy).p.zfromgatherto eliminate 4 redundant full-resdepth.Load+seen()calls per pixel inraise(ambient.rs):pointsrecord to 4float4s (64 bytes, one cache line) and storesp.zinpoints[at0 + 3].x.raisereadspoints[at0 + 3].xdirectly instead of callingseen(...)/depth.Load(...)4 extra times per full-resolution pixel (8.3Mfewer depth loads at 1080p,33.2Mfewer at 4K).ambient.rs,draw.rs):draw.rspasses the host targetID3D12Resourceinambient::Views(already resolved intable_view).ambient::afterreplaces global NULL UAV barriers (pResource = None) with resource-scoped UAV barriers (target,&pass.cells,&pass.points).Role::Resolve, runsplaceandgather(which only readdepthSRV +cells) before waiting on the title'slightUAV write, batching[UAV(&pass.points), UAV(light)]right beforeraise.Role::Radiance'smean(which writes onlyambient's privatecellsbuffer).Verification
Tested locally on Windows x64 with NVIDIA GeForce RTX 5070 Ti (driver 621.40, Wave32, SM 6.6):
RTX 5070 Ti Hardware Timestamp Benchmark (equal resolution, sample count, and bit-exact output: 0 differing pixels out of 2,073,600 at 1080p and 8,294,400 at 4K; 30 FPS budget = 33.333 ms)
place(ms)gather(ms)raise(ms)Oracle and test data
gatherandraiseHLSL (LEGACY_SOURCE) executed on the same GPU over synthetic depth (with occluder step), radiance cells, andR9G9B9E5light target; no game files or assets.ambient::tests::optimized_resolve_matches_original_bit_for_bitasserts 0 differingR9G9B9E5texels across the full target.Checklist
E_NOTIMPL), never a fake success.ambient.rsshader slots.Made with AI assistance (Antigravity / Gemini).
@mauroalvare on GitHub · 2026-11-27 01:31 UTC · original
Independent release validation at
b38e40ad2fb3e2d74f9ad4caa20def050cba83efon RTX 5070 Ti, driver 621.40.ambient::passed 5 tests. The published benchmark matched all pixels at 1080p and 4K and reproduced GPU median improvements from 0.4609 to 0.3341 ms and 1.7084 to 1.5217 ms, respectively.I also ran the same fixture in two binaries,
a40ed684341fbd2cc6d27c171af9ae27bbc56018(whose resolve code matches the PR parent) andb38e40ad2fb3e2d74f9ad4caa20def050cba83ef. Each used the productionplace,gatherandraisepipelines with ambient band constants 0.75 / 2.5 / 0.8 over the same synthetic lighting input. The fixture restored that input before each frame. GPU timestamps exclude the reset. Each build used 24 warmups and 120 samples per resolution and ran twice in base/head/head/base order.Repeat GPU medians were 0.4559 → 0.3303 ms and 1.7043 → 1.4949 ms.
gatheraccounted for most of the reduction, 0.202 → 0.092 ms at 1080p and 0.252 → 0.093 ms at 4K.raiseremained the largest 4K phase at 1.400 ms. Sampled process-local DXGI usage rose by 0.25 MiB. The fullR9G9B9E5output matched across all four runs at both resolutions.The local registry has
pr475-ambient-probe.rsand thepr475-ambient-{base,head}.patchoverlays. Copy the shared probe tosrc/ambient_rt_validation.rs, apply the matching overlay and use the filterambient::validation::ambient_rt_two_buildswith the same flags. Thepr475-band-{base,head}-{a,b}logs include phase samples, memory and image hashes. These numbers cover the synthetic ambient resolve stage with the RT-band settings.@mauroalvare on GitHub · 2026-11-27 02:11 UTC · original
Integration verification on the same RTX 5070 Ti and driver 621.40. I reapplied the saved ambient probe to base
28fd0a746bd1e9170cca57e0a942a356b3e290afand integrated stack8e0f6d9ce7e693bf9745f36f6c9ad73b980e8e2e(mainb62053f, #472, #474–477 and revised #451). Each build ran twice in base/stack/stack/base order, 24 warmup and 120 measured frames per resolution per process. The fixed RT-band scene restored the same input lighting before each frame.The 27.6% and 12.1% GPU median reductions retain the earlier isolated gains. Full output hashes match at both resolutions. The 4K
raisestage now uses 1.405 ms of the 1.501 ms median GPU time. Sampled local memory for the 4K workload was 143.1 MiB base and 143.3 MiB integrated.Reproduction uses the
pr475-ambient-probe.rsfixture from the earlier review with the local integration overlays. The exact test filter isambient::validation::ambient_rt_two_buildswith--release --exact --ignored --nocapture --test-threads=1. The common registry contains the fourrtint-ambientlogs andintegration-8e0f6d9/summary.json.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.