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

Open
sagouindupm wants to merge 1 commit from upstream-pr/892 into main
sagouindupm commented 2026-11-25 12:02:08 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by sagouindupm on 2026-11-25T12:02:08Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6604016064 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/892). Originally posted by [sagouindupm](https://github.com/sagouindupm) on 2026-11-25T12:02:08Z. --- 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.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/892:upstream-pr/892'
git switch 'upstream-pr/892'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/892'
git switch 'upstream-pr/892'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/892'
git switch 'upstream-pr/892'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/892'
git switch 'main'
git merge --squash 'upstream-pr/892'
git switch 'main'
git merge --ff-only 'upstream-pr/892'
git switch 'main'
git merge 'upstream-pr/892'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!891
No description provided.