perf(gpu): stage/access-scoped D3D12_GLOBAL_BARRIER (VICTORY_ENHANCED_GLOBAL) #19

Closed
github-bot wants to merge 1 commit from gh-pr/19/head into gh-pr/19/base
Owner

@⁠justadudeinbulgaria on GitHub · 2026-11-30 23:19 UTC · original
justadudeinbulgaria:pr/enhanced-global-barriers → main · +294 −26 · 2 files · 1 commits · closed without merging

Summary

Adds opt-in VICTORY_ENHANCED_GLOBAL=1 (off by default) to preserve the title's D3D12_BARRIER_SYNC and D3D12_BARRIER_ACCESS scopes on BARRIER_TYPE_GLOBAL and un-scoped BARRIER_TYPE_BUFFER calls via ID3D12GraphicsCommandList7::Barrier(D3D12_GLOBAL_BARRIER) instead of emitting full-pipeline legacy UAV_BARRIER(NULL) drains:

  • crates/victory-gpu/src/host/rec.rs: Adds Rec::global_barrier with merge_sync/merge_access coalescing when VICTORY_JOIN_BARRIERS=1 (preserving SYNC_ALL and ACCESS_COMMON semantics), flushing pending global barriers ahead of subsequent legacy transitions, and falling back to legacy UAV_BARRIER(NULL) when Enhanced Barriers are unavailable.
  • crates/victory-gpu/src/list.rs: Tracks sanitized D3D12_GLOBAL_BARRIER sync/access scopes on EnhancedAction using exact DIRECT-queue bitmasks (VALID_PC_SYNC = 0x0180_FFFF preserving CLEAR_UNORDERED_ACCESS_VIEW 0x8000 & EMIT_RAYTRACING 0x4000 while excluding video-queue-only bits; VALID_PC_ACCESS = 0x0001_FFFF).

Verification

  • Unit tests: cargo test --release -p victory-gpu --lib enhanced_barrier passes (including sanitize_sync / sanitize_access DIRECT-queue mask assertions).
  • Live VICTORY_GPU_PASS_PROF=30 A/B on RTX 2060 SUPER 8 GB (439–534 global barriers/frame, 6,600–7,300 draws): cut GPU compute pass time from 37–43 ms to 26–34 ms (-8 to -12 ms/frame, CS_ZeroOperation -44%, CS_PosOnlyLodSkinning 6.9x faster) with zero dropped-pipeline regressions and clean visuals.
**@⁠justadudeinbulgaria** on GitHub · 2026-11-30 23:19 UTC · [original](https://github.com/ToLIManl/VIctory-Hydra/pull/19) `justadudeinbulgaria:pr/enhanced-global-barriers` → `main` · +294 −26 · 2 files · 1 commits · closed without merging ## Summary Adds opt-in `VICTORY_ENHANCED_GLOBAL=1` (off by default) to preserve the title's `D3D12_BARRIER_SYNC` and `D3D12_BARRIER_ACCESS` scopes on `BARRIER_TYPE_GLOBAL` and un-scoped `BARRIER_TYPE_BUFFER` calls via `ID3D12GraphicsCommandList7::Barrier(D3D12_GLOBAL_BARRIER)` instead of emitting full-pipeline legacy `UAV_BARRIER(NULL)` drains: - **`crates/victory-gpu/src/host/rec.rs`:** Adds `Rec::global_barrier` with `merge_sync`/`merge_access` coalescing when `VICTORY_JOIN_BARRIERS=1` (preserving `SYNC_ALL` and `ACCESS_COMMON` semantics), flushing pending global barriers ahead of subsequent legacy transitions, and falling back to legacy `UAV_BARRIER(NULL)` when Enhanced Barriers are unavailable. - **`crates/victory-gpu/src/list.rs`:** Tracks sanitized `D3D12_GLOBAL_BARRIER` sync/access scopes on `EnhancedAction` using exact DIRECT-queue bitmasks (`VALID_PC_SYNC = 0x0180_FFFF` preserving `CLEAR_UNORDERED_ACCESS_VIEW` `0x8000` & `EMIT_RAYTRACING` `0x4000` while excluding video-queue-only bits; `VALID_PC_ACCESS = 0x0001_FFFF`). ## Verification - Unit tests: `cargo test --release -p victory-gpu --lib enhanced_barrier` passes (including `sanitize_sync` / `sanitize_access` DIRECT-queue mask assertions). - Live `VICTORY_GPU_PASS_PROF=30` A/B on RTX 2060 SUPER 8 GB (439–534 global barriers/frame, 6,600–7,300 draws): cut GPU compute pass time from `37–43 ms` to `26–34 ms` (`-8 to -12 ms/frame`, `CS_ZeroOperation` `-44%`, `CS_PosOnlyLodSkinning` `6.9x` faster) with zero dropped-pipeline regressions and clean visuals.
Add opt-in VICTORY_ENHANCED_GLOBAL=1 (off by default) to preserve the title's D3D12_BARRIER_SYNC and D3D12_BARRIER_ACCESS scopes for BARRIER_TYPE_GLOBAL and un-scoped BARRIER_TYPE_BUFFER calls via ID3D12GraphicsCommandList7::Barrier(D3D12_GLOBAL_BARRIER) instead of stalling all GPU pipelines behind a legacy UAV_BARRIER(NULL).

- Coalesces adjacent global barriers in Rec::global_barrier when VICTORY_JOIN_BARRIERS=1 (preserving D3D12_BARRIER_SYNC_ALL and D3D12_BARRIER_ACCESS_COMMON semantics) and emits pending global barriers ahead of subsequent legacy transitions.
- Sanitizes sync/access bitmasks to valid DIRECT-queue PC bits (VALID_PC_SYNC=0x0180_FFFF preserving CLEAR_UNORDERED_ACCESS_VIEW 0x8000 and EMIT_RAYTRACING 0x4000 while excluding video-only bits; VALID_PC_ACCESS=0x0001_FFFF), with unit test coverage.
- Live A/B on RTX 2060 SUPER 8 GB cut GPU compute pass time by 8-12 ms/frame (CS_ZeroOperation -44%, CS_PosOnlyLodSkinning 6.9x faster) with zero dropped-pipeline regressions.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 17:08:55 +00:00
github-bot closed this pull request 2026-12-02 17:08:55 +00:00
Author
Owner

@⁠ToLIManl on GitHub · 2026-12-01 00:47 UTC · original

Integrated into \main\ in commit \64f4cb9\ (with \Co-authored-by\ attribution, combined cleanly with PR #20's \Rec::list6\ in \host/rec.rs).

\VICTORY_ENHANCED_GLOBAL=1\ remains opt-in (off by default). Verified on RTX 3060 12 GB (\rrors=0, \mem_pressure=0, \mean_fps=14.61, \median_fps=15.55, \p99_ms=141.8) and via \ ictory-gpu\ \list::\ tests (\8 passed).

**@⁠ToLIManl** on GitHub · 2026-12-01 00:47 UTC · [original](https://github.com/ToLIManl/VIctory-Hydra/pull/19#issuecomment-7296750762) Integrated into \main\ in commit \64f4cb9\ (with \Co-authored-by\ attribution, combined cleanly with PR #20's \Rec::list6\ in \host/rec.rs\). \VICTORY_ENHANCED_GLOBAL=1\ remains opt-in (off by default). Verified on RTX 3060 12 GB (\rrors=0\, \mem_pressure=0\, \mean_fps=14.61\, \median_fps=15.55\, \p99_ms=141.8\) and via \ ictory-gpu\ \list::\ tests (\8 passed\).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.