[PR #219] [CLOSED] d3d12_xs: route device slots 86, 101, and 108 to PC Device2/Device5/Device8 (reopens #7201) #271

Closed
opened 2026-11-26 20:17:20 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/219
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: old-pr/9954


📝 Commits (1)

  • 1b07215 d3d12_xs: route device slots 86, 101, and 108 to PC Device2/Device5/Device8

📊 Changes

5 files changed (+362 additions, -6 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+7 -1)
📝 runtime/shims/d3d12_xs_device.cpp (+108 -1)
📝 runtime/shims/d3d12_xs_device.h (+11 -3)
📝 runtime/test/device_proxy_test.cpp (+98 -0)
📝 runtime/test/xs_proxy_mock_test.cpp (+138 -1)

📄 Description

Carried over from old PR 9954 by justr4mzi in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9954, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
justr4mzi: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed in the coordination issue as: the device slot 86/101/108 claim in #7049 (carried over from #7201)

Reopens #7201, which was closed in the PR reset, rebased onto current main.

What and why

Three Xbox device slots that sit past the PC vtable layout are routed to their PC counterparts on DeviceProxy:

  • Slot 86: CreatePipelineState(stream desc, riid, out) -> PC slot 47 (ID3D12Device2::CreatePipelineState). It refuses with E_NOINTERFACE on devices below Device2, zeroes *out and returns E_POINTER on a null IID.
  • Slot 101: CreateStateObject -> PC slot 62 (ID3D12Device5::CreateStateObject), with the same guards.
  • Slot 108: GetResourceAllocationInfo2 -> PC slot 68 (ID3D12Device8::GetResourceAllocationInfo2).
    • It accepts the console C-ABI order (return buffer in RCX, device in RDX) as well as the PC order.
    • It reads the title's 56-byte D3D12_RESOURCE_DESC entries and expands each one into a zeroed D3D12_RESOURCE_DESC1.
    • It normalizes Xbox layout words (0x101, 0x105) to ROW_MAJOR for buffers and UNKNOWN for everything else.
    • It masks flags to the PC set.
    • It refuses a count with a null array with {UINT64_MAX, 0}.

Retail evidence, from the #7201 thread:

  • Pipodi: without the PR, the first slot 108 call returns E_NOTIMPL and the title asserts. With it, that assert is gone.
  • Zunraz: slot 86 is reached, and 6 CreatePipelineState calls succeed through it.
  • LooperSalty: static evidence for the slot 86 call shape.
  • Cresceda's frame-loop measurement (#8554) used it.
  • Slot 101 has not been reached on retail yet, so it stays a hypothesis.

Changes from #7201 in this rebase:

  • Main's slot 133 (CreatePlacedResourceX) is kept alongside the new slots, in slot_name, device_slot_overridden, the dispatch and the mock test.
  • Slot 108 now masks flags with slot 133's PC set, 0x5FF: USE_TIGHT_ALIGNMENT is kept and 0x200 is dropped, instead of 0x1FF. This addresses tedin7's flag-mask note.

Open note (evansedeno): a console DEPTH_STENCIL | UNORDERED_ACCESS texture sizes through slot 25 but comes back {UINT64_MAX, 0} through slot 108. If #7679's pc_resource_desc lands, slot 108 should use it for each entry so that the two slots agree.

Tested

  • #7201 head 1d080f4 (the same code before the rebase):
    • evansedeno: native Windows 11, RTX 5080 / 621.24, 8/8 for device_proxy|device_proxy_trace|xs_proxy_mock.*.
    • tedin7: Wine, RTX 4090, mock test passes, negative control fails as expected.
    • Earlier heads: 12/12 on RX 6700 XT, RX 9070 XT, RX 7800 XT, RTX 4090, RTX 5070 Ti and RTX 5090, with and without LEONIDA_VK_VALIDATION=1.
  • This rebase: the conflicts with slot 133 were resolved by hand, and I have not built it on Windows yet. CI is the first build of this exact commit.

AI-assisted: yes (Claude)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/219 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/9954` --- ### 📝 Commits (1) - [`1b07215`](https://github.com/ubiquitarianism/leonida/commit/1b07215c84443b87ad152ffdc8d23b0356125456) d3d12_xs: route device slots 86, 101, and 108 to PC Device2/Device5/Device8 ### 📊 Changes **5 files changed** (+362 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+7 -1) 📝 `runtime/shims/d3d12_xs_device.cpp` (+108 -1) 📝 `runtime/shims/d3d12_xs_device.h` (+11 -3) 📝 `runtime/test/device_proxy_test.cpp` (+98 -0) 📝 `runtime/test/xs_proxy_mock_test.cpp` (+138 -1) </details> ### 📄 Description > Carried over from **old PR 9954** by `justr4mzi` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9954`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `justr4mzi`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed in the coordination issue as: the device slot 86/101/108 claim in `#7049` (carried over from `#7201`) Reopens `#7201`, which was closed in the PR reset, rebased onto current main. ### What and why Three Xbox device slots that sit past the PC vtable layout are routed to their PC counterparts on DeviceProxy: - **Slot 86**: CreatePipelineState(stream desc, riid, out) -> PC slot 47 (ID3D12Device2::CreatePipelineState). It refuses with E_NOINTERFACE on devices below Device2, zeroes `*out` and returns E_POINTER on a null IID. - **Slot 101**: CreateStateObject -> PC slot 62 (ID3D12Device5::CreateStateObject), with the same guards. - **Slot 108**: GetResourceAllocationInfo2 -> PC slot 68 (ID3D12Device8::GetResourceAllocationInfo2). - It accepts the console C-ABI order (return buffer in RCX, device in RDX) as well as the PC order. - It reads the title's 56-byte D3D12_RESOURCE_DESC entries and expands each one into a zeroed D3D12_RESOURCE_DESC1. - It normalizes Xbox layout words (0x101, 0x105) to ROW_MAJOR for buffers and UNKNOWN for everything else. - It masks flags to the PC set. - It refuses a count with a null array with {UINT64_MAX, 0}. Retail evidence, from the `#7201` thread: - Pipodi: without the PR, the first slot 108 call returns E_NOTIMPL and the title asserts. With it, that assert is gone. - Zunraz: slot 86 is reached, and 6 CreatePipelineState calls succeed through it. - LooperSalty: static evidence for the slot 86 call shape. - Cresceda's frame-loop measurement (`#8554`) used it. - Slot 101 has not been reached on retail yet, so it stays a hypothesis. **Changes from `#7201` in this rebase:** - Main's slot 133 (CreatePlacedResourceX) is kept alongside the new slots, in `slot_name`, `device_slot_overridden`, the dispatch and the mock test. - Slot 108 now masks flags with slot 133's PC set, `0x5FF`: USE_TIGHT_ALIGNMENT is kept and 0x200 is dropped, instead of `0x1FF`. This addresses tedin7's flag-mask note. **Open note (evansedeno):** a console DEPTH_STENCIL | UNORDERED_ACCESS texture sizes through slot 25 but comes back {UINT64_MAX, 0} through slot 108. If `#7679`'s `pc_resource_desc` lands, slot 108 should use it for each entry so that the two slots agree. ### Tested - **`#7201` head 1d080f4** (the same code before the rebase): - evansedeno: native Windows 11, RTX 5080 / 621.24, 8/8 for `device_proxy|device_proxy_trace|xs_proxy_mock.*`. - tedin7: Wine, RTX 4090, mock test passes, negative control fails as expected. - Earlier heads: 12/12 on RX 6700 XT, RX 9070 XT, RX 7800 XT, RTX 4090, RTX 5070 Ti and RTX 5090, with and without LEONIDA_VK_VALIDATION=1. - **This rebase:** the conflicts with slot 133 were resolved by hand, and I have not built it on Windows yet. CI is the first build of this exact commit. AI-assisted: yes (Claude) ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:20 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#271
No description provided.