GPU: give screen passes dedicated pipeline workers and wait budget #892

Open
github-bot wants to merge 1 commit from github-bot/gh-892 into main AGit
Owner

@⁠sagouindupm on GitHub · 2026-11-25 12:02 UTC · original
sagouindupm:screen-pass-workers → main · +125 −39 · 2 files · 1 commits · open

Ports the dedicated screen-pass pipeline worker pool and wait budget idea from Belobug/VIctory-Belobug-AMD (18e57db8, GPL-3.0-or-later) onto upstream main (f85101b), preserving main's two-level Queue (early/requested promotion) and shared_budget() tracking.

Summary of changes

  • crates/victory-gpu/src/pipeline/host.rs: Add GraphicsState::screen_pass(&self) -> bool identifying triangle draws with no vertex inputs and no active depth/stencil (depth_format == DXGI_FORMAT_UNKNOWN or !DepthEnable && !StencilEnable).
  • crates/victory-gpu/src/pipeline/make.rs:
    • Tag Pending with screen: bool from GraphicsState::screen_pass().
    • Split QUEUE/AVAILABLE into ordinary (0) and screen-pass (1) queues, served by 2 dedicated victory-screen-pipelines-{i} worker threads alongside the existing victory-pipelines-{i} pool so full-screen/lighting table setup passes do not wait behind thousands of queued world draw pipelines.
    • Give screen passes their own per-frame SPENT tracker and screen_wait_budget() (VICTORY_SCREEN_PIPELINE_WAIT_MS, default 20 s; 0 when VICTORY_PIPELINE_WAIT_MS=0) without eating into the 500 ms ordinary draw wait budget.
    • Add unit tests screen_pass_classifies_inputless_depthless_triangles and screen_pass_uses_dedicated_queue_and_worker.

Attribution

  • Adapted from Belobug/VIctory-Belobug-AMD commit 18e57db8 ("Screen passes get pipeline workers and a wait budget of their own"), licensed under GPL-3.0-or-later.

Verification

Run on Windows 11 Pro (x86_64-pc-windows-msvc, Rust 1.98.1, RTX 3050 8 GB, driver 621.40):

  • cargo test --release -j 6 -p victory-gpu -- pipeline --test-threads=1 -> 13 passed; 0 failed (including both new tests).
  • cargo test --release -j 6 -p victory-gpu -- --test-threads=1 -> 160 passed; 1 failed; 4 ignored (the 1 failure is the pre-existing origin/main WARP scheduler-order test indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields, tracked in #849/#864).
  • cargo clippy -j 6 -p victory-gpu --all-targets --no-deps -> 0 warnings in pipeline/host.rs and pipeline/make.rs (3 pre-existing warnings in untouched resource.rs/draw.rs/indirect.rs on f85101b).
  • cargo run -j 6 -p xtask -- policy -> asset policy: 175 files ok.

AI-assisted: adapted for origin/main's Queue/shared_budget() structure, unit-tested, and written with AI assistance.

**@⁠sagouindupm** on GitHub · 2026-11-25 12:02 UTC · [original](https://github.com/fxceless/victory-fork/pull/892) `sagouindupm:screen-pass-workers` → `main` · +125 −39 · 2 files · 1 commits · open Ports the dedicated screen-pass pipeline worker pool and wait budget idea from `Belobug/VIctory-Belobug-AMD` (`18e57db8`, `GPL-3.0-or-later`) onto upstream `main` (`f85101b`), preserving `main`'s two-level `Queue` (`early`/`requested` promotion) and `shared_budget()` tracking. ### Summary of changes - **`crates/victory-gpu/src/pipeline/host.rs`:** Add `GraphicsState::screen_pass(&self) -> bool` identifying triangle draws with no vertex inputs and no active depth/stencil (`depth_format == DXGI_FORMAT_UNKNOWN` or `!DepthEnable && !StencilEnable`). - **`crates/victory-gpu/src/pipeline/make.rs`:** - Tag `Pending` with `screen: bool` from `GraphicsState::screen_pass()`. - Split `QUEUE`/`AVAILABLE` into ordinary (`0`) and screen-pass (`1`) queues, served by 2 dedicated `victory-screen-pipelines-{i}` worker threads alongside the existing `victory-pipelines-{i}` pool so full-screen/lighting table setup passes do not wait behind thousands of queued world draw pipelines. - Give screen passes their own per-frame `SPENT` tracker and `screen_wait_budget()` (`VICTORY_SCREEN_PIPELINE_WAIT_MS`, default 20 s; 0 when `VICTORY_PIPELINE_WAIT_MS=0`) without eating into the 500 ms ordinary draw wait budget. - Add unit tests `screen_pass_classifies_inputless_depthless_triangles` and `screen_pass_uses_dedicated_queue_and_worker`. ### Attribution - Adapted from `Belobug/VIctory-Belobug-AMD` commit `18e57db8` ("Screen passes get pipeline workers and a wait budget of their own"), licensed under `GPL-3.0-or-later`. ### Verification Run on Windows 11 Pro (x86_64-pc-windows-msvc, Rust 1.98.1, RTX 3050 8 GB, driver `621.40`): - `cargo test --release -j 6 -p victory-gpu -- pipeline --test-threads=1` -> **13 passed; 0 failed** (including both new tests). - `cargo test --release -j 6 -p victory-gpu -- --test-threads=1` -> **160 passed; 1 failed; 4 ignored** *(the 1 failure is the pre-existing `origin/main` WARP scheduler-order test `indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields`, tracked in #849/#864)*. - `cargo clippy -j 6 -p victory-gpu --all-targets --no-deps` -> **0 warnings** in `pipeline/host.rs` and `pipeline/make.rs` *(3 pre-existing warnings in untouched `resource.rs`/`draw.rs`/`indirect.rs` on `f85101b`)*. - `cargo run -j 6 -p xtask -- policy` -> **`asset policy: 175 files ok`**. AI-assisted: adapted for `origin/main`'s `Queue`/`shared_budget()` structure, unit-tested, and written with AI assistance.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:53:20 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/pipeline/host.rs
  • crates/victory-gpu/src/pipeline/make.rs
View 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.
git fetch -u origin '+refs/pull/892/head:github-bot/gh-892'
git switch 'github-bot/gh-892'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-892'
git switch 'github-bot/gh-892'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-892'
git switch 'github-bot/gh-892'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-892'
git switch 'main'
git merge --squash 'github-bot/gh-892'
git switch 'main'
git merge --ff-only 'github-bot/gh-892'
git switch 'main'
git merge 'github-bot/gh-892'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.