GPU: a pipeline a list binds again is not kept and named again #3167

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

@⁠pablogonz12 on GitHub · 2026-11-26 10:49 UTC · original
pablogonz12:perf/pipeline-kept-once → main · +85 −4 · 4 files · 1 commits · open

What

draw::State::bind keeps a host pipeline and its root signature so the title may release them
before it submits the list, and notes the pipeline's name. It did that at every change of
pipeline
, even when the list had already kept that same pipeline: two QueryInterfaces, three
lock/unlocks and a String hash on the submitting thread for nothing.

Now HostList::bind_pipeline (crates/victory-gpu/src/host.rs) keeps and names a host pipeline the
first time the list binds it. The set of kept addresses is its own type
(crates/victory-gpu/src/bound.rs) with tests that need no device, and it is cleared with the rest of
the list's deferred state, so a list that is reset binds (and keeps) them again. Two host pipelines
one address apart are two: the list keeps the old one, so its address names no other.

SetPipelineState itself is unchanged (it was already only called when the host pipeline changes);
this removes the redundant keeps and name lookups around it.

Credit

From avatarmanz/VIctory-7900XTX ab86ef7f3
("A pipeline a list binds again is not kept and named again"), which is from
Belobug/VIctory-Belobug-AMD 92d353f8 (romainhedouin), GPL-3.0.

Numbers

Offline, no game run (cargo xwin test -p victory-gpu --lib bound, Wine):
10,000 binds of five pipelines keep and name 5 (not 10,000); a reset binds them again; pipelines an
address apart are two. What a repeat no longer costs is two interface queries, three lock/unlocks and
one name lookup on the submitting thread per repeated bind; how many of those a frame has is not
measured
here.

Off switch

None: the list still keeps and names every pipeline it binds, just once each instead of once per bind.

Other hardware

This is host-side bookkeeping: no shader, no D3D12 call and no default path changes, so the path on
NVIDIA and on Windows is the same as before minus redundant keeps. Checked here on RX 9070 XT / Mesa
RADV / Wine only. Not tested on NVIDIA hardware - a Windows or NVIDIA test run would be welcome.

Gates

  • cargo xwin clippy --target x86_64-pc-windows-msvc -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xwin test --target x86_64-pc-windows-msvc -p victory-gpu --lib bound (Wine): 3 new tests pass.
  • cargo xtask policy: 192 files ok.

Not tested in a game run.

**@⁠pablogonz12** on GitHub · 2026-11-26 10:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/3167) `pablogonz12:perf/pipeline-kept-once` → `main` · +85 −4 · 4 files · 1 commits · open ## What `draw::State::bind` keeps a host pipeline and its root signature so the title may release them before it submits the list, and notes the pipeline's name. It did that at **every change of pipeline**, even when the list had already kept that same pipeline: two `QueryInterface`s, three lock/unlocks and a `String` hash on the submitting thread for nothing. Now `HostList::bind_pipeline` (`crates/victory-gpu/src/host.rs`) keeps and names a host pipeline the first time the list binds it. The set of kept addresses is its own type (`crates/victory-gpu/src/bound.rs`) with tests that need no device, and it is cleared with the rest of the list's deferred state, so a list that is reset binds (and keeps) them again. Two host pipelines one address apart are two: the list keeps the old one, so its address names no other. `SetPipelineState` itself is unchanged (it was already only called when the host pipeline changes); this removes the redundant keeps and name lookups around it. ## Credit From **avatarmanz/VIctory-7900XTX [ab86ef7f3](https://github.com/avatarmanz/VIctory-7900XTX/commit/ab86ef7f3)** ("A pipeline a list binds again is not kept and named again"), which is from **Belobug/VIctory-Belobug-AMD [92d353f8](https://github.com/Belobug/VIctory-Belobug-AMD)** (romainhedouin), GPL-3.0. ## Numbers Offline, no game run (`cargo xwin test -p victory-gpu --lib bound`, Wine): 10,000 binds of five pipelines keep and name **5** (not 10,000); a reset binds them again; pipelines an address apart are two. What a repeat no longer costs is two interface queries, three lock/unlocks and one name lookup on the submitting thread per repeated bind; how many of those a frame has is **not measured** here. ## Off switch None: the list still keeps and names every pipeline it binds, just once each instead of once per bind. ## Other hardware This is host-side bookkeeping: no shader, no D3D12 call and no default path changes, so the path on NVIDIA and on Windows is the same as before minus redundant keeps. Checked here on RX 9070 XT / Mesa RADV / Wine only. **Not tested on NVIDIA hardware** - a Windows or NVIDIA test run would be welcome. ## Gates - `cargo xwin clippy --target x86_64-pc-windows-msvc -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xwin test --target x86_64-pc-windows-msvc -p victory-gpu --lib bound` (Wine): 3 new tests pass. - `cargo xtask policy`: 192 files ok. **Not tested in a game run.**
Two queries for an interface, three locks and a name looked up at every
change of pipeline; now one lookup by address, the first time the list
binds that host pipeline. The set is cleared with the rest of the list's
deferred state, so a reset binds them again.

From avatarmanz/VIctory-7900XTX ab86ef7f3, after Belobug
92d353f8 (romainhedouin), GPL-3.0.

Co-authored-by: avatarmanz <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:09:21 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 11:09 UTC · original · approved these changes

Verified on RTX 5090 against origin/main (63bcca4):

  • cargo test -p victory-gpu --lib bound:: -- --test-threads=1: passed.
  • cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20/20 passed; host::tests: 30/30 passed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 192 files ok.

Cleanly deduplicates repeated pipeline binds within a command list.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 11:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/3167#pullrequestreview-6073083263) · **approved these changes** Verified on RTX 5090 against `origin/main` (`63bcca4`): - `cargo test -p victory-gpu --lib bound:: -- --test-threads=1`: passed. - `cargo test -p victory-gpu --lib draw:: -- --test-threads=1`: 20/20 passed; `host::tests`: 30/30 passed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 192 files ok. Cleanly deduplicates repeated pipeline binds within a command list. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3167/head:github-bot/gh-3167'
git switch 'github-bot/gh-3167'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3167'
git switch 'github-bot/gh-3167'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3167'
git switch 'github-bot/gh-3167'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3167'
git switch 'main'
git merge --squash 'github-bot/gh-3167'
git switch 'main'
git merge --ff-only 'github-bot/gh-3167'
git switch 'main'
git merge 'github-bot/gh-3167'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3167
No description provided.