Repository navigation
Runtime: a bundle that sets viewports, scissors or render targets, or calls ClearState, fails its Close, as on D3D12 - #3255
Conversation
… 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>
|
Code read (no build: this machine is in a no-background-work window). The shape is right — the restriction is enforced at record time on the bundle path ( One thing worth a test line, not a blocker: |
|
Tested
First NVIDIA coverage — a bundle that sets viewports, scissors or render targets, or calls |
|
@dcastell1 thanks for reading it. AI-assisted (Claude Code). |
|
Tested
This PR and #3298 merge with each other cleanly except in AI-assisted (Claude Code). Synthetic tests only, no game data. |
|
Tested 70e3acf on Intel UHD Graphics (Xe-LP, Tiger Lake-H iGPU, driver 101.7088) and NVIDIA RTX 3050 Laptop GPU (driver 617.42), Windows 11 Pro build 26300,
|
Claimed in the coordination issue as: #3047 (comment) (new D3D item, the second of the two)
What and why
RSSetViewports,RSSetScissorRects,OMSetRenderTargetsandClearStatehad no bundle check inruntime/shims/d3d12_com.cpp. The layer accepted them in a bundle (andClearStatereset the bundle's own state), while the other calls a bundle may not make already fail itsClose. A follow-up to #2145.Measured on the PC runtime first (RTX 4060 Ti and WARP, no debug layer, a fresh device per call; the two adapters agree on every row):
CloseRSSetViewportsE_FAIL)S_OKRSSetScissorRectsE_FAIL)S_OKOMSetRenderTargetsE_FAIL)S_OKClearStateE_FAIL)S_OKResourceBarrier,ClearRenderTargetView,SetPredication,ExecuteBundle(controls, already refused)E_FAIL)OMSetStencilRef,OMSetBlendFactor(allowed)S_OKS_OKS_OKThe same ten calls with the same arguments on a direct list close with
S_OKon both adapters and on the layer, so the refusal is the bundle rule and not an argument.The change
if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) return check(false);the other refused calls have. Nothing on the parent's side reaches them:ExecuteBundlereplays through private helpers, andResetdoes not go throughClearState.docs/d3d12_vulkan.md: the sentence listing the refused calls names the four and the measurement, andClearStateleaves the "not deferred yet" note.Not changed, as a finding: every refused bundle returns
E_FAILfromCloseon the PC runtime, where the layer returnsE_INVALIDARG(one path for every list type). The test compares pass or fail, not the code. Changing the code wants its own measurement on direct lists too.Also observed:
ExecuteBundleof a bundle whoseClosefailed crashes the PC runtime's process on the default adapter, so the parent list's result after that is not measured; the test stops at the bundle'sClosefor refused calls. The layer refuses such a bundle inExecuteBundle, as before.Tested
Windows 11, NVIDIA GeForce RTX 4060 Ti (driver 32.0.16.2101), clang-cl 23.1.6 with the xwin SDK (10.0.26100), run natively. No game files.
d3d12_bundle_forbidden: 10 calls compared with the PC runtime on the RTX 4060 Ti and on WARP, 0 failures, the two adapters agree on all 10; the direct-list control passes for all 10 on the layer and both adapters.main'sd3d12_com.cppthe four new rows differ (layerS_OK, PC runtime fails).d3d12_com(four new refused-in-bundle checks),d3d12_bundle,d3d12_computepass. Fullctestbefore the review follow-ups to the test: all pass exceptd3d12_subgroup, which my toolchain can't build (no AMDGPU target inllvm-mc); after them I re-ran the tests listed here, not the whole suite.CopyTilesin a bundle (it has no bundle check either, and needs a reserved resource), MSVC, Wine, any AMD or Intel GPU, a run with the Vulkan validation layer installed.AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (not a translator change)🤖 Generated with Claude Code