Skip to content

d3d12_depth_resolve: a list whose Close failed is not executed (fails on main since #6610) - #8650

Closed
KevinPratap wants to merge 1 commit into
ItsNotRexed:mainfrom
KevinPratap:fix/depth-resolve-refused-lists
Closed

KevinPratap wants to merge 1 commit into
ItsNotRexed:mainfrom
KevinPratap:fix/depth-resolve-refused-lists

Conversation

@KevinPratap

Copy link
Copy Markdown

Claimed in the coordination issue: claim (new test item, ID to be assigned).

What broke

d3d12_depth_resolve exits 1 on main since #6610 ("reject null arrays and invalid lists in ExecuteCommandLists"), on any device.

For its refused resolves, and for the modes a device lacks, the test recorded the clears, the resolve and the readback copies in one list. When the resolve made Close return E_INVALIDARG, it executed that list anyway, with run_invalid = true ("the layer runs what it recorded"), and checked that the destination kept its clear values. Since #6610, the layer's ExecuteCommandLists refuses a list whose Close failed, as the host runtime does ([rt] d3d12: ExecuteCommandLists: list 0 is invalid; refusing batch). So the clears and copies never run, the readback stays empty, and every refused case printed refused … Close 0x80070057, destination changed.

The change (test only)

  • resolve_and_read loses run_invalid: a list whose Close failed is never executed, on the layer or on the host, and its planes stay empty.
  • Refused cases check Close == E_INVALIDARG. A mode the device lacks checks its Close and no longer compares planes it can't have.
  • The summary line says refusals failed at Close instead of refusals kept the destination. Nothing in the repository parses it.

The "destination kept" property is now enforced one level up: the whole list is refused. #6610's own tests cover that refusal, so this test no longer re-checks it through a destination it can't observe. The host comparisons and the edge MIN/MAX checks are unchanged.

Tested

Windows 11, RTX 4050 Laptop (NVIDIA 592.82), MSVC 14.44 RelWithDebInfo, on main 867d922f0:

  • With this change: exit 0, 128 host comparisons matched, 12 refusals failed at Close, …; 20 edge MIN/MAX pairs differ. No refusing batch line in the log any more.
  • With the change set aside (same build, test file reverted): exit 1, 8 destination changed failures. Restored: exit 0 again.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

… on main since ItsNotRexed#6610)

The refused resolves executed their list after Close returned E_INVALIDARG and
expected the layer to run its valid commands, then checked that the destination
kept its clear values. Since ItsNotRexed#6610 ExecuteCommandLists refuses such a list, as
the host does, so nothing ran and every refused case reported "destination
changed" (exit 1). A list whose Close failed is now never executed, on either
device; refused cases and modes the device lacks check Close == E_INVALIDARG.

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

@Grimkeh Grimkeh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Independent Linux CPU review (3c61c83e)

What changed: d3d12_depth_resolve_test.cpp — a command list whose Close failed is not executed (regression vs #6610).

Checked:

  • Diff is a focused test harness fix; no game files.
  • Full D3D12 runtime binary not exercised here (CPU-only review of the test change).

Looks correct for the described Close-failure path.

@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 3c61c83 on Windows 11 with Vulkan validation enabled. The depth/stencil resolve test passes on both GPUs. The AMD run also exercises the path for unsupported resolve modes.

Vulkan adapter from the test log Matched host comparisons Expected refusals at Close Unsupported modes refused
NVIDIA GeForce RTX 4090 145 12 0
AMD Radeon(TM) Graphics 106 12 14

On parent 867d922, each adapter reports eight destination changed failures. The PR reports zero such failures. Both PR runs distinguish all 20 edge MIN/MAX pairs.

I built d3d12_depth_resolve_test in RelWithDebInfo and ran ctest -C RelWithDebInfo -R "^d3d12_depth_resolve$" -V with LEONIDA_VK_VALIDATION=1. I set VK_LOADER_DRIVERS_DISABLE to *amd* for NVIDIA and *nv* for AMD.

AI-assisted.

@guinpereira

Copy link
Copy Markdown

Tested 3c61c83e2 on an NVIDIA GeForce RTX 5060 Ti (Blackwell), driver 617.14, Windows 11 Pro 26200, MSVC 14.44 RelWithDebInfo, Vulkan SDK 1.4.363.0. The PR's test file was applied on main 867d922f0, only d3d12_depth_resolve_test was rebuilt, and each build ran 3 times: pass.

Build Exit codes Output
main 867d922f0 1, 1, 1 8 × refused … Close 0x80070057, destination changed, after list 0 is invalid; refusing batch
this PR 0, 0, 0 168 host comparisons matched, 12 refusals failed at Close, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ; no refusing batch line
#7905 at 630e9d80f, same main, for comparison 0, 0, 0 0 destination changed lines

Overlap note: #7905 (opened earlier, with many independent passes) and #7930 (marked there as its duplicate) fix the same post-#6610 failure. The difference is coverage. #7905 keeps checking that a refused resolve leaves the destination as the clears left it: it clears in one list, runs the refused list, then reads back in a third list. This PR drops that check and relies on #6610's own ExecuteCommandLists refusal tests (d3d12_queue_list_type_test, d3d12_vulkan_device_test). Both pass here. Since only one should land, the maintainers may want to pick between them.

AI-assisted (Claude Code). No game files.

@KevinPratap

Copy link
Copy Markdown
Author

Closing as a duplicate of #7905 and #7930, which fix the same d3d12_depth_resolve failure and were opened before this one. I missed them when I checked for an existing fix. Theirs also keep the destination check, by clearing it in a list of its own, where this one dropped it. Thanks @shdann and @guinpereira for testing; your results describe the same failure on main, so they apply to those two as well.

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