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

Manually merged
github merged 3 commits from gh-pr/356/head into gh-pr/356/base 2026-11-26 08:55:13 +00:00
Owner

@⁠Mumogg on GitHub · 2026-11-24 03:53 UTC · original
Mumogg:slot70-null-view → main · +249 −17 · 5 files · 3 commits · merged 2026-11-24 04:31 UTC

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

**@⁠Mumogg** on GitHub · 2026-11-24 03:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/356) `Mumogg:slot70-null-view` → `main` · +249 −17 · 5 files · 3 commits · merged 2026-11-24 04:31 UTC 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
The retail executable calls GetCustomHeapProperties with the return buffer in RCX and the device in RDX. The forwarder took RCX for the proxy and faulted.

AI-assisted.

(cherry picked from commit 86b8e04e4c)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 0cde63d618)

Adapted to main by Mumogg: main already routes slot 48 through its Xbox slot table (LEONIDA_XS_QUEUE_X_SLOT),
so the route now calls proxy_create_command_queue_xbox instead of a fixed slot 48 branch, and xs_proxy_mock's
check_xbox_slots and the environment case pass the console's 32-byte description.
(cherry picked from commit 3073250df5)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:55:11 +00:00
github manually merged commit f9d20bf9b0 into gh-pr/356/base 2026-11-26 08:55:13 +00:00
Author
Owner

@⁠ubiquitarianism on GitHub · 2026-11-24 04:31 UTC · original

Merged after a Windows build (MSVC, RTX-less AMD RX 6800 box). ctest shows only the 4 failures main already has, and xs_proxy_mock, device_proxy, root_sig and xmem pass.

One follow-up: slot 70 now writes a null SRV, so every view the title makes through it reads as zeros, and a null view whose dimension doesn't match a buffer binding is undefined. The code comment and log say so, but docs/retail_boot_chain.md and docs/d3d12_vulkan.md don't. Please add a line there, or post a finding: in #14, so this stub stays tracked until the raw buffer view lands.

**@⁠ubiquitarianism** on GitHub · 2026-11-24 04:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/356#issuecomment-7122094679) Merged after a Windows build (MSVC, RTX-less AMD RX 6800 box). ctest shows only the 4 failures main already has, and `xs_proxy_mock`, `device_proxy`, `root_sig` and `xmem` pass. One follow-up: slot 70 now writes a null SRV, so every view the title makes through it reads as zeros, and a null view whose dimension doesn't match a buffer binding is undefined. The code comment and log say so, but `docs/retail_boot_chain.md` and `docs/d3d12_vulkan.md` don't. Please add a line there, or post a `finding:` in #14, so this stub stays tracked until the raw buffer view lands.
This discussion has been locked. Commenting is limited to contributors.
No description provided.