[PR #772] d3d12_xs: slots 127 and 133 make a depth-stencil texture without unordered access (RT-DS-UAV-SLOTS) #812

Open
opened 2026-11-26 20:19:07 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/772
Author: @DesertGamer
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/ds-uav-slots-127-133


📝 Commits (10+)

  • 522faa2 d3d12_xs: honour XMemAllocationHooks for descriptor heaps and translate CPU handles
  • f59167e d3d12_xs: device slot 25 pads a render target to whole console tiles (RT-5 stop 17)
  • 6b75cba d3d12_xs: device slot 25 gives the PC device clean resource descriptions (RT-5 stop 16)
  • 8eaccde d3d12_xs: console render target sizes follow each resource's alignment, slot 56 offsets, full mip chains, rounded-up mip extents, B5G5R5A1, saturating sums
  • e090be9 d3d12_xs: committed resources lease their size through the title's XMem hooks (RT-5 stop 17)
  • 24914e7 d3d12: preserve PC descriptor validation in slot 25
  • 4056d18 ladder: kXboxTiledResourceLayout is inline const, not constexpr (clang-cl rejects 0x101 for the unfixed enum)
  • c108c53 d3d12_xs: the console render-target sizes of slots 25 and 56 are for console-form calls only
  • 0c5a146 d3d12_xs: the hook-backed descriptor address is not applied to a console-extended heap
  • c8247cd d3d12_xs: a console indirect argument of type 105 is created as DISPATCH (slot 41)

📊 Changes

23 files changed (+2478 additions, -131 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+31 -2)
📝 runtime/CMakeLists.txt (+1 -0)
📝 runtime/shims/d3d12_com.cpp (+10 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+5 -0)
📝 runtime/shims/d3d12_xs.cpp (+17 -0)
➕ runtime/shims/d3d12_xs_alloc_size.h (+156 -0)
➕ runtime/shims/d3d12_xs_desc_clean.h (+55 -0)
📝 runtime/shims/d3d12_xs_device.cpp (+945 -60)
📝 runtime/shims/d3d12_xs_device.h (+54 -11)
📝 runtime/shims/registry.cpp (+39 -0)
📝 runtime/shims/shims.h (+13 -0)
📝 runtime/shims/xbox_present.cpp (+3 -2)
📝 runtime/shims/xbox_present.h (+2 -1)
📝 runtime/src/command_list.h (+3 -0)
📝 runtime/src/frame_pacer.h (+19 -6)
📝 runtime/src/pe_loader.cpp (+7 -0)
📝 runtime/test/allocator_proxy_test.cpp (+24 -7)
📝 runtime/test/d3d12_mesh_test.cpp (+22 -0)
📝 runtime/test/device_proxy_test.cpp (+114 -1)
📝 runtime/test/frame_pacer_test.cpp (+19 -0)

...and 3 more files

📄 Description

Claimed in the coordination issue as: RT-DS-UAV-SLOTS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7133089244)

Depends on: #427. The branch is #427's head plus one commit, so the diff here also lists #427's commits until it merges; the change of this pull request is the last commit only (runtime/shims/d3d12_xs_device.cpp, runtime/test/xs_proxy_mock_test.cpp).

What and why

#427 stops a console depth-stencil texture that also allows unordered access from reaching the PC runtime with the pair (the PC runtime refuses it, and Vulkan has no depth format with storage support): such a texture is made as a depth-stencil texture alone, through pc_resource_flags / without_depth_stencil_uav, at slots 25 and 76. DadaCap measured the same description at two more resource-creating slots on a run that gets past the pipeline wall (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7132343578): 127 and 133 (and 108, below). Both masked the Xbox bits only and kept ALLOW_UNORDERED_ACCESS on a depth-stencil texture.

  • Slot 127 (CreateCommittedResource3) takes its PC flags from pc_resource_flags. The local copy of the flag mask in d3d12_xs_device.cpp is gone; d3d12_xs_desc_clean.h has the same one.
  • Slot 133 (CreatePlacedResourceX) drops the flag on a depth-stencil texture with without_depth_stencil_uav; a buffer, a render target and a plain depth-stencil texture keep what they had.

Slot 108 (GetResourceAllocationInfo2) sizes descriptions the same way, but it is routed by #219 / #727, which this does not depend on; it follows in its own pull request once one of them is in main.

Tested

  • ctest -R "xs_proxy_mock|device_proxy": 9 of 9 pass (MSVC, Windows 11, Vulkan SDK 1.4.363). The new slot 127 checks fail with the old flag line put back (checked), so they cover the change.
  • Slot 127: a depth-stencil + unordered access description reaches the PC call as depth-stencil alone, and the title's description is not written to; a plain depth-stencil, a buffer and a render target + unordered access keep their flags. Slot 133: the same for a texture description handed to the placed-resource handler.
  • scripts/check_no_game_data.py on the two changed files: pass.
  • Not run: a retail boot on this change. The two slots are only reached past the pipeline wall DadaCap describes, which my stack has not reached.

GPUs tested: NVIDIA GeForce RTX 5070, driver 617.14, Windows 11 (unit tests only, no GPU path changed)

AI-assisted: yes (Claude Code, Sonnet 5.5)

Checklist

  • Based on current main and merges cleanly once #427 is in.
  • One topic; slot 108 goes in a new pull request.
  • 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. (Not a 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/772 **Author:** [@DesertGamer](https://github.com/DesertGamer) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/ds-uav-slots-127-133` --- ### 📝 Commits (10+) - [`522faa2`](https://github.com/ubiquitarianism/leonida/commit/522faa2ee4ad77b00d11057543497f9e31c3ff05) d3d12_xs: honour __XMemAllocationHooks__ for descriptor heaps and translate CPU handles - [`f59167e`](https://github.com/ubiquitarianism/leonida/commit/f59167ef9ce47c3861a2c3f4092c6d4ccdb623e5) d3d12_xs: device slot 25 pads a render target to whole console tiles (RT-5 stop 17) - [`6b75cba`](https://github.com/ubiquitarianism/leonida/commit/6b75cbafbc9e909747c7576dc7123f4d78b4123f) d3d12_xs: device slot 25 gives the PC device clean resource descriptions (RT-5 stop 16) - [`8eaccde`](https://github.com/ubiquitarianism/leonida/commit/8eaccded7f8ea0292046f097d934f73015e3c670) d3d12_xs: console render target sizes follow each resource's alignment, slot 56 offsets, full mip chains, rounded-up mip extents, B5G5R5A1, saturating sums - [`e090be9`](https://github.com/ubiquitarianism/leonida/commit/e090be908ded3ebe84a04702e6690bd98d2cefe7) d3d12_xs: committed resources lease their size through the title's XMem hooks (RT-5 stop 17) - [`24914e7`](https://github.com/ubiquitarianism/leonida/commit/24914e72982aff3da606199eb1bb783fbaa18457) d3d12: preserve PC descriptor validation in slot 25 - [`4056d18`](https://github.com/ubiquitarianism/leonida/commit/4056d185e7e30c90df32a095cf0d30d93b20d507) ladder: kXboxTiledResourceLayout is inline const, not constexpr (clang-cl rejects 0x101 for the unfixed enum) - [`c108c53`](https://github.com/ubiquitarianism/leonida/commit/c108c5389467128dffc1414e112c8b699e724894) d3d12_xs: the console render-target sizes of slots 25 and 56 are for console-form calls only - [`0c5a146`](https://github.com/ubiquitarianism/leonida/commit/0c5a14659502a32d84c830880bc2c20aa1562c11) d3d12_xs: the hook-backed descriptor address is not applied to a console-extended heap - [`c8247cd`](https://github.com/ubiquitarianism/leonida/commit/c8247cdfa384189ed28512aa157663f4db152273) d3d12_xs: a console indirect argument of type 105 is created as DISPATCH (slot 41) ### 📊 Changes **23 files changed** (+2478 additions, -131 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+31 -2) 📝 `runtime/CMakeLists.txt` (+1 -0) 📝 `runtime/shims/d3d12_com.cpp` (+10 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+5 -0) 📝 `runtime/shims/d3d12_xs.cpp` (+17 -0) ➕ `runtime/shims/d3d12_xs_alloc_size.h` (+156 -0) ➕ `runtime/shims/d3d12_xs_desc_clean.h` (+55 -0) 📝 `runtime/shims/d3d12_xs_device.cpp` (+945 -60) 📝 `runtime/shims/d3d12_xs_device.h` (+54 -11) 📝 `runtime/shims/registry.cpp` (+39 -0) 📝 `runtime/shims/shims.h` (+13 -0) 📝 `runtime/shims/xbox_present.cpp` (+3 -2) 📝 `runtime/shims/xbox_present.h` (+2 -1) 📝 `runtime/src/command_list.h` (+3 -0) 📝 `runtime/src/frame_pacer.h` (+19 -6) 📝 `runtime/src/pe_loader.cpp` (+7 -0) 📝 `runtime/test/allocator_proxy_test.cpp` (+24 -7) 📝 `runtime/test/d3d12_mesh_test.cpp` (+22 -0) 📝 `runtime/test/device_proxy_test.cpp` (+114 -1) 📝 `runtime/test/frame_pacer_test.cpp` (+19 -0) _...and 3 more files_ </details> ### 📄 Description Claimed in the coordination issue as: RT-DS-UAV-SLOTS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7133089244) Depends on: #427. The branch is #427's head plus one commit, so the diff here also lists #427's commits until it merges; the change of this pull request is the last commit only (`runtime/shims/d3d12_xs_device.cpp`, `runtime/test/xs_proxy_mock_test.cpp`). ### What and why #427 stops a console depth-stencil texture that also allows unordered access from reaching the PC runtime with the pair (the PC runtime refuses it, and Vulkan has no depth format with storage support): such a texture is made as a depth-stencil texture alone, through `pc_resource_flags` / `without_depth_stencil_uav`, at slots 25 and 76. DadaCap measured the same description at two more resource-creating slots on a run that gets past the pipeline wall (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7132343578): 127 and 133 (and 108, below). Both masked the Xbox bits only and kept `ALLOW_UNORDERED_ACCESS` on a depth-stencil texture. - Slot 127 (`CreateCommittedResource3`) takes its PC flags from `pc_resource_flags`. The local copy of the flag mask in `d3d12_xs_device.cpp` is gone; `d3d12_xs_desc_clean.h` has the same one. - Slot 133 (`CreatePlacedResourceX`) drops the flag on a depth-stencil texture with `without_depth_stencil_uav`; a buffer, a render target and a plain depth-stencil texture keep what they had. Slot 108 (`GetResourceAllocationInfo2`) sizes descriptions the same way, but it is routed by #219 / #727, which this does not depend on; it follows in its own pull request once one of them is in `main`. ### Tested - `ctest -R "xs_proxy_mock|device_proxy"`: 9 of 9 pass (MSVC, Windows 11, Vulkan SDK 1.4.363). The new slot 127 checks fail with the old flag line put back (checked), so they cover the change. - Slot 127: a depth-stencil + unordered access description reaches the PC call as depth-stencil alone, and the title's description is not written to; a plain depth-stencil, a buffer and a render target + unordered access keep their flags. Slot 133: the same for a texture description handed to the placed-resource handler. - `scripts/check_no_game_data.py` on the two changed files: pass. - Not run: a retail boot on this change. The two slots are only reached past the pipeline wall DadaCap describes, which my stack has not reached. GPUs tested: NVIDIA GeForce RTX 5070, driver 617.14, Windows 11 (unit tests only, no GPU path changed) AI-assisted: yes (Claude Code, Sonnet 5.5) ### Checklist - [x] Based on current `main` and merges cleanly once #427 is in. - [x] One topic; slot 108 goes in a new pull request. - [x] 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. (Not a translator change.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#812
No description provided.