d3d12_xs: skip compute pipelines quietly in the rect-list path #324

Closed
GDAgent wants to merge 3 commits from upstream-pr/324 into main
GDAgent commented 2026-11-23 19:02:21 +00:00 (Migrated from github.com)

Imported from omonkeyz/xbox-emulator. Originally posted by GDAgent on 2026-11-23T19:02:21Z.


Builds on #280 (rect-list pipelines from PSO streams). This branch carries #280's two commits (5441680, 025cc11); only the third commit (09ecfe5) belongs to this PR. Once #280 lands I will rebase onto main; until then please review the last commit only (git diff 025cc11..).

What

d3d12_xs: cl2_state.rs (apply_rect), with two small lookups in device_x.rs and pso_async.rs. No exports change.

A title can bind a compute pipeline on a graphics command list while the primitive topology is still 17 (rect list). apply_rect then treated the PSO as a graphics pipeline, found neither a recorded PC description nor a pipeline stream, and logged an "unknown pipeline" refusal. A compute pipeline draws nothing, so there is nothing to expand and nothing to warn about.

  • apply_rect returns without a refusal when the PSO is a known compute pipeline: one registered through device_x::register_compute (CreateComputePSO_X, the PC compute entry point that forwards to it, deserialised and derived compute PSOs) or a pso_async compute placeholder handle.
  • A PSO that is neither a known graphics nor a known compute pipeline is still refused and logged, as before.
  • device_x::is_compute and pso_async::is_compute_placeholder are the two lookups; rectlist::was_refused is #[cfg(test)] only.

Why

Evidence from DRED-marked runs of The Matrix Awakens (Xbox Series X build), native Windows 11 on an RDNA2 GPU (gfx1032): two runs logged 26 and 35 unknown-pipeline refusals. With TOMBOX_DRED=2 each refusal line was extended locally with the PSO's shader hashes, and every one of them was vs 0, ps 0, cs <non-zero>: all compute pipelines. The refusals were only logged; nothing was drawn wrongly because of them.

Tests

  • New WARP test warp_rectlist_compute_pso_bound_under_topology_17_is_skipped_quietly (ignored by default like the other rect-list tests): binds a registered compute PSO and an unregistered one under topology 17, checks that only the unregistered one is refused, then draws a graphics rect on the same list and checks all four corners. With the new match arm removed it fails with "registered compute PSO ... was reported as an unknown rect-list pipeline".
  • cargo test -p d3d12_xs --lib warp_rectlist -- --ignored: 3 passed, 0 failed.
  • cargo test -p d3d12_xs --lib -- --test-threads=1 (TOMBOX_REMOVED_EXIT_MS=off): 661 passed, 4 failed, 73 ignored. The four failures are not touched by this PR and also fail on main on this GPU (placement tests: see the separate PR; fixture test: no console DLL): alias::tests::msaa_depth_with_a_larger_pc_layout_never_overlaps_the_next_title_placement, placed_offset::tests::uneven_views_get_exact_helpers_and_msaa_shares_the_alias_heap, title_shadow::tests::buffer_then_texture_migrates_to_one_local_heap_and_keeps_bytes (placement tests that fail on an RDNA2 GPU; separate PR), and xs_exports::console_fixed_tests::fixed_result_dxgix_exports_match_every_console_d3d12_xs (needs a console d3d12_xs.dll fixture). dred::tests::report_is_one_shot_and_needs_an_armed_device passes when run on its own without TOMBOX_REMOVED_EXIT_MS.
  • pr_gate.py --base 025cc11 (the head of #280): 0 problems (5 files checked).
  • Native Windows 11; not run under Proton.

Not verified

  • The pso_async placeholder lookup has no dedicated test (it needs the async PSO machinery); it reads the kind of the existing placeholder map.
  • Not run in a title with this change. The refusals were only logged, so the effect is on log output, not rendering.
  • Not rebased onto current main: the branch stays on the base of #280 so that the stack is exactly #280 plus one commit.
<!-- greyfinch-sync:omonkeyz/xbox-emulator:issue:6566681931 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/pull/324). Originally posted by [GDAgent](https://github.com/GDAgent) on 2026-11-23T19:02:21Z. --- Builds on #280 (rect-list pipelines from PSO streams). This branch carries #280's two commits (`5441680`, `025cc11`); only the third commit (`09ecfe5`) belongs to this PR. Once #280 lands I will rebase onto `main`; until then please review the last commit only (`git diff 025cc11..`). ## What `d3d12_xs`: `cl2_state.rs` (`apply_rect`), with two small lookups in `device_x.rs` and `pso_async.rs`. No exports change. A title can bind a compute pipeline on a graphics command list while the primitive topology is still 17 (rect list). `apply_rect` then treated the PSO as a graphics pipeline, found neither a recorded PC description nor a pipeline stream, and logged an "unknown pipeline" refusal. A compute pipeline draws nothing, so there is nothing to expand and nothing to warn about. - `apply_rect` returns without a refusal when the PSO is a known compute pipeline: one registered through `device_x::register_compute` (`CreateComputePSO_X`, the PC compute entry point that forwards to it, deserialised and derived compute PSOs) or a `pso_async` compute placeholder handle. - A PSO that is neither a known graphics nor a known compute pipeline is still refused and logged, as before. - `device_x::is_compute` and `pso_async::is_compute_placeholder` are the two lookups; `rectlist::was_refused` is `#[cfg(test)]` only. ## Why Evidence from DRED-marked runs of The Matrix Awakens (Xbox Series X build), native Windows 11 on an RDNA2 GPU (gfx1032): two runs logged 26 and 35 unknown-pipeline refusals. With `TOMBOX_DRED=2` each refusal line was extended locally with the PSO's shader hashes, and every one of them was `vs 0, ps 0, cs <non-zero>`: all compute pipelines. The refusals were only logged; nothing was drawn wrongly because of them. ## Tests - New WARP test `warp_rectlist_compute_pso_bound_under_topology_17_is_skipped_quietly` (ignored by default like the other rect-list tests): binds a registered compute PSO and an unregistered one under topology 17, checks that only the unregistered one is refused, then draws a graphics rect on the same list and checks all four corners. With the new match arm removed it fails with "registered compute PSO ... was reported as an unknown rect-list pipeline". - `cargo test -p d3d12_xs --lib warp_rectlist -- --ignored`: 3 passed, 0 failed. - `cargo test -p d3d12_xs --lib -- --test-threads=1` (`TOMBOX_REMOVED_EXIT_MS=off`): 661 passed, 4 failed, 73 ignored. The four failures are not touched by this PR and also fail on `main` on this GPU (placement tests: see the separate PR; fixture test: no console DLL): `alias::tests::msaa_depth_with_a_larger_pc_layout_never_overlaps_the_next_title_placement`, `placed_offset::tests::uneven_views_get_exact_helpers_and_msaa_shares_the_alias_heap`, `title_shadow::tests::buffer_then_texture_migrates_to_one_local_heap_and_keeps_bytes` (placement tests that fail on an RDNA2 GPU; separate PR), and `xs_exports::console_fixed_tests::fixed_result_dxgix_exports_match_every_console_d3d12_xs` (needs a console `d3d12_xs.dll` fixture). `dred::tests::report_is_one_shot_and_needs_an_armed_device` passes when run on its own without `TOMBOX_REMOVED_EXIT_MS`. - `pr_gate.py --base 025cc11` (the head of #280): 0 problems (5 files checked). - Native Windows 11; not run under Proton. ## Not verified - The `pso_async` placeholder lookup has no dedicated test (it needs the async PSO machinery); it reads the `kind` of the existing placeholder map. - Not run in a title with this change. The refusals were only logged, so the effect is on log output, not rendering. - Not rebased onto current `main`: the branch stays on the base of #280 so that the stack is exactly #280 plus one commit.
omonkeyz commented 2026-11-25 13:49:45 +00:00 (Migrated from github.com)

Imported from omonkeyz/xbox-emulator. Originally posted by omonkeyz on 2026-11-25T13:49:45Z.


Applied on main in 56944cf (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

<!-- greyfinch-sync:omonkeyz/xbox-emulator:comment:7164350135 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/pull/324#issuecomment-7164350135). Originally posted by [omonkeyz](https://github.com/omonkeyz) on 2026-11-25T13:49:45Z. --- Applied on main in 56944cf (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

Pull request closed

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
omonkeyz/xbox-emulator!324
No description provided.