[PR #356] [MERGED] d3d12_xs: device slot 70 writes a null view instead of reaching CreatePlacedResource1, again (RT-SLOT70) #408

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

📋 Pull Request Information

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

Base: main ← Head: slot70-null-view


📝 Commits (3)

  • c495458 d3d12_xs: device slot 26 takes the console's struct-return form
  • 9e6f8ae d3d12_xs: device slot 48 creates a command queue proxy from the 32-byte Xbox description
  • f9d20bf d3d12_xs: Xbox device slot 70 writes a null shader-resource view instead of reaching PC CreatePlacedResource1 (retail boot chain stop 14)

📊 Changes

5 files changed (+249 additions, -17 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+7 -1)
📝 runtime/shims/d3d12_xs_device.cpp (+75 -7)
📝 runtime/shims/d3d12_xs_device.h (+12 -2)
📝 runtime/test/device_proxy_test.cpp (+36 -0)
📝 runtime/test/xs_proxy_mock_test.cpp (+119 -7)

📄 Description

Claimed in #14 as RT-SLOT70. Depends on: #349, #350 (their commits are the first two here; this pull request is the third).

What and why

On the console, device slot 70 is (texture_words, view_desc, destination) with no return value: a shader-resource view made from raw descriptions. On the PC, slot 70 is ID3D12Device8::CreatePlacedResource1. main forwards the slot by number, so the PC method takes the title's destination handle for one of its own arguments and writes through it. Here that is a host access violation inside Device::CreatePlacedResource1.

The fix is commit 3073250df by tedin7 (-x, authorship kept; an ancestor of main whose content is not in the tree): the slot is routed to proxy_create_srv_from_raw_x, which writes a null view to the destination and never reaches the PC slot. The cherry-pick conflicted only where main and the two pull requests below it have added neighbours (slot 133's branch, the slot 26 test case); both sides are kept.

This is the first of two commits in the original series. The second (9c8522d22, a raw buffer view when the address is a buffer the layer knows) touches the Vulkan layer too and is not in this pull request.

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.

--run D3D12 calls Ends with
main + #349 + #350 + #142 + #328 1,197 host AV in CreatePlacedResource1, reached through device slot 70
+ this 1,631 host AV at device slot 25 (GetResourceAllocationInfo), right after its first call

The stop this clears is only reachable with #142 and #328 applied as well; the branch of this pull request does not contain them.

The next stop looks like slot 26's twin: another struct-returning method called in the console's form. I will look at it next.

xs_proxy_mock_test under Wine passes, with the new slot 70 case (the null view is written, the PC slot 70 is never called, no write without a destination).

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/356 **Author:** [@Mumogg](https://github.com/Mumogg) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `slot70-null-view` --- ### 📝 Commits (3) - [`c495458`](https://github.com/ubiquitarianism/leonida/commit/c4954581ae27e9db5baabaea091302ed54eb96ea) d3d12_xs: device slot 26 takes the console's struct-return form - [`9e6f8ae`](https://github.com/ubiquitarianism/leonida/commit/9e6f8ae1332aed8efb5b2ed78a4780340c29fc40) d3d12_xs: device slot 48 creates a command queue proxy from the 32-byte Xbox description - [`f9d20bf`](https://github.com/ubiquitarianism/leonida/commit/f9d20bf9b045ebaf8c7165eef3ae72cff9ef1410) d3d12_xs: Xbox device slot 70 writes a null shader-resource view instead of reaching PC CreatePlacedResource1 (retail boot chain stop 14) ### 📊 Changes **5 files changed** (+249 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+7 -1) 📝 `runtime/shims/d3d12_xs_device.cpp` (+75 -7) 📝 `runtime/shims/d3d12_xs_device.h` (+12 -2) 📝 `runtime/test/device_proxy_test.cpp` (+36 -0) 📝 `runtime/test/xs_proxy_mock_test.cpp` (+119 -7) </details> ### 📄 Description Claimed in #14 as `RT-SLOT70`. Depends on: #349, #350 (their commits are the first two here; this pull request is the third). ### What and why On the console, device slot 70 is `(texture_words, view_desc, destination)` with no return value: a shader-resource view made from raw descriptions. On the PC, slot 70 is `ID3D12Device8::CreatePlacedResource1`. `main` forwards the slot by number, so the PC method takes the title's destination handle for one of its own arguments and writes through it. Here that is a host access violation inside `Device::CreatePlacedResource1`. The fix is commit `3073250df` by tedin7 (`-x`, authorship kept; an ancestor of `main` whose content is not in the tree): the slot is routed to `proxy_create_srv_from_raw_x`, which writes a null view to the destination and never reaches the PC slot. The cherry-pick conflicted only where `main` and the two pull requests below it have added neighbours (slot 133's branch, the slot 26 test case); both sides are kept. This is the first of two commits in the original series. The second (`9c8522d22`, a raw buffer view when the address is a buffer the layer knows) touches the Vulkan layer too and is not in this pull request. ### 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`. | `--run` | D3D12 calls | Ends with | |---|---|---| | `main` + #349 + #350 + #142 + #328 | 1,197 | host AV in `CreatePlacedResource1`, reached through device slot 70 | | + this | 1,631 | host AV at device slot 25 (`GetResourceAllocationInfo`), right after its first call | The stop this clears is only reachable with #142 and #328 applied as well; the branch of this pull request does not contain them. The next stop looks like slot 26's twin: another struct-returning method called in the console's form. I will look at it next. `xs_proxy_mock_test` under Wine passes, with the new slot 70 case (the null view is written, the PC slot 70 is never called, no write without a destination). 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:47 +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#408
No description provided.