d3d12_xs: map the GDK 2504 graphical command list IID to the PC list #398

Open
andersonlucasg3 wants to merge 1 commit from upstream-pr/398 into main
andersonlucasg3 commented 2026-12-03 00:55:27 +00:00 (Migrated from github.com)

Imported from omonkeyz/xbox-emulator. Originally posted by andersonlucasg3 on 2026-12-03T00:55:27Z.


Library / area: crates/compat/d3d12_xs — Xbox CreateCommandList (slot 73) wrapper forwarding to the PC ID3D12Device::CreateCommandList (slot 12).

Exports changed (exports.txt rows): none.

Source of the behaviour: the GDK 2504 revision creates graphical command lists with the newer console list IID {c3827890-4024-474c-98cf-645b51dc4874}. The PC runtime only exposes the classic ID3D12GraphicsCommandList IID {5b160d0f-ac1b-4185-8ba8-b3ae42a5a455}, so the native call returns E_NOINTERFACE. The DMA list path already remaps its console IID to the PC graphics list IID; the graphical-list case was missing.

Change: pure pc_list_iid(&Guid) -> Option<&'static Guid> helper mapping the GDK 2504 console graphics-list IID to IID_GRAPHICS_COMMAND_LIST; on E_NOINTERFACE from slot 12, retry once with the mapped PC IID and continue through the existing cmdlist_wrap::wrap path; the remap is logged once per process. The unit test covers the mapping and the negatives (PC graphics IID, DMA IID, IUnknown) without a device or GPU.

Evidence: with the change, the first creation remaps once and every following CreateCommandList call returns hr=0x00000000; before, the first creation returned hr=0x80004002 and command-list creation stopped. The run later reaches unrelated limitations (descriptor heap sizing, etc.), which are out of scope for this change.

  • cargo test -p d3d12_xs targeted test gdk_2504_console_command_list_iid_maps_to_the_pc_list passes; the rest of the crate suite needs console DLL fixtures and GPU hardware
  • No game or console files and no binaries included
  • No fake success; anything not possible is left missing with a note
<!-- greyfinch-sync:omonkeyz/xbox-emulator:issue:5617567924 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/pull/398). Originally posted by [andersonlucasg3](https://github.com/andersonlucasg3) on 2026-12-03T00:55:27Z. --- **Library / area:** `crates/compat/d3d12_xs` — Xbox `CreateCommandList` (slot 73) wrapper forwarding to the PC `ID3D12Device::CreateCommandList` (slot 12). **Exports changed (exports.txt rows):** none. **Source of the behaviour:** the GDK 2504 revision creates graphical command lists with the newer console list IID `{c3827890-4024-474c-98cf-645b51dc4874}`. The PC runtime only exposes the classic `ID3D12GraphicsCommandList` IID `{5b160d0f-ac1b-4185-8ba8-b3ae42a5a455}`, so the native call returns `E_NOINTERFACE`. The DMA list path already remaps its console IID to the PC graphics list IID; the graphical-list case was missing. **Change:** pure `pc_list_iid(&Guid) -> Option<&'static Guid>` helper mapping the GDK 2504 console graphics-list IID to `IID_GRAPHICS_COMMAND_LIST`; on `E_NOINTERFACE` from slot 12, retry once with the mapped PC IID and continue through the existing `cmdlist_wrap::wrap` path; the remap is logged once per process. The unit test covers the mapping and the negatives (PC graphics IID, DMA IID, `IUnknown`) without a device or GPU. **Evidence:** with the change, the first creation remaps once and every following `CreateCommandList` call returns `hr=0x00000000`; before, the first creation returned `hr=0x80004002` and command-list creation stopped. The run later reaches unrelated limitations (descriptor heap sizing, etc.), which are out of scope for this change. - [x] `cargo test -p d3d12_xs` targeted test `gdk_2504_console_command_list_iid_maps_to_the_pc_list` passes; the rest of the crate suite needs console DLL fixtures and GPU hardware - [x] No game or console files and no binaries included - [x] No fake success; anything not possible is left `missing` with a note
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/398:upstream-pr/398'
git switch 'upstream-pr/398'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/398'
git switch 'upstream-pr/398'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/398'
git switch 'upstream-pr/398'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/398'
git switch 'main'
git merge --squash 'upstream-pr/398'
git switch 'main'
git merge --ff-only 'upstream-pr/398'
git switch 'main'
git merge 'upstream-pr/398'
git push origin 'main'
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!398
No description provided.