Skip to content

d3d12_depth_resolve: check refused resolves against a destination cleared in its own list (#6610 follow-up) - #7905

Closed
optinium51-bot wants to merge 2 commits into
ProjectLeonida:mainfrom
optinium51-bot:fix/depth-resolve-refused-batch
Closed

optinium51-bot wants to merge 2 commits into
ProjectLeonida:mainfrom
optinium51-bot:fix/depth-resolve-refused-batch

Conversation

@optinium51-bot

@optinium51-bot optinium51-bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Item: etty8080's finding on #7804 (#7804 (comment)), no ID yet.

What

#6610 makes ExecuteCommandLists refuse a whole batch that holds a list whose Close failed ("list 0 is invalid; refusing batch"). resolve_and_read still recorded the clears, the refused resolve and the readback copies in one list and executed it on the layer, so since #6610 none of it runs and every refused case reads a buffer nothing wrote: eight refused ... destination changed lines and exit 1 on main. The layer does not write the destination; the test never reads what the clears left.

How

A successful case still records the clears, the edge draw and the resolve in one list, on the layer as on the host (split only on failure since 630e9d8, from the review). When Close fails on the layer (run_invalid), the refused list is run between a list of the same clears and a list that reads the destination back, so "a refused resolve leaves the destination as it was" is still checked against the destination the clears left, for the refused cases and for the modes a device lacks. The host path is unchanged.

Tested

Windows 11 build 26200, MSVC 14.52 (VS 2026), NVIDIA GeForce RTX 3060 (driver 616.92), RelWithDebInfo + Ninja.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

…ared in its own list (ItsNotRexed#6610 follow-up)

ItsNotRexed#6610 makes ExecuteCommandLists refuse a whole batch that holds a list whose
Close failed. resolve_and_read still recorded the clears, the refused resolve
and the readback copies in one list and executed it on the layer, so since
ItsNotRexed#6610 none of it runs and every refused case reads a buffer nothing wrote:
eight "refused ... destination changed" lines and exit 1 on main.

On the layer, the clears (and the edge draw) now run in a list of their own
first. A list whose Close fails is still executed, and its destination is then
read back in a third list, so a refused resolve is still checked against the
destination the clears left. The host path is unchanged.

Tested on Windows 11 build 26200, MSVC 14.52 (VS 2026), RTX 3060 (NVIDIA
616.92). d3d12_depth_resolve: main 9b60c92 fails 8 of 8 runs; with this, 5 of
5 pass, with the same counts (RTX 3060: 27 of 51 match, 24 host quirks,
7 refusals alike; WARP: 37 of 37) and 12 refusals keeping the destination.
Full ctest: 236 of 237 pass; the remaining failure is d3d12_vulkan_device,
which ItsNotRexed#7125 fixes, and with ItsNotRexed#7125 merged both pass. Not run: the edge cases
(no glslangValidator at build time). No game data.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trick-ye

Copy link
Copy Markdown

Tested a986b7018 (based on main dde82f27e) on AMD Radeon RX 7800 XT (RDNA3), AMD 26.11.2 (Windows driver 32.0.32029.2010), Windows 11 26200: d3d12_depth_resolve fails on main here and passes on this head, 5 of 5 runs.

  • main dde82f27e: d3d12_depth_resolve fails in the suite (ctest -j 1), and d3d12_depth_resolve_test exits 1 in 3 of 3 direct runs. Each direct run prints 12 ExecuteCommandLists: list 0 is invalid; refusing batch lines and the same 8 refused ...: Close 0x80070057, destination changed lines (for example refused D24S8 depth AVERAGE rect 1 and refused D32S8 depth AVERAGE rect 0), and no summary line.
  • This head: 5 of 5 direct runs exit 0, with no destination changed line and the summary 134 host comparisons matched, 12 refusals kept the destination, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ.
  • The host comparison lines are the same on main and on this head: against AMD Radeon RX 7800 XT: 63 of 97 match, 18 host quirks, 7 refusals alike and against WARP: 71 of 71 match, 0 host quirks, 7 refusals alike.
  • Only d3d12_depth_resolve_test was rebuilt and run on this head (the PR changes only that file); it compiled with no compiler warnings. The rest of the suite was not run on it.
  • MSVC 14.42 (VS 2022), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, RelWithDebInfo, LEONIDA_VK_DEVICE=7800. Synthetic test only, no game files.

AI-assisted (Claude Code).

@lohant27-netizen

Copy link
Copy Markdown

Tested a986b7018 (test file applied on main 77fa308f9) on Windows 11 (10.0.26300), NVIDIA GeForce RTX 5070 (driver 32.0.16.2101), MSVC with SDK 10.0.26100, Release: pass.

  • Without this change, d3d12_depth_resolve fails on main since d3d12: reject null arrays and invalid lists in ExecuteCommandLists #6610 (4da716493, found by building just before and after it): 8 refused cases report destination changed, because ExecuteCommandLists now refuses a list whose Close failed, so the old readback in that list never runs.
  • With it: exit 0. 97 of 97 match against the RTX 5070, 71 of 71 against WARP, 12 refusals kept the destination.

Note: #7930 fixes the same test the same way and also passes here, so one of the two can probably be closed.

@nicoco23

Copy link
Copy Markdown

Independent run, Windows 11, NVIDIA GeForce RTX 5070:

@RAINighty

Copy link
Copy Markdown

Tested a986b7018 merged with main dde82f27e (clean merge) on Windows 11 (10.0.26300), hybrid laptop: NVIDIA GeForce RTX 5060 Laptop GPU (driver 32.0.16.2124) plus Intel UHD Graphics, MSVC 19.44.35228, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, Ninja, RelWithDebInfo: pass, and it fixes a failure on main.

AI-assisted (Claude Code).

@MartinIndra02

Copy link
Copy Markdown
Contributor

Independent build + test: PASS (one coverage note)

AI-assisted (Claude Code). Windows 11 x64, MSVC 19.44.35220, Ninja RelWithDebInfo, NVIDIA GeForce RTX 3080 driver 621.24 / 32.0.16.2124 (Vulkan layer and host D3D12), plus WARP.

Head a986b7018, based on current main (dde82f27e). Built d3d12_depth_resolve_test.

Build d3d12_depth_resolve_test.exe
main dde82f27e exit 1, 8 lines like refused D24S8 depth AVERAGE rect 1: Close 0x80070057, destination changed
this PR exit 0 on 3 of 3 runs: 145 host comparisons matched, 12 refusals kept the destination, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ. RTX 3080 74/97 (15 host quirks), WARP 71/71, 7 refusals alike on each

Coverage note: with run_invalid (every Vulkan-layer case, not just the refused ones), the clears and the edge draw are now closed and submitted in their own list before the resolve list is recorded (if (run_invalid) { list->Close(); submit(); restart(); }). So on the layer, the successful cases no longer check clear → draw → resolve inside one command list, which is the order the host path (and the old test) uses. If that same-list ordering matters (render-pass / barrier tracking in the replay), it might be worth splitting only when the resolve is expected to be refused. #7909 takes that approach: the split happens only after Close fails.

FYI: #7909 and #7930 make the same test fix in different ways. Each one on its own makes this test pass here.

@Maraco91

Copy link
Copy Markdown
Contributor

Tested a986b701 (its base is main dde82f27) on NVIDIA GeForce RTX 3080 Ti, driver 616.56, Windows 11 26200, MSVC 19.42 + Ninja via scripts\build_runtime.ps1, RelWithDebInfo, Vulkan SDK 1.4.363.0: pass, and it fixes a failure this card has on main. An NVIDIA point next to the RX 7800 XT one above.

ctest -R "^d3d12_depth_resolve$":

tree result
main 6664b0db (before #6610) passed, without and with LEONIDA_VK_VALIDATION=1
main dde82f27 failed: 8 lines refused <case>: Close 0x80070057, destination changed (D24S8 and D32S8, depth and stencil, AVERAGE/MIN/MAX), then 57 of 97 match, 24 host quirks, 7 refusals alike against the GPU and 71 of 71 match against WARP
this PR passed, 1 of 1 without validation and 3 of 3 with LEONIDA_VK_VALIDATION=1

Only runtime/test/d3d12_depth_resolve_test.cpp changes, and the rebuild from the dde82f27 build touched that one test (18 s). I did not run the rest of the suite on this tree alone; a full run of this PR together with five other open fixes is in progress and I will add its result if it shows anything about this test.

AI-assisted (Claude Code); no game files.

From the review on ProjectLeonida#7905: a successful case on the layer again records the
clears, the edge draw and the resolve in one list, as the host path does.
Only a list whose Close failed is run between a list of the same clears and
a list that reads the destination back, so the lacking-mode path stays
covered.

Tested on an RTX 3060 (NVIDIA 616.92) with MSVC 14.52: d3d12_depth_resolve
passes 5 of 5 runs with the same counts; full ctest 236 of 237 (the other
failure is d3d12_vulkan_device, fixed by ProjectLeonida#7125). No game data.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@optinium51-bot

Copy link
Copy Markdown
Author

Thanks @MartinIndra02, done in 630e9d8: the lists are split only when Close fails. A successful case on the layer records the clears, the edge draw and the resolve in one list again, as on the host; a refused list runs between a list of the same clears and a list that reads the destination back, so the lacking-mode path stays covered. RTX 3060 (NVIDIA 616.92), MSVC 14.52: d3d12_depth_resolve 5/5 with the same counts; full ctest 236/237 (the other failure is d3d12_vulkan_device, #7125). Thanks also to everyone who tested it on AMD and NVIDIA. AI-assisted (Claude Code).

@justrealyme

Copy link
Copy Markdown

Tested 630e9d8 on NVIDIA GeForce RTX 5070 Ti (Blackwell), driver 617.42, Windows 11 build 26300, VS 2022 Build Tools (MSVC 19.44), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, RelWithDebInfo: pass, and it fixes the failure main has on this card.

  • main dde82f27e: d3d12_depth_resolve_test exits 1 on every run (3 of 3 here), with 5 to 8 different refused ...: Close 0x80070057, destination changed lines each run.
  • This head: 5 of 5 direct runs exit 0 with no destination changed line: against NVIDIA GeForce RTX 5070 Ti: 97 of 97 match, 0 host quirks, 7 refusals alike, against WARP: 71 of 71 match, summary 168 host comparisons matched, 12 refusals kept the destination, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ (edge cases on: glslangValidator present).

I'm closing my #7909 as a duplicate of this one (same fix, opened 24 s later); its AMD RX 7800 XT result from another tester is in #7909, for the same root cause.

Synthetic test only, no game files. AI-assisted (Claude Code).

@Maraco91

Copy link
Copy Markdown
Contributor

Re-check of the new head 630e9d80 on the same machine (RTX 3080 Ti, driver 616.56, Windows 11 26200, MSVC 19.42 + Ninja, RelWithDebInfo): pass.

Not rerun: the full suite at 630e9d80.

AI-assisted (Claude Code); no game files.

@DeSunShine

Copy link
Copy Markdown
Contributor

Tested 630e9d80f merged into main dde82f27e on NVIDIA GeForce RTX 4090 (driver 621.24), Windows 11 Pro 26200, MSVC (VS Build Tools 18) + Ninja, Vulkan SDK 1.4.363: pass, and it fixes d3d12_depth_resolve on main here. d3d12_depth_resolve_test.exe 3/3 rc 0, "145 host comparisons matched, 12 refusals kept the destination". ctest -R ^d3d12_depth_resolve$ with LEONIDA_VK_VALIDATION=1 passes. Main alone fails with 8 × destination changed, and I bisected that to #6610 (4da716493). I'm closing my duplicate #7985 in favour of this one. AI-assisted (Claude Code).

@0Daviduo0

Copy link
Copy Markdown

Tested 630e9d8 merged onto main 5d74c27 on AMD Radeon RX 6700 XT (RDNA2, Navi 22, gfx1031), AMD 26.11.2 (Windows driver 32.0.21045.29003), Windows 11 Pro 26200, MSVC 19.44, RelWithDebInfo; AMD's D3D12 is the native host: pass

  • d3d12_depth_resolve on main: exit 1. It prints eight refused ... Close 0x80070057, destination changed lines and six ... depth as R24_X8/R32_X8X24 AVERAGE ...: Close 0x80070057, destination differs from the clears lines.
  • With this PR: 10 of 10 runs exit 0 with none of those lines. Against the RX 6700 XT: "49 of 83 match, 18 host quirks, 7 refusals alike". Against WARP: "57 of 57 match". Totals: "106 host comparisons matched, 12 refusals kept the destination, 14 modes the device lacks were refused; 20 edge MIN/MAX pairs differ".
  • The 18 host quirks are all MIN/MAX depth or stencil resolves, where the host differs from the clears and the layer matches them. The same 18 appear in every run.
  • Only d3d12_depth_resolve_test was rebuilt. The change is limited to that file; full ctest on this main is in d3d12_pipeline_library_host_test: an own blob with its last byte changed is own format (AMD accepts it) #5873.
    No game files used. AI-assisted (Claude Code).

@corpse240

Copy link
Copy Markdown

Tested 630e9d80f merged onto main 5d74c2723 (clean) on Intel Arc B580 (Battlemage), Intel Windows driver 101.9150, Windows 11 Pro 26200 (RelWithDebInfo, VS 2022 Build Tools, Vulkan SDK 1.4.363.0): pass, 3 of 3 runs. d3d12_depth_resolve_test exit 0: depth/stencil resolves: 143 host comparisons matched, 12 refusals kept the destination, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ.

main fails: depth/stencil resolves against WARP: 69 of 71 match, with refused D24S8 depth AVERAGE rect 1: Close 0x80070057, destination changed and five more refused D24S8/D32S8 resolves.

The other two open fixes for this (#7905, #7930, #9066) also pass here. AI-assisted (Claude Code); no game files.

@Henergyque

Henergyque commented Nov 23, 2026 •

Copy link
Copy Markdown

Tested 630e9d80f merged onto main 5d74c2723 (clean merge) on NVIDIA GeForce RTX 5060 Ti (Blackwell), driver 621.24 (32.0.16.2124), Windows 11 build 26300, no Resizable BAR, MSVC (VS 2022) RelWithDebInfo, Vulkan SDK 1.4.363.1: pass.

For the maintainer: #7930 (the other d3d12_depth_resolve fix for the same symptom) also passes 3/3 here on the same setup, so both work on Blackwell. Only one of them needs to land. AI-assisted (Claude Code) test run.

@crastinator crastinator left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 630e9d80f under Wine and Proton on a real AMD GPU: d3d12_depth_resolve passes in all three, nothing new.

AMD Radeon RX 6700 XT (gfx1031), RADV Mesa 26.3.1, CachyOS Linux 7.3.5 (niri, XWayland). The Windows runtime is cross-built with clang-cl + xwin, merged onto main 867d922f0, and the full ctest (271 tests) is diffed against main under three Wines: WineHQ 11.22, Proton CachyOS 11.0 (cachyos-11.0-20261015-slr; vkd3d-proton 0bb64c5, DXVK 3.1.1-97) and Proton Experimental 11.0 (experimental-11.0-20261112; vkd3d-proton 2576c0b, DXVK 3.1.1-209). The Proton runs use files/bin/wine with a proton run-made prefix and WINEDLLOVERRIDES="d3d12=n;d3d12core=n;dxgi=n", as in docs/testing.md.

  • WineHQ 11.22: d3d12_depth_resolve fixed (on main: the eight refused ... Close 0x80070057, destination changed lines), nothing new.
  • Proton CachyOS 11.0 and Proton Experimental 11.0: fixed, nothing new from this PR (d3d12_noop_copy is flaky under Experimental on main).

#7930 fixes the same failure a different way (a list of its own for the refused resolve's readback), with the same result here, so only one of the two is needed. #8415 builds on this one.

AI-assisted (Claude Code). Synthetic resources only, no game files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.