gpu/barriers: split depth-write & UAV->SRV barriers and fold null UAVs into global barriers #178
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ReTerryDavis--ReVIctory!178
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-177"
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?
@Zalthor on GitHub · 2026-12-05 21:26 UTC · original
Zalthor:gpu/barrier-drain-and-coalescing→main· +756 −84 · 5 files · 1 commits · openSummary
Eliminates remaining full GPU pipeline drains (
d0/fd0) and cuts redundant per-frame barriers on the GPU submission path:crates/victory-gpu/src/list/groups.rs,crates/victory-gpu/src/list.rs):depth_after_state()) across explicit read accesses (DEPTH_STENCIL_READ,SHADER_RESOURCE,COPY_SOURCE) as well as concrete read-onlylayout_afterlayouts (DEPTH_STENCIL_READ,*_SHADER_RESOURCE,*_COPY_SOURCE,*_GENERIC_READ) whenaccess_after == COMMON(while rejectingsync::SPLIT, undefined/COMMON, or write-capable layouts so depth-stencil textures never transition to legacyCOMMON).strip_depth_write()and pre-transitions eligiblePlainandTwindepth targets viaensure_state_from()inbarrier_groups().UAV -> SRVGlobal Double-Barrier Elimination (crates/victory-gpu/src/list/groups.rs,crates/victory-gpu/src/list.rs):strip_uav_write()so whenensure_state_from()transitions a plain texture directly fromUNORDERED_ACCESS(0x8) toSHADER_RESOURCE(with nosync::SPLIT), the redundantUNORDERED_ACCESSpre-scope is stripped from the subsequent enhanced global barrier.Rec-Routed Clamp Barriers (crates/victory-gpu/src/host/rec.rs,crates/victory-gpu/src/indirect.rs,crates/victory-gpu/src/indirect/batch.rs,crates/victory-gpu/src/list.rs):uav_global_barrier()viaRec::globalfrom unbatchedrecord_clamp_rec()and batchedbatch::record_rec()whenjoin_barriers/join_firstis enabled andEnhancedBarriersSupportedholds (crate::list::enhanced()/device_supports_enhanced()), avoiding D3D12 error 1343 on drivers without Enhanced Barriers even when merged independently of PR #176 (leavesRec::newuntouched).Rec::barriers/Rec::globalwidenheld.1to fullALL/COMMON -> ALL/COMMONsynchronization rather than narrowing unrelated full drains or non-UAV transitions, and distinguishesglobal_covers_named_uavvsglobal_covers_null_uavacrossRec::barriers.Verification
origin/mainca49e25, post-review):cargo clippy --workspace --all-targets --locked -- -D warningsandcargo clippy --workspace --all-targets --all-features --locked -- -D warningspass (0warnings).cargo test --workspace --lockedandcargo test --workspace --all-features --locked -- --test-threads=1pass (includingdepth_after_state_maps_allowed_reads_or_read_layouts_and_rejects_others,rec_barriers_and_global_close_across_mixed_uav_and_null_uav,warp_record_clamp_rec_coalesced_and_zero_records, mixed-access D3D12 closing checks, andxtaskpolicy tests; excluding pre-existing Win10 LTSC inbox-D3D12 host skipsdepth_bounds_pipeline_loads_and_filters_draws,a_submissions_times_are_the_pcs,a_frame_is_recorded_and_replayed, andemit::{valu,intersect,waterfall}_tests).builtin:cruise, Radeon RX 9070 XT,2560×1440Borderless FSR 4 Performance,VICTORY_FSR_FRAMEGEN=0real frames only):14–17/f(33/28/27drained groups) reduced to0/f(d0/fd0) acrossspawn_idle,cruise_out, andcruise_back(0device removals).C2_DEPTH_OPTvsC2_BASE->C3_POOL_DEPTH): initial split liftedcruise_out50.27 -> 57.23 fpsandcruise_back63.87 -> 70.86 fps;C3_POOL_DEPTH(d0/fd0) reached44.70 / 58.76 / 71.77 fps.C6_OPT/C6_OPT_GPUTIMEvs Cycle 5 baseline):+69.7%..+73.9%(76 -> 129,71 -> 123,69 -> 120), eliminating48–54enhanced global barriers per frame (1016 -> 968,965 -> 917,921 -> 871inC6_OPT).30–36 -> 115–127/f(+83..+93/f).indirect_clampGPU span improved to0.782 / 0.662 / 0.576 ms.51419e4ddcto9158fd235f9158fd235fto363be0b98cView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.