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

Closed
github-bot wants to merge 1 commit from gh-pr/338/head into gh-pr/338/base
Owner

@⁠GDAgent on GitHub · 2026-11-23 20:30 UTC · original
GDAgent:fix/d3d12-queue-console-flags → main · +42 −2 · 1 files · 1 commits · closed without merging

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.
**@⁠GDAgent** on GitHub · 2026-11-23 20:30 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/338) `GDAgent:fix/d3d12-queue-console-flags` → `main` · +42 −2 · 1 files · 1 commits · closed without merging **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.
CreateCommandQueueX with flags 2 and 3 (compute queues) from a very popular AAA
title was forwarded with the console flags unchanged, and the PC runtime
refused it with E_INVALIDARG (RDNA2, native Windows 11; not run under Proton).
The only PC queue flag is DISABLE_GPU_TIMEOUT (bit 0). xone_queue::translate now
keeps bit 0, drops the console-only bits, and logs the flags together with the
other translated fields.

Tests: xone_queue::tests (console flags dropped and bit 0 kept for 0, 1, 2, 3 and
a high bit; DMA type, priority and node still map).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:19:27 +00:00
github-bot closed this pull request 2026-11-26 06:19:27 +00:00
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-25 13:50 UTC · original

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

**@⁠omonkeyz** on GitHub · 2026-11-25 13:50 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/338#issuecomment-7164361582) 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

This discussion has been locked. Commenting is limited to contributors.
No description provided.