[PR #1544] [MERGED] RT-PLACED-DEPTH-OVERLAP: d3d12_xs: a depth placement inside another one's PC extent gets its own image (the boot's texture-creation int3 on RADV) #1570

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

📋 Pull Request Information

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

Base: main ← Head: placed-depth-overlap


📝 Commits (1)

  • d16eb1f d3d12: give a depth placement inside another one's PC extent its own image

📊 Changes

4 files changed (+58 additions, -10 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+6 -1)
📝 runtime/shims/d3d12_xs_device.cpp (+21 -7)
📝 runtime/shims/d3d12_xs_placed_depth.h (+9 -1)
📝 runtime/test/d3d12_placed_depth_test.h (+22 -1)

📄 Description

Item: RT-PLACED-DEPTH-OVERLAP. The claim could not be posted: coordination issue #14 reached GitHub's 2,500-comment limit at 03:46 UTC and no successor exists yet. The claim text is below, to be copied there once there is one:

claiming: RT-PLACED-DEPTH-OVERLAP - a slot-133 depth placement that starts inside an earlier placement's range gets its own image when both layouts are opaque, instead of E_NOTIMPL, and refused depth placements are logged

Searched first: no claim or open pull request covers this case. #689 (QemmHD) is the same-address case, not this one.

What and why

On an RDNA2 iGPU under RADV, the retail boot stops about 30 s in on the title's own int3, inside the title's crash reporter, right after a texture creation returns null. This was measured on main plus the RADV import fix (#1539), without which the device is lost earlier.

  • The cause (measured with a diagnostic build): the title places three D16 depth+UAV targets, all with the opaque layout, in one 8 MiB block of its own through device slot 133, and the next pass in a block exactly 8 MiB higher. d3d12_xs_placed_depth.h records each range's end with the PC allocation's size. RADV sizes the largest of the three (2048×2048) at 8,716,288 bytes, more than the title's block, so the next block's first placement starts inside the previous range at a different address. The registry answered E_NOTIMPL there, and proxy_create_placed_depth wrote no line for it. The trace showed zero failed calls.
  • The fix: a placement that starts inside another range gets a backing of its own when both layouts are opaque. D3D12 allows placed resources to overlap, and an alias's contents are undefined until it is reinitialized. A non-opaque layout there is still refused, and the same-address rules are unchanged.
  • The log: proxy_create_placed_depth now logs the first eight refused depth placements (hr, format, size, layouts, PC size).
  • Docs: the depth-UAV paragraph of docs/d3d12_vulkan.md.
  • Driver scope: drivers that size this target at 8 MiB or less never took the refused path. That is likely why other boots did not stop here.

Tests

  • d3d12_depth_stencil_uav_test (test/d3d12_placed_depth_test.h) places a texture one alignment step inside another. The tiled layout still gets E_NOTIMPL. The opaque layout gets a backing of its own at the right address, and the outer placement keeps its shared backing.
  • Windows suite under Wine 11.22 (clang-cl build), llvmpipe and an RDNA2 iGPU (RADV), against main's baseline: no test goes from pass to fail; d3d12_depth_stencil_uav passes on both.
  • Red check: with only the d3d12_xs_placed_depth.h change reverted (the test and the log kept), d3d12_depth_stencil_uav fails on both devices.

Measured on the retail boot (RDNA2 iGPU, RADV, Wine 11.22, with #1539; counts only)

without with this change
Run time / end 22-31 s, the title's crash reporter (texture creation returned null) 49-51 s, a different stop (being looked at)
D3D12 calls 98,950 111,904 to 112,980
Presents 112 143 to 168
Title state in its crash dump initialising, frame 0 running, frame 82
Refused depth placements 1 per run 0

AI-assisted (Claude Code, Claude Opus 5.5).


🔄 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/1544 **Author:** [@aslan2142](https://github.com/aslan2142) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `placed-depth-overlap` --- ### 📝 Commits (1) - [`d16eb1f`](https://github.com/ubiquitarianism/leonida/commit/d16eb1ff0a55cbc3bd09730a66aa9abe2266f7ea) d3d12: give a depth placement inside another one's PC extent its own image ### 📊 Changes **4 files changed** (+58 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+6 -1) 📝 `runtime/shims/d3d12_xs_device.cpp` (+21 -7) 📝 `runtime/shims/d3d12_xs_placed_depth.h` (+9 -1) 📝 `runtime/test/d3d12_placed_depth_test.h` (+22 -1) </details> ### 📄 Description Item: `RT-PLACED-DEPTH-OVERLAP`. **The claim could not be posted:** coordination issue #14 reached GitHub's 2,500-comment limit at 03:46 UTC and no successor exists yet. The claim text is below, to be copied there once there is one: > claiming: RT-PLACED-DEPTH-OVERLAP - a slot-133 depth placement that starts inside an earlier placement's range gets its own image when both layouts are opaque, instead of `E_NOTIMPL`, and refused depth placements are logged Searched first: no claim or open pull request covers this case. #689 (QemmHD) is the same-address case, not this one. ### What and why On an RDNA2 iGPU under RADV, the retail boot stops about 30 s in on the title's own `int3`, inside the title's crash reporter, right after a texture creation returns null. This was measured on `main` plus the RADV import fix (#1539), without which the device is lost earlier. - **The cause (measured with a diagnostic build):** the title places three D16 depth+UAV targets, all with the opaque layout, in one 8 MiB block of its own through device slot 133, and the next pass in a block exactly 8 MiB higher. `d3d12_xs_placed_depth.h` records each range's end with the PC allocation's size. RADV sizes the largest of the three (2048×2048) at 8,716,288 bytes, more than the title's block, so the next block's first placement starts inside the previous range at a different address. The registry answered `E_NOTIMPL` there, and `proxy_create_placed_depth` wrote no line for it. The trace showed zero failed calls. - **The fix:** a placement that starts inside another range gets a backing of its own when both layouts are opaque. D3D12 allows placed resources to overlap, and an alias's contents are undefined until it is reinitialized. A non-opaque layout there is still refused, and the same-address rules are unchanged. - **The log:** `proxy_create_placed_depth` now logs the first eight refused depth placements (hr, format, size, layouts, PC size). - **Docs:** the depth-UAV paragraph of `docs/d3d12_vulkan.md`. - **Driver scope:** drivers that size this target at 8 MiB or less never took the refused path. That is likely why other boots did not stop here. ### Tests - `d3d12_depth_stencil_uav_test` (`test/d3d12_placed_depth_test.h`) places a texture one alignment step inside another. The tiled layout still gets `E_NOTIMPL`. The opaque layout gets a backing of its own at the right address, and the outer placement keeps its shared backing. - Windows suite under Wine 11.22 (clang-cl build), llvmpipe and an RDNA2 iGPU (RADV), against `main`'s baseline: no test goes from pass to fail; `d3d12_depth_stencil_uav` passes on both. - Red check: with only the `d3d12_xs_placed_depth.h` change reverted (the test and the log kept), `d3d12_depth_stencil_uav` fails on both devices. ### Measured on the retail boot (RDNA2 iGPU, RADV, Wine 11.22, with #1539; counts only) | | without | with this change | |---|---|---| | Run time / end | 22-31 s, the title's crash reporter (texture creation returned null) | 49-51 s, a different stop (being looked at) | | D3D12 calls | 98,950 | 111,904 to 112,980 | | Presents | 112 | 143 to 168 | | Title state in its crash dump | initialising, frame 0 | running, frame 82 | | Refused depth placements | 1 per run | 0 | AI-assisted (Claude Code, Claude Opus 5.5). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:21:43 +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#1570
No description provided.