gpu: scope indirect clamp UAV barriers to source, count, and budget buffers #2360
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2360"
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 nidea1 on 2026-11-29T12:21:29Z.
What it changes
Replaces global
NULLUAV barriers around indirect-argument clamps (crates/victory-gpu/src/indirect.rs,crates/victory-gpu/src/indirect/batch.rs,crates/victory-gpu/src/indirect/bench.rs,crates/victory-gpu/src/host.rs) with resource-scoped, deduplicated UAV barriers:HostList::budget()returnsOption<(&ID3D12Resource, u64)>(zero-cost borrow of the active card or CPU-mapped budget buffer alongside its GPU virtual address).pre_clamp_barriersemits deduplicated resource-scoped UAV barriers (pResource != NULL) only for the source argument buffer(s), optional count buffer, and budget buffer whenwaitis true (still honoringVICTORY_QUIET_WAITSandVICTORY_BARRIER_TEST=indirect), combined withdst'sbefore -> UNORDERED_ACCESStransition throughcrate::barstat::rb.NULLUAV barrier inrecord_clamp(matchingbatch::record):dst'sUNORDERED_ACCESS -> INDIRECT_ARGUMENTtransition makes clamped records visible toExecuteIndirect, andbudgetis ordered by the next clamp's scoped UAV barrier (andcard_budget_out's copy transition on list close).How it was tested
wait = trueissued a globalNULLUAV barrier before dispatch, andrecord_clampissued a second globalNULLUAV barrier after dispatch (whenVICTORY_QUIET_WAITSwas off)dsttransition after dispatch; verified withpre_clamp_barriers_scopes_and_deduplicates_uavs,warp_scoped_indirect_barriers_order_compute_writes_and_budget(GPU compute writer -> batched clamp -> single clamp sharing budget ->ExecuteIndirect), and live gameplay on RTX 3060 Ticargo testpassed for the crates it touches: yes (cargo test -p victory-gpu --lib --locked indirect::tests::— 35 passed, 0 failed, 10 ignored benchmarks/opt-in hardware checks)Checked for overlap
VICTORY_QUIET_WAITSandcrate::barstat::rbalready onmain)