[PR #1558] [MERGED] d3d12_xs: make a D16S8 depth texture without UAV when the depth provider refuses it (RT-D16S8-UAV-NVIDIA-FALLBACK) #1584

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

📋 Pull Request Information

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

Base: main ← Head: claude/d16s8-uav-nvidia-fallback


📝 Commits (1)

  • 3cf0a41 d3d12_xs: make a D16S8 depth texture without UAV when the depth provider refuses it

📊 Changes

5 files changed (+230 additions, -13 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+11 -0)
📝 runtime/CMakeLists.txt (+5 -0)
📝 runtime/shims/d3d12_xs_device.cpp (+44 -12)
📝 runtime/test/xbox_depth_storage_test.cpp (+49 -0)
📝 runtime/test/xs_proxy_mock_test.cpp (+121 -1)

📄 Description

Claimed as: RT-D16S8-UAV-NVIDIA-FALLBACK. The claim is posted on #939 (comment 7152724709) because #14 has reached GitHub's comment limit. The root cause is in #939, comment 7152637264.

Fixes the NVIDIA stop at the first landing screen reported on #939 by OreoFR.

What and why

Since #939, slots 76 and 133 hand a depth-stencil texture with unordered access to the depth provider. On a GPU with D24S8 attachments (every NVIDIA card), the Vulkan layer's pc_format() makes the console's D16_UNORM_S8_UINT (format 118) as D24_UNORM_S8_UINT. Resource::enable_depth_stencil_uav accepts only R16_TYPELESS, 118 and R32G8X24_TYPELESS, so it returns E_INVALIDARG. Slot 133 passed that on, and the boot stopped on an int3 at the first landing screen. AMD keeps 118 native, which is why the merge passed there.

Now, only when the provider call itself refuses (E_INVALIDARG or E_NOTIMPL):

  • slot 76 makes the committed texture without unordered access;
  • slot 133 goes on to its pre-#939 stand-in (the title-placed texture, otherwise the committed one), as both did before the provider existed.

The first refusal per slot is logged. Every other failure is passed on unchanged: the provider out of memory, the backing's own CreateCommittedResource, a refused placement or description. A refused backing is released, and no placement range is registered for it.

Follow-up (not here): teach Resource::enable_depth_stencil_uav the D24S8-made form of 118, so these textures keep their UAVs on NVIDIA.

Tested

Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja, RelWithDebInfo:

  • Real boot (0bc810504 + the local form of this change, which fell back on any depth-path failure; the failure that occurred was the provider's refusal): the fallback fires once (slot 133, format 118, hr=0x80070057), no int3, 6,187 PresentX with 0 failed, 69/69 captures non-black, and the boot reaches the later first-run pages. Without it, 3 of 3 runs stopped on the int3 after 182-362 PresentX.
  • xs_proxy_mock, new check_depth_provider_refusal: a mock provider refusing a format-118 texture (E_INVALIDARG, E_NOTIMPL) through slots 76 and 133 gets S_OK and the stand-in, with the refused backing released. Out of memory, a failing backing and a refused placement are still passed on.
  • New Vulkan ctest xbox_d16s8_refused_uav: LEONIDA_CONSOLE_D16S8=d24 forces the NVIDIA format choice on any GPU, and slots 76 and 133 return a depth-stencil texture without unordered access.
  • Related ctests (xs_proxy_mock*, device_proxy*, xbox_depth_storage, xbox_d16s8_*, d3d12_depth_stencil_uav, d3d12_xmem_placed): 17/17 both plain and with LEONIDA_VK_VALIDATION=1.
  • Negative control: with main's shim, xs_proxy_mock and xbox_d16s8_refused_uav fail at slot 76. With only the slot 133 part removed, they fail at slot 133.
  • Repository-consistency set: green apart from test_runtime_paths (tools/conformance/**), which is red on main since #939 and isn't touched here.

GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.24, Windows 11

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic; the follow-up goes in a new pull request.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table of docs/design.md. (n/a)

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf


🔄 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/1558 **Author:** [@QemmHD](https://github.com/QemmHD) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `claude/d16s8-uav-nvidia-fallback` --- ### 📝 Commits (1) - [`3cf0a41`](https://github.com/ubiquitarianism/leonida/commit/3cf0a41bc542f4f2172f9a0703da0b14d67063bc) d3d12_xs: make a D16S8 depth texture without UAV when the depth provider refuses it ### 📊 Changes **5 files changed** (+230 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+11 -0) 📝 `runtime/CMakeLists.txt` (+5 -0) 📝 `runtime/shims/d3d12_xs_device.cpp` (+44 -12) 📝 `runtime/test/xbox_depth_storage_test.cpp` (+49 -0) 📝 `runtime/test/xs_proxy_mock_test.cpp` (+121 -1) </details> ### 📄 Description Claimed as: RT-D16S8-UAV-NVIDIA-FALLBACK. The claim is posted on #939 (comment 7152724709) because #14 has reached GitHub's comment limit. The root cause is in #939, comment 7152637264. Fixes the NVIDIA stop at the first landing screen reported on #939 by OreoFR. ### What and why Since #939, slots 76 and 133 hand a depth-stencil texture with unordered access to the depth provider. On a GPU with D24S8 attachments (every NVIDIA card), the Vulkan layer's `pc_format()` makes the console's D16_UNORM_S8_UINT (format 118) as D24_UNORM_S8_UINT. `Resource::enable_depth_stencil_uav` accepts only R16_TYPELESS, 118 and R32G8X24_TYPELESS, so it returns `E_INVALIDARG`. Slot 133 passed that on, and the boot stopped on an int3 at the first landing screen. AMD keeps 118 native, which is why the merge passed there. Now, **only when the provider call itself refuses** (`E_INVALIDARG` or `E_NOTIMPL`): - slot 76 makes the committed texture without unordered access; - slot 133 goes on to its pre-#939 stand-in (the title-placed texture, otherwise the committed one), as both did before the provider existed. The first refusal per slot is logged. Every other failure is passed on unchanged: the provider out of memory, the backing's own `CreateCommittedResource`, a refused placement or description. A refused backing is released, and no placement range is registered for it. **Follow-up (not here):** teach `Resource::enable_depth_stencil_uav` the D24S8-made form of 118, so these textures keep their UAVs on NVIDIA. ### Tested Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja, RelWithDebInfo: - **Real boot** (0bc810504 + the local form of this change, which fell back on any depth-path failure; the failure that occurred was the provider's refusal): the fallback fires once (slot 133, format 118, hr=0x80070057), no int3, 6,187 PresentX with 0 failed, 69/69 captures non-black, and the boot reaches the later first-run pages. Without it, 3 of 3 runs stopped on the int3 after 182-362 PresentX. - **`xs_proxy_mock`, new `check_depth_provider_refusal`:** a mock provider refusing a format-118 texture (`E_INVALIDARG`, `E_NOTIMPL`) through slots 76 and 133 gets S_OK and the stand-in, with the refused backing released. Out of memory, a failing backing and a refused placement are still passed on. - **New Vulkan ctest `xbox_d16s8_refused_uav`:** `LEONIDA_CONSOLE_D16S8=d24` forces the NVIDIA format choice on any GPU, and slots 76 and 133 return a depth-stencil texture without unordered access. - **Related ctests** (xs_proxy_mock*, device_proxy*, xbox_depth_storage, xbox_d16s8_*, d3d12_depth_stencil_uav, d3d12_xmem_placed): 17/17 both plain and with `LEONIDA_VK_VALIDATION=1`. - **Negative control:** with main's shim, `xs_proxy_mock` and `xbox_d16s8_refused_uav` fail at slot 76. With only the slot 133 part removed, they fail at slot 133. - **Repository-consistency set:** green apart from `test_runtime_paths` (`tools/conformance/**`), which is red on main since #939 and isn't touched here. GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.24, Windows 11 AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; the follow-up goes in a new pull request. - [x] No game data, keys or decryption. - [x] A new translator rule is in the contract table of `docs/design.md`. (n/a) AI-assisted (Claude Code, Claude Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf --- <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:45 +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#1584
No description provided.