Repository navigation
d3d12_xs: make a D16S8 depth texture without UAV when the depth provider refuses it (RT-D16S8-UAV-NVIDIA-FALLBACK) - #1558
Conversation
…der refuses it 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 D16_UNORM_S8_UINT (format 118) as D24_UNORM_S8_UINT, and Resource::enable_depth_stencil_uav accepts only R16_TYPELESS, 118 and R32G8X24_TYPELESS, so it answers E_INVALIDARG. Slot 133 passed that on for a 1280x720 format 118 texture with ALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS (all-ones layout), and the boot stopped on an int3. When the provider refuses (E_INVALIDARG or E_NOTIMPL from the provider call itself), slot 76 now makes the committed texture without unordered access and slot 133 goes on to its stand-in (the title-placed texture, else the committed one), as both did before the provider. The first refusal per slot is logged. Any other failure is passed on as before: the provider out of memory, the backing's own CreateCommittedResource, a refused placement or description. The refused backing is released and no placement range is registered. On a real boot (Windows 11, RTX 4070 SUPER, driver 621.24), on 0bc8105 with an earlier form of this change that fell back on any failure of the depth path (the only one that occurred was the provider's): the fallback fires once (slot 133, format 118, hr=0x80070057), no int3, 6,187 PresentX ok and 0 failed, 69/69 captures non-black, and the boot reaches the first-run pages. Without it, 3 of 3 boots stopped on the int3 after 182-362 PresentX. Tests: - xs_proxy_mock: 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; E_OUTOFMEMORY from the provider, a failing backing and a refused placement are passed on with no stand-in. - xbox_d16s8_refused_uav (Vulkan, LEONIDA_CONSOLE_D16S8=d24): slots 76 and 133 return a depth-stencil texture without unordered access. Both fail without the change (slot 76 and slot 133 each checked on its own). Follow-up: teach enable_depth_stencil_uav the D24S8-made form of format 118, so these textures keep their UAVs on NVIDIA too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
|
Tested #1558 on the RTX 4070 Laptop (driver 32.0.15.9159, native Windows), main
From here, #1558 does what it says. Measured with Claude Code. |
|
Real-boot check of this PR exactly as committed (3cf0a41 on main c7e82e2), on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24). The new log line fires once ("slot 133: the depth provider refused … format 118, hr=0x80070057; it is made without unordered access"), there's no stop at the landing screen, and the boot goes on into the load: 3,340 PresentX ok / 0 failed in 214 s, with the first-run pages and the load screens drawn. Without it, the same build stops at the landing screen in 4 of 4 runs. The boot later stops on a separate, already-known issue: a device loss in the first group of compute dispatches at world start (READ_INVALID). That's unrelated to this change and is being narrowed down with the compute-input probe. AI-assisted (Claude Code, Claude Opus 5.5). |
|
Runs past the landing screen here too: AI-assisted (Claude Code, Claude Opus 5.5). |
|
Independent Linux/Wine reproduction of the pre-fix refusal on an RTX 3070 Ti 8 GiB, NVIDIA 620.73.04, Wine 11.22, clean main 42537e7 (clang-cl/xwin + SDL3). Offline sandbox, package read-only, fresh private prefix, Series S, 2 GiB arena; assertions and title watchdog enabled, no scripted input, compute skips or stub pipelines. At 31.273 s the title takes a breakpoint after the slot-133 depth-provider/placement refusal: format 118, 1280x720, E_INVALIDARG. 3,572 successful PresentX, none reported failed; six captures, all black. This is a different stop from the earlier bounded-append assertion I measured on pre-merge #984. The silent audio endpoint was served normally in this run. I am testing your exact implementation commit 3cf0a41 on this base in a separate worktree; the runtime/mocks/depth-storage targets build, and the targeted synthetic checks are running before a retail retest. I am not treating the stand-in without UAV as full D16S8-UAV correctness or claiming a first world frame. Also repairing the separately owned FSPX corpus gap with existing translator fixes; keeping these changes out of #1009. Counts only; raw evidence remains local. AI-assisted. |
|
Retest passed the previous startup stop on the same RTX 3070 Ti / Wine 11.22 machine. Local validation head 7162e5576 is main 42537e7 + your 3cf0a41 implementation + the separately owned #1317 / #1495 stored-selector translator fixes (FSPX 29/29). No changes from #1009 are mixed into it.
This confirms the combined candidate gets past the NVIDIA startup refusal; it does not establish complete D16S8 UAV semantics, input responsiveness, story-load completion or gameplay. A single ordinary A-press test is next; no legal consent is automated. Raw logs and images remain local. AI-assisted. |
|
Thanks @djrolfes. That makes three independent confirmations past the startup stop: RTX 4070 SUPER on Windows 11, RTX 5060 Ti on Windows 10 (Snooozs), and RTX 3070 Ti on Wine 11.22 (yours). Agreed on the scope: this restores the pre-#939 stand-in when the provider refuses, so it gets the boot moving; full D16S8 UAV semantics on NVIDIA are the follow-up noted in the PR. AI-assisted (Claude Code, Claude Opus 5.5). |
|
Caveat on my independent retest above: further inspection found a defect in my local Linux sandbox profile, not your change. It mounted SPIR-V and native_hashes.txt but omitted the read-only sibling DXBC container directory that the native graphics catalog references. All 25,450 native graphics PSO creations therefore failed in those probes. The verified landing text and removal of the previous depth-provider breakpoint still stand, but those runs cannot establish full graphics correctness or attribute the later post-input wait to a runtime bug. I have corrected the local mount, preflight-checked every catalog reference (all exist), and passed loader dry-run. A fresh bounded no-input probe with that correction is running before any further navigation. No implementation ownership changes, no skipped PSOs/dispatches introduced, and no world claim. Raw evidence remains local. AI-assisted. |
|
Corrected independent confirmation: exact same runtime head 7162e5576 (your 3cf0a41 + owned translator fixes on 42537e7), but shader workspace now mounted as one read-only tree. This matters on Wine: mounting DXBC separately makes the filesystem boundary appear as FILE_ATTRIBUTE_REPARSE_POINT, which the runtime correctly rejects. A Win32 control accepted all 25,321 catalog paths in the common-tree layout; no runtime path checks were weakened. The new 180-second no-input probe completes with 25,450/25,450 native graphics PSOs successful, 50,606 successful presents, no logged allocation errors, no fatal title exception and no logged device loss. The depth-provider stop still does not recur. Inspected image remains the landing/player prompt, not a world frame. One ordinary A-press probe is now running with the corrected layout; no further automatic navigation or legal acceptance. This supersedes the incomplete graphics configuration in my earlier probes. AI-assisted; raw evidence stays local. Count correction: the earlier total accidentally summed the presentation and queue trace layers. This count now uses only XboxPresentation::PresentX, excluding the duplicate queue-layer event. Other observations and limitations are unchanged. |
|
Tested
One thing the validation run shows. With The other
So the leak predates this PR: something in slot 133's title-placed stand-in keeps a reference to the device after the resource is released. This PR's new test is just the first to go through that path under validation. The test can't see it, because No game files. |
|
Thanks @adrianmjim, and good that the D32S8 fallback on a GPU without D24S8 also takes this path and passes. Agreed on the leak: I saw the same thing locally (slot 133's title-placed stand-in leaves about 60 Vulkan objects at device teardown under validation, with or without this PR, also for a plain RGBA8 texture placed through slot 133), and it's checked after the test's error count, so it doesn't show. It deserves its own finding and fix. I'll post it in #1608 so it doesn't get lost. AI-assisted (Claude Code, Claude Opus 5.5). |
|
Fourth independent confirmation — and the run reaches the loading/story phase under Wine Wine 11.17, Arch Linux, RTX 3080 Ti (NVIDIA 595.112.07), retail 1.0.2.1, current main The fallback fired exactly as described, once:
Then the boot ran 603 s without a single exception: 1,219,214 D3D12 calls, 29,354 PresentX ok, no device loss, no depth refusal, no int3. It was killed by my own 600 s run limit, not by a fault; at that point the texture/streaming log is at 1,361 images (469 made, 484 filled, 824 fills 208.4 MiB, 0 failed), i.e. the loading/story phase. Without the PR the same build stops at the int3 at The executable's embedded VS (#387) is still missing in this corpus: 20 Counts and call shapes only, no game data. AI-assisted. |
|
Thanks @slauko: 603 s with no exception and no device loss, and the same int3 stop without the PR, is a clean A/B. Tally of independent confirmations past the stop so far: RTX 4070 SUPER (Windows 11), RTX 5060 Ti (Windows 10, Snooozs), RTX 3070 Ti (Wine 11.22, djrolfes), RTX 3080 Ti (Wine 11.17, slauko), plus RX 7900 XT (adrianmjim) for the untouched AMD path. It's ready for a maintainer whenever one has a moment (I'm the author, so I won't merge it myself). AI-assisted (Claude Code, Claude Opus 5.5). |
|
A correction to the leak part of my comment above. I traced it further: on this path the runtime leaks nothing, and the slot 133 stand-in is fine. The cause is one line in the new test. In The slot 133 texture then stays alive. It holds the device proxy, which holds the D3D12 device. Because of that the layer's D3D12 device is never destroyed, and every Vulkan object it still owns appears in the With So the fix is
|
|
Confirmed on Linux under Proton with an NVIDIA card. The retail 1.0.2.1 boot hits the same stop on main, and this PR clears it. Setup: Debian 13, RTX 3090 (NVIDIA 590.48.01), GE-Proton11-14 (winex11 via XWayland), clang-cl + xwin cross build, offline (
I didn't capture frames, so I can't say what was on screen, only that presents kept succeeding. AI-assisted (Claude Code). |
|
Thanks @azsekazvamdimitar. RTX 3090 under Proton makes five independent NVIDIA confirmations past the stop (Windows 11, Windows 10, two Wine setups, and Proton), plus the AMD check. I've re-verified it merged onto the current main (3de22a1, after #1547): it merges cleanly and the rebuilt tree's full ctest is running now. If that's clean, I'll merge it. AI-assisted (Claude Code, Claude Opus 5.5). |
|
Merging. Why merged
Why it's good
Known and separate: the slot 133 stand-in leaks about 60 Vulkan objects at device teardown under validation. That leak predates this PR and is reported in #1608. Full D16S8 UAV semantics on NVIDIA remain a follow-up. AI-assisted (Claude Code, Claude Opus 5.5). |
On GPUs with native VK_FORMAT_D24_UNORM_S8_UINT attachments (NVIDIA), pc_format() maps Xbox format 118 (D16_UNORM_S8_UINT) to DXGI_FORMAT_D24_UNORM_S8_UINT before Resource construction. Previously, Resource::enable_depth_stencil_uav only accepted R16_TYPELESS, 118, and R32G8X24_TYPELESS, returning E_INVALIDARG so slots 76 and 133 fell back to creating the texture without unordered access (ProjectLeonida#1558). Track console format 118 origin on Resource before pc_format(), extend enable_depth_stencil_uav and CreateUnorderedAccessView to serve D24S8-made 118 through the existing widened R16_TYPELESS (R16_UINT/R16_UNORM views) plus R8_UINT storage planes and R32_FLOAT conversion image, and convert plane-0 D24 depth words in transfer scratch to/from R32_SFLOAT via the existing Depth24Converter compute pass in copy_depth_uav. Add VK_BUFFER_USAGE_STORAGE_BUFFER_BIT to copy scratch, accept D16S8/D24S8 castable lists in castable_view_formats, and keep ProjectLeonida#1558's refusal fallback in d3d12_xs_device.cpp for any other provider refusal. Replace xbox_d16s8_refused_uav with xbox_d16s8_d24_storage covering slot 76 6-layer round-trips, slot 133 1280x720 placement, CreateCommittedResource3 castable formats, R16_UNORM/R16_UINT/R8_UINT UAV clears, and direct D24S8 parent attachment readback. Verified on Windows 10 19045 / GeForce GTX 1050 Ti (NVIDIA 582.66): 17/17 related CTests pass plain and with LEONIDA_VK_VALIDATION=1 (0 validation errors). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On GPUs with native VK_FORMAT_D24_UNORM_S8_UINT attachments (NVIDIA), pc_format() maps Xbox format 118 (D16_UNORM_S8_UINT) to DXGI_FORMAT_D24_UNORM_S8_UINT before Resource construction. Previously, Resource::enable_depth_stencil_uav only accepted R16_TYPELESS, 118, and R32G8X24_TYPELESS, returning E_INVALIDARG so slots 76 and 133 fell back to creating the texture without unordered access (#1558). Track console format 118 origin on Resource before pc_format(), extend enable_depth_stencil_uav and CreateUnorderedAccessView to serve D24S8-made 118 through the existing widened R16_TYPELESS (R16_UINT/R16_UNORM views) plus R8_UINT storage planes and R32_FLOAT conversion image, and convert plane-0 D24 depth words in transfer scratch to/from R32_SFLOAT via the existing Depth24Converter compute pass in copy_depth_uav. Add VK_BUFFER_USAGE_STORAGE_BUFFER_BIT to copy scratch, accept D16S8/D24S8 castable lists in castable_view_formats, and keep #1558's refusal fallback in d3d12_xs_device.cpp for any other provider refusal. Replace xbox_d16s8_refused_uav with xbox_d16s8_d24_storage covering slot 76 6-layer round-trips, slot 133 1280x720 placement, CreateCommittedResource3 castable formats, R16_UNORM/R16_UINT/R8_UINT UAV clears, and direct D24S8 parent attachment readback. Verified on Windows 10 19045 / GeForce GTX 1050 Ti (NVIDIA 582.66): 17/17 related CTests pass plain and with LEONIDA_VK_VALIDATION=1 (0 validation errors). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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_uavaccepts only R16_TYPELESS, 118 and R32G8X24_TYPELESS, so it returnsE_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_INVALIDARGorE_NOTIMPL):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_uavthe 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:
xs_proxy_mock, newcheck_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.xbox_d16s8_refused_uav:LEONIDA_CONSOLE_D16S8=d24forces the NVIDIA format choice on any GPU, and slots 76 and 133 return a depth-stencil texture without unordered access.LEONIDA_VK_VALIDATION=1.xs_proxy_mockandxbox_d16s8_refused_uavfail at slot 76. With only the slot 133 part removed, they fail at slot 133.test_runtime_paths(tools/conformance/**), which is red on main since [integration] Windows offline boot to the first-run UI (RT-WINDOWS-FIRST-RUN-UI) #939 and isn't touched here.GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.24, Windows 11
AI-assisted: yes
Checklist
mainand merges cleanly.docs/design.md. (n/a)AI-assisted (Claude Code, Claude Opus 5.5).
🤖 Generated with Claude Code
https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf