[PR #385] [MERGED] d3d12_xs: device slot 74 returns S_OK instead of reaching ShaderCacheControl, again (RT-SLOT74) #437

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/385
Author: @Mumogg
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: slot74-stand-in


📝 Commits (4)

  • f22b85e d3d12_xs: device slot 74 (pointer, u32, pointer) returns S_OK instead of reaching PC ShaderCacheControl (#7231)
  • ad9edee d3d12_xs: slot 74's stand-in is for the title's calls; a host caller gets PC ShaderCacheControl
  • 3ca10df docs: device slot 74's S_OK stand-in has a row in the Xbox-only table
  • d7e2944 Merge main into RT-SLOT74 (#385)

📊 Changes

5 files changed (+135 additions, -45 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+1 -0)
📝 runtime/CMakeLists.txt (+1 -0)
📝 runtime/shims/d3d12_xs_device.cpp (+79 -41)
📝 runtime/shims/d3d12_xs_device.h (+3 -1)
📝 runtime/test/xs_proxy_mock_test.cpp (+51 -3)

📄 Description

Claimed in #14 as RT-SLOT74. Depends on: #349, #350, #356, #362, #369, #375, #377, #383 (their commits come first here; this pull request is the last commit).

What and why

After #383 the title calls device slot 74 once, with (pointer, u32, pointer). main forwards it by number to the PC slot 74, ID3D12Device9::ShaderCacheControl, which reads the first word as its flags and fails; the title then stops on its own int3.

Commit cdeee35aa by tedin7 (-x, authorship kept; an ancestor of main whose content is not in the tree) gives the slot a handler that does not call the PC device, writes nothing through the pointers and returns S_OK. It is a stand-in: what the console call does is not measured, and the commit says so.

The commit also moves the Xbox slot routes into one function (route_xbox_device_slot) so that an environment override which moves a route onto slot 74 wins over the built-in handler. Adapted to main, as the commit message says: inside that function the queue route calls proxy_create_command_queue_xbox, the 32-byte description of #350.

Measured

Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off, on main ece4ba5b3, with #142 and #328 applied on top for the boot runs (they are not in this branch).

--run Traced D3D12 calls Ends with
up to #383 1,657 the title's int3 after ShaderCacheControl fails
+ this 11,916 a call through a null pointer in the host, right after the first call of device slot 108

Of the 11,916, 10,241 are ID3D12Device5::CreateLifetimeTracker, which the layer answers as unsupported; the title goes on regardless. Past this stop the log shows the DirectStorage shim in use (CreateStatusArray, CreateQueue1, zlib requests inflated on the CPU), the first call of device slot 67 (the console's compute pipeline from native code) and of slot 57.

The next stop is device slot 108, past the PC device table. #219 looks like the pull request for it; I will measure it on top of this and report there.

xs_proxy_mock_test under Wine: the default run passes with the new slot 74 case, and --env-slots, --env-slots-invalid and the new --env-slots-74 exit 0.

Not built with MSVC and not run on Windows.

AI-assisted (Claude Code); built and run on the machine above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt


🔄 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/385 **Author:** [@Mumogg](https://github.com/Mumogg) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `slot74-stand-in` --- ### 📝 Commits (4) - [`f22b85e`](https://github.com/ubiquitarianism/leonida/commit/f22b85e697610b2846617e0ab9ef0d7e19f029ea) d3d12_xs: device slot 74 (pointer, u32, pointer) returns S_OK instead of reaching PC ShaderCacheControl (#7231) - [`ad9edee`](https://github.com/ubiquitarianism/leonida/commit/ad9edee610dd7486383b9ab746ccab84cf0cd46c) d3d12_xs: slot 74's stand-in is for the title's calls; a host caller gets PC ShaderCacheControl - [`3ca10df`](https://github.com/ubiquitarianism/leonida/commit/3ca10dfe1f90824bb52efe653677cd821f3ac138) docs: device slot 74's S_OK stand-in has a row in the Xbox-only table - [`d7e2944`](https://github.com/ubiquitarianism/leonida/commit/d7e2944757a8f3df6c53a45013994bdabfdaaa5d) Merge main into RT-SLOT74 (#385) ### 📊 Changes **5 files changed** (+135 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+1 -0) 📝 `runtime/CMakeLists.txt` (+1 -0) 📝 `runtime/shims/d3d12_xs_device.cpp` (+79 -41) 📝 `runtime/shims/d3d12_xs_device.h` (+3 -1) 📝 `runtime/test/xs_proxy_mock_test.cpp` (+51 -3) </details> ### 📄 Description Claimed in #14 as `RT-SLOT74`. Depends on: #349, #350, #356, #362, #369, #375, #377, #383 (their commits come first here; this pull request is the last commit). ### What and why After #383 the title calls device slot 74 once, with `(pointer, u32, pointer)`. `main` forwards it by number to the PC slot 74, `ID3D12Device9::ShaderCacheControl`, which reads the first word as its flags and fails; the title then stops on its own `int3`. Commit `cdeee35aa` by tedin7 (`-x`, authorship kept; an ancestor of `main` whose content is not in the tree) gives the slot a handler that does not call the PC device, writes nothing through the pointers and returns `S_OK`. It is a stand-in: what the console call does is not measured, and the commit says so. The commit also moves the Xbox slot routes into one function (`route_xbox_device_slot`) so that an environment override which moves a route onto slot 74 wins over the built-in handler. Adapted to `main`, as the commit message says: inside that function the queue route calls `proxy_create_command_queue_xbox`, the 32-byte description of #350. ### Measured Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off, on `main` `ece4ba5b3`, with #142 and #328 applied on top for the boot runs (they are not in this branch). | `--run` | Traced D3D12 calls | Ends with | |---|---|---| | up to #383 | 1,657 | the title's `int3` after `ShaderCacheControl` fails | | + this | 11,916 | a call through a null pointer in the host, right after the first call of device slot 108 | Of the 11,916, 10,241 are `ID3D12Device5::CreateLifetimeTracker`, which the layer answers as unsupported; the title goes on regardless. Past this stop the log shows the DirectStorage shim in use (`CreateStatusArray`, `CreateQueue1`, zlib requests inflated on the CPU), the first call of device slot 67 (the console's compute pipeline from native code) and of slot 57. The next stop is device slot 108, past the PC device table. #219 looks like the pull request for it; I will measure it on top of this and report there. `xs_proxy_mock_test` under Wine: the default run passes with the new slot 74 case, and `--env-slots`, `--env-slots-invalid` and the new `--env-slots-74` exit 0. Not built with MSVC and not run on Windows. AI-assisted (Claude Code); built and run on the machine above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt --- <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:52 +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#437
No description provided.