Skip to content

GPU list: bind initial pipeline state in create_list and create_list_x - #1446

Merged
Marvisak merged 2 commits into
Marvisak:mainfrom
geiyiliyabumo:fix/list-create-initial-pipeline
Nov 25, 2026
Merged

Marvisak merged 2 commits into
Marvisak:mainfrom
geiyiliyabumo:fix/list-create-initial-pipeline

Conversation

@geiyiliyabumo

Copy link
Copy Markdown
Contributor

Summary

Fixes \VIC-BT-003\ (P0, tracked in #1242) in \crates/victory-gpu/src/list.rs:

  • \create_list\ and \create_list_x\ previously ignored their \pInitialState\ pipeline parameter, leaving newly created command lists unbound and dropping initial draws/dispatches recorded before an explicit \SetPipelineState\ call.
  • Forwards the initial pipeline to the shared constructor
    ew_list, initializing Windows draw state (\state.set_pipeline(pipeline)) and recording \crate::pipeline::bound(pipeline)\ on successful creation (while keeping null \pInitialState\ a clean no-op).
  • Adds a synthetic regression test (\lists_bind_the_initial_pipeline_on_creation) covering both \create_list\ and \create_list_x\ with null and non-null initial pipelines.

Verification

  • \cargo test -p victory-gpu --lib list: 2 passed, 0 failed
  • \cargo clippy -p victory-gpu --all-targets -- -D warnings\ (default and --all-features): clean
  • \cargo xtask policy: 154 files ok

AI-assisted; synthetic tests only, no game files.

github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
@wbkepler

Copy link
Copy Markdown
Contributor

Ran lists_bind_the_initial_pipeline_on_creation on Windows 11 / RTX 5090 with this branch (e52777a): passed.

Interaction note: this is functionally the same as the VIC-BT-003 hunk in #1353. Both pass pipeline through new_list into State, for both create_list and create_list_x. This version is slightly tidier: it calls pipeline::bound only after hand_out succeeds. So the two only need one of them to land.

On the Reset(allocator, pso) path, reset/reset_x already pass the pipeline to state.reset(pipeline), so the draw state stays consistent with creation. The only gap is that reset doesn't call crate::pipeline::bound(pipeline) the way set_pipeline does, so a pipeline that is only ever bound through Reset never gets its "first bind" log. That's logging only and was already the case before this PR. It's a one-line addition if you want it here.

AI-assisted review (Claude Code); checked on Windows 11 / RTX 5090.

@geiyiliyabumo

Copy link
Copy Markdown
Contributor Author

Thanks @wbkepler for verifying on RTX 5090 and pointing out the reset logging gap! Added crate::pipeline::bound(pipeline) in reset (covering both Reset and ResetX) in 8d3a025, verified with cargo test -p victory-gpu --lib list, strict clippy (default + --all-features), and cargo xtask policy.

AI-assisted; synthetic tests only, no game files.

@acetonahard-code

Copy link
Copy Markdown

Heads-up: #461 (opened earlier today) makes the same change. create_list and create_list_x forward pInitialState into new_list, with the same new parameter. The two conflict in list.rs.

Tested on Windows 11, RTX 4070 SUPER (driver 621.14), with the repo toolchain, merged into current main (ffe310e):

cargo test -p victory-gpu passed failed ignored
main 50 0 1
main + this PR 51 0 1
main, --all-features 53 0 -
main + this PR, --all-features 54 0 -
  • The new test passes.
  • No GPU test skipped for lack of a device.
  • cargo clippy --all-targets -- -D warnings, with and without --all-features: clean.

I didn't test with game data.


Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.

github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
@Marvisak
Marvisak merged commit 24effa8 into Marvisak:main Nov 25, 2026
simnJS added a commit to MiamiGame/XTP that referenced this pull request Nov 25, 2026
CreateCommandList and the console's description form take an initial
pipeline, as D3D12's pInitialState; XTP dropped it, so a list had no
pipeline until SetPipelineState, and draws and dispatches recorded before
were dropped for want of one. new_list now sets it as SetPipelineState
does, and logs its first bind once the list is handed out; Reset logs the
first bind of the pipeline it passes too (it already set it).

Critical review: the upstream mechanism holds, with one addition XTP
needs. Besides the draw state, an XTP list keeps the title's pipeline in
List::pipeline, which DispatchX reads to tell thread counts from group
counts (kept_pipeline); upstream has no such field. The creation's
pipeline goes there too, or a DispatchX recorded before SetPipelineState
would still find none.

Test: lists_bind_the_initial_pipeline_on_creation, upstream's (first bind
counted per creation method, null sets none), on a host device, also
checking the draw state's and DispatchX's pipeline.

Ported from Marvisak/VIctory#1446 (head 8d3a025) by geiyiliyabumo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants