Skip to content

Runtime: a bundle's illegal calls fail its Close with E_FAIL (D3D-377) - #3596

Closed
Koro4e wants to merge 2 commits into
ItsNotRexed:mainfrom
Koro4e:d3d-377-close-fail
Closed

Koro4e wants to merge 2 commits into
ItsNotRexed:mainfrom
Koro4e:d3d-377-close-fail

Conversation

@Koro4e

@Koro4e Koro4e commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

D3D-377: the PC runtime answers E_FAIL from a bundle's Close for a call that is not legal in a bundle; the layer gave E_INVALIDARG (@nightmoon1996, comment 7084889482; the same code difference is noted on #3255).

The layer now tracks those separately from invalid arguments: every bundle-restricted call records bundle_error_, and Close returns E_FAIL when it is set, while bad arguments keep E_INVALIDARG. The bundle still refuses to execute through ExecuteBundle.

  • runtime/shims/d3d12_com.cpp: a check_bundle() path next to check(), all bundle restrictions use it, Close maps it to E_FAIL, Reset clears it.
  • runtime/test/d3d12_com_test.cpp: the bundle Close assertions and the invalid_bundle_call helper now expect E_FAIL.
  • runtime/test/d3d12_bundle_forbidden_test.cpp: the layer is now held to the host's code, not just the verdict.
  • docs/d3d12_vulkan.md: the bundle row no longer says "where this layer gives E_INVALIDARG".

Stacked on #3255 (head fd6e55f1 on 70e3acf4); merge after it, rebasing the docs row if needed.

Local checks on an RTX 3060 (Windows, MSVC, Vulkan headers fetched):

  • d3d12_com_test: pass (exit 0).
  • negative control with the shim reverted to 70e3acf4: fails at the ResolveSubresourceRegion bundle case.
  • d3d12_bundle_forbidden_test itself needs glslangValidator, which is not installed here; it needs one GPU run to confirm the code now matches the host table.

nightmoon1996 and others added 2 commits November 23, 2026 02:53
… calls ClearState, fails its Close, as on D3D12

RSSetViewports, RSSetScissorRects, OMSetRenderTargets and ClearState had
no bundle check, so the layer accepted them in a bundle while the PC
runtime fails that bundle's Close (measured on an RTX 4060 Ti and WARP,
no debug layer). They now invalidate the bundle like the other calls a
bundle may not make.

New host-comparison test d3d12_bundle_forbidden: ten calls, each in a
bundle and, as a control, on a direct list, against the PC runtime on
the default adapter and WARP.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The PC runtime answers E_FAIL for a call not legal in a bundle, where the layer gave E_INVALIDARG. Track those separately from invalid arguments, and update the tests and the docs row.
@Koro4e

Koro4e commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing this: @maxhurst131 already has D3D-377 as #3378 (recording_error_ + reject_bundle_call()), and the coordinator asked the two to be compared there. My patch is a smaller duplicate of the same idea (check_bundle + bundle_error_); #3378 also carries the first-error bookkeeping and the query/begin/end paths, so that one should move forward. Claim released here: tracker. @maxhurst131 - one note from the local run: ResolveSubresourceRegion needs a bundle guard before the direct-only check, which you already have; my negative control on 70e3acf4 fails exactly there, so the test side is solid.

@Koro4e Koro4e closed this Nov 22, 2026
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.

2 participants