GPU: a pipeline a list binds again is not kept and named again #3165
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3167"
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?
Imported from Marvisak/VIctory. Originally posted by pablogonz12 on 2026-11-26T10:49:54Z.
What
draw::State::bindkeeps a host pipeline and its root signature so the title may release thembefore 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, threelock/unlocks and a
Stringhash on the submitting thread for nothing.Now
HostList::bind_pipeline(crates/victory-gpu/src/host.rs) keeps and names a host pipeline thefirst 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 ofthe 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.
SetPipelineStateitself 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.
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T11:09:25Z.
Review: APPROVED
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).
Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T23:02:17Z.
Windows 11,
63bcca4+ this PR, Radeon RX 7900 XTX:cargo test -p victory-gpu --lib: 234 passed / 0 failed / 1 ignored (unpatched63bcca4here: 231; +3).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.a_pipeline_bound_again_is_kept_once,a_list_reset_binds_them_againandpipelines_an_address_apart_are_twoall pass. Synthetic only. AI-assisted.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T00:16:03Z.
Review: APPROVED
Reviewed and tested
af6b429073ab247234a617e484ef7625af0120bcon both RTX 5090 and WARP (VICTORY_D3D12_DEBUG=1).Verification:
cargo xtask policy— passcargo clippy --tests -p victory-gpu -- -D warnings(default and--features diagnostics) — cleanbound::tests(3/3) anddraw::tests(20/20 on RTX 5090, 20/20 on WARP) — all pass with 0 D3D12 Debug Layer errorsHostList::bind_pipelineprobe (400 alternating binds of 2 compute pipelines ->kept=4,names=2, releasing all caller COM refs prior toClose()+host.execute(&[&list]), verifyinglist.reset()clearskept/bound/pipelines, then rebinding and executing a fresh pipeline) — passes cleanly on both RTX 5090 and WARP with 0 Debug Layer errors.Locking and reset invariants are clean:
bind_pipeline(host.rs:2053-2068) drops thedeferredmutex before callingused_pipeline,HostList::reset(host.rs:1786, 1789) clears bothDeferred(kept+bound) andpipelines, andState::cut(draw.rs:315-316) resetshost_pipelinewhen switching to a fresh host command list.LGTM!
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.