Skip to content

d3d12_depth_resolve_test: read the destination back in a valid list after a refused call - #8828

Open
ersinhf wants to merge 1 commit into
ItsNotRexed:mainfrom
ersinhf:d3d12-depth-resolve-refused-list
Open

ersinhf wants to merge 1 commit into
ItsNotRexed:mainfrom
ersinhf:d3d12-depth-resolve-refused-list

Conversation

@ersinhf

@ersinhf ersinhf commented Nov 23, 2026

Copy link
Copy Markdown

What

runtime/test/d3d12_depth_resolve_test.cpp fails its eight refused cases on NVIDIA (Ada): refused D24S8 depth AVERAGE rect 1: Close 0x80070057, destination changed and seven siblings.

#6610 refuses a whole batch when a list's recording failed (runtime/shims/d3d12_com.cpp:1549-1555, ExecuteCommandLists: list N is invalid; refusing batch). The refused loop executed its invalid list and then expected the destination to hold the clear values, which was true only while the layer replayed an invalid list. Now nothing of that list runs — neither the clears nor the readback copy — so the readback stays zero: the stencil plane reads 0x00 where the test wants the clear's 0x5a. Depth matched by coincidence (0.0), which is why the message said "destination changed" without saying where.

Measured with a temporary print in the test (reverted before this commit): all eight cases had depth identical to the expectation and stencil as the only mismatch, and each run carried list 0 is invalid; refusing batch.

Change

Clear the source and the destination in a valid list, put the refused call in the invalid one, and read the destination back in a third valid list. The check still proves that executing a refused list leaves the destination at the clear values, and no longer depends on the readback buffer's initial contents or on replaying an invalid list.

Tested

No game files were used, and nothing from the package is quoted.

Claim: #8683 (comment) (new item). Behaviour relied on: #6610, merged.

AI-assisted: written with DeepSeek V4.1 Flash in an OpenCode session. Every number, log line and command above comes from a real run on the machine named in it.

@smowlyy

smowlyy commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Verified head 4ed299c66 merged onto main (867d922f0) on native Windows 11 (10.0.26300.9974, MSVC 19.44, RelWithDebInfo, Vulkan SDK 1.4.363.0):

  • python -I scripts/check_no_game_data.py runtime/test/d3d12_depth_resolve_test.cpp: clean (exit 0)
  • cmake --build runtime/build --target d3d12_depth_resolve_test --parallel: built cleanly
  • LEONIDA_VK_VALIDATION=1 .\runtime\build\d3d12_depth_resolve_test.exe on NVIDIA GeForce RTX 5060 Ti (driver 610.88, Vulkan 1.4.341): passed with 0 validation errors (97 of 97 match against HW, 71 of 71 match against WARP; 168 host comparisons matched, 12 refusals kept the destination)

AI-assisted.

…fter a refused call

ItsNotRexed#6610 refuses the whole batch of a list whose Close failed, so executing the invalid list in the refused loop ran nothing: the readback stayed zero and the stencil plane read 0x00 where the test wanted the clear's 0x5a (depth happened to match).

Clear and read back in valid lists of their own, and keep only the refused call in the invalid one, so the check still proves that executing the refused list leaves the destination at the clear values.
@ersinhf
ersinhf force-pushed the d3d12-depth-resolve-refused-list branch from 4ed299c to e556bee Compare November 23, 2026 19:41
@ersinhf

ersinhf commented Nov 23, 2026

Copy link
Copy Markdown
Author

Rebased onto main 867d922f (60 commits since the first head) and reran: d3d12_depth_resolve_test.exe exits 0, with 145 host comparisons matched, 12 refusals kept the destination, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ and depth/stencil resolves against WARP: 71 of 71 match.

The test file did not conflict; runtime/shims/d3d12_com.cpp gained 75 lines in that range and the test still passes on the new base.

AI-assisted: written with DeepSeek V4.1 Flash in an OpenCode session. Every number above comes from a real run on the RTX 4070 / NVIDIA 621.14 / Windows 11 26200 machine.

@awab128

awab128 commented Nov 23, 2026

Copy link
Copy Markdown

Tested e556bee4 (current head, on main 867d922f) on NVIDIA GeForce RTX 4060 Laptop GPU (Ada, subgroup 32), NVIDIA 621.35 (32.0.16.2135), Windows 11 10.0.26300, MSVC 14.44 (VS 2022 17.14 Build Tools), Visual Studio 17 2022 generator, Vulkan SDK 1.4.363.0: pass.

  • main 867d922f: d3d12_depth_resolve_test.exe exits 1 (74 of 97 match, 15 host quirks, 7 refusals alike against the GPU, 71 of 71 against WARP).
  • This PR's head, only the d3d12_depth_resolve_test target rebuilt: exits 0, with 145 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 unchanged from main (74 of 97 match, 15 host quirks, 7 refusals alike; WARP 71 of 71 match).

The 15 host quirks are the D24S8/D32S8 stencil MIN/MAX and depth AVERAGE cases where the NVIDIA driver differs from the clears and the layer matches them, the same set as on the RTX 4070 in #8720.

Full ctest on main 867d922f on this machine: 260 of 262 pass; the two failures are d3d12_vulkan_device (#8496) and d3d12_depth_resolve (this PR). No game files involved (LEONIDA_GAME_DIR unset).

AI-assisted (Claude Code).

@BeetjeMatig

Copy link
Copy Markdown

Tested e556bee on RTX 5070 Ti (Blackwell, subgroup 32), NVIDIA 621.01, Windows 11, MSVC 14.44 (VS 2022 17.14 Build Tools), CMake 4.5.1 + Ninja, Vulkan headers sdk-1.4.363.0 (fetched), SPIRV-Tools 2026.4, no game copy: pass.

I applied the diff (runtime/test/d3d12_depth_resolve_test.cpp) to a build of main at dfe4e4a, rebuilt only d3d12_depth_resolve_test and ran it. On main the test fails here with the eight refused resolves reporting "Close 0x80070057, destination changed" (D24S8 depth AVERAGE rect 1, D24S8 stencil AVERAGE rect 0, and six more), the same list as #8720. With this PR it exits 0: 51 of 51 resolves match the host on the RTX 5070 Ti with 0 host quirks and 7 refusals alike, 37 of 37 match against WARP, and the summary line reads "88 host comparisons matched, 12 refusals kept the destination, 0 edge MIN/MAX pairs differ". The edge cases were skipped because glslangValidator was not available at build time.

I also ran #7905 and #7930 the same way and they give the same result here, so all three fix the same failure; it is worth picking one and closing the others.

AI-assisted (Claude Code): built and ran the test as described above. No game data was used.

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.

4 participants