d3d12_xs: drop console-only command queue flags, keep DISABLE_GPU_TIMEOUT #338

Closed
GDAgent wants to merge 1 commit from upstream-pr/338 into main
GDAgent commented 2026-11-23 20:30:38 +00:00 (Migrated from github.com)

Imported from omonkeyz/xbox-emulator. Originally posted by GDAgent on 2026-11-23T20:30:38Z.


Library / area: d3d12_xs (xone_queue.rs)

Exports changed (exports.txt rows): none

Source of the behaviour: call sites of a very popular AAA title (Xbox Series X build), native Windows 11 on an RDNA2 GPU; not run under Proton.

What

xone_queue::translate rewrites the Xbox D3D12XBOX_COMMAND_QUEUE_DESC into the PC one before the real CreateCommandQueue. It mapped type, priority and node mask but forwarded the flags unchanged. It now keeps bit 0 (the PC DISABLE_GPU_TIMEOUT) and clears the rest, and the "translated" log line also shows the PC flags.

Why / evidence

The title creates compute queues (type 2) with console flags 0x2 and 0x3. Before this change they were forwarded unchanged and the PC runtime refused them with E_INVALIDARG, because the only PC queue flag is DISABLE_GPU_TIMEOUT (bit 0). Masking to bit 0 is exact for the PC side, and flag 3 keeps its timeout bit.

With this change the same calls in a run on native Windows 11 (RDNA2):

xone.queue Xbox queue desc type=0x2 priority=0 flags=0x2 node=0x0 -> PC type=2 priority=0 flags=0x0 node=0
CreateCommandQueueX type=2 flags=0 -> hr=0x00000000
xone.queue Xbox queue desc type=0x2 priority=0 flags=0x3 node=0x0 -> PC type=2 priority=0 flags=0x1 node=0
CreateCommandQueueX type=2 flags=1 -> hr=0x00000000

An earlier version of this change also made CreateCommandListX fall back for unknown IIDs. That is left out: #296 maps the one IID the title asks for, and a generic fallback would hide a wrong IID instead of reporting it.

Tests

  • xone_queue::tests::console_only_queue_flags_are_dropped_and_the_pc_flag_kept: flags 0, 1, 2, 3 and 0x8000_0002 map to 0, 1, 0, 1 and 0 with type, priority and node unchanged.
  • xone_queue::tests::dma_type_priority_and_node_still_map_to_pc_values: DMA type becomes COPY, unknown priority becomes HIGH, node 4 becomes 1, and a PC-shaped desc is unchanged apart from the flags.
  • cargo test -p d3d12_xs --lib -- --test-threads=1 (TOMBOX_REMOVED_EXIT_MS=off): 666 passed, 4 failed, 71 ignored. The 4 failures are the ones that also fail on main here: 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, xs_exports::console_fixed_tests::fixed_result_dxgix_exports_match_every_console_d3d12_xs (the last needs console dumps). The two new xone_queue tests pass.

Not verified

  • The unit tests check the descriptor translation only; the host runtime's refusal of the old flags is not reproduced in a test (it is the log above, from a title run that also carried other local changes).
  • Flag bits other than bit 0 are dropped; if a console flag has an effect that a PC flag could reproduce, it is not modelled here.
<!-- greyfinch-sync:omonkeyz/xbox-emulator:issue:6568221769 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/pull/338). Originally posted by [GDAgent](https://github.com/GDAgent) on 2026-11-23T20:30:38Z. --- **Library / area:** `d3d12_xs` (`xone_queue.rs`) **Exports changed (exports.txt rows):** none **Source of the behaviour:** call sites of a very popular AAA title (Xbox Series X build), native Windows 11 on an RDNA2 GPU; not run under Proton. ## What `xone_queue::translate` rewrites the Xbox `D3D12XBOX_COMMAND_QUEUE_DESC` into the PC one before the real `CreateCommandQueue`. It mapped type, priority and node mask but forwarded the flags unchanged. It now keeps bit 0 (the PC `DISABLE_GPU_TIMEOUT`) and clears the rest, and the "translated" log line also shows the PC flags. ## Why / evidence The title creates compute queues (type 2) with console flags 0x2 and 0x3. Before this change they were forwarded unchanged and the PC runtime refused them with `E_INVALIDARG`, because the only PC queue flag is `DISABLE_GPU_TIMEOUT` (bit 0). Masking to bit 0 is exact for the PC side, and flag 3 keeps its timeout bit. With this change the same calls in a run on native Windows 11 (RDNA2): ``` xone.queue Xbox queue desc type=0x2 priority=0 flags=0x2 node=0x0 -> PC type=2 priority=0 flags=0x0 node=0 CreateCommandQueueX type=2 flags=0 -> hr=0x00000000 xone.queue Xbox queue desc type=0x2 priority=0 flags=0x3 node=0x0 -> PC type=2 priority=0 flags=0x1 node=0 CreateCommandQueueX type=2 flags=1 -> hr=0x00000000 ``` An earlier version of this change also made `CreateCommandListX` fall back for unknown IIDs. That is left out: #296 maps the one IID the title asks for, and a generic fallback would hide a wrong IID instead of reporting it. ## Tests - `xone_queue::tests::console_only_queue_flags_are_dropped_and_the_pc_flag_kept`: flags 0, 1, 2, 3 and `0x8000_0002` map to 0, 1, 0, 1 and 0 with type, priority and node unchanged. - `xone_queue::tests::dma_type_priority_and_node_still_map_to_pc_values`: DMA type becomes COPY, unknown priority becomes HIGH, node 4 becomes 1, and a PC-shaped desc is unchanged apart from the flags. - `cargo test -p d3d12_xs --lib -- --test-threads=1` (`TOMBOX_REMOVED_EXIT_MS=off`): 666 passed, 4 failed, 71 ignored. The 4 failures are the ones that also fail on `main` here: `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`, `xs_exports::console_fixed_tests::fixed_result_dxgix_exports_match_every_console_d3d12_xs` (the last needs console dumps). The two new `xone_queue` tests pass. ## Not verified - The unit tests check the descriptor translation only; the host runtime's refusal of the old flags is not reproduced in a test (it is the log above, from a title run that also carried other local changes). - Flag bits other than bit 0 are dropped; if a console flag has an effect that a PC flag could reproduce, it is not modelled here.
omonkeyz commented 2026-11-25 13:50:14 +00:00 (Migrated from github.com)

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


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

<!-- greyfinch-sync:omonkeyz/xbox-emulator:comment:7164361582 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/pull/338#issuecomment-7164361582). Originally posted by [omonkeyz](https://github.com/omonkeyz) on 2026-11-25T13:50:14Z. --- Applied on main in 9a1e9ba (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!338
No description provided.