Repository navigation
Conversation
…kan-backed list (D3D-27) BeginRenderPass binds the pass's RTVs/DSV as OMSetRenderTargets does and records the CLEAR beginning accesses as ClearRenderTargetView / ClearDepthStencilView (depth and stencil planes by their own access). RESOLVE ending accesses are copied at BeginRenderPass and recorded at EndRenderPass through the ResolveSubresourceRegion path. RESUMING_PASS skips the clears, SUSPENDING_PASS the resolves. Close with a pass open returns E_FAIL, as measured on WARP. d3d12_render_pass_test compares six cases with Windows WARP byte for byte.
|
Independent review of #1062 (D3D-27, BeginRenderPass / EndRenderPass, Tier 0 emulation) Head: 7d19436 (one commit on 3295055). It merges into origin/main 3aa9754 with no conflicts ( Environment: Windows 11 Pro 26300, MSVC 19.50 (14.50.35717, VS 18 2026 generator), NVIDIA GeForce RTX 5070 Ti, driver 617.42, Claim
Commands and resultsThe build added no new warnings in
Extra probe: Close HRESULTs on WARP, on the host D3D12 device on the RTX 5070 Ti, and on the layerI wrote a throwaway probe that is not in the PR (copy: F:\recomp\tmp\rv-1062-probe.cpp). It records each case on a fresh list and calls only
For every case the PR claims, the HRESULTs match WARP and the host hardware runtime. The host NVIDIA runtime also returns E_FAIL for "pass left open", so the choice of E_FAIL is confirmed on real hardware too, not only on WARP. Findings
The semantics I checked against the D3D12 render-pass rules look right:
The docs in section 4.3 and the M3 row describe what the code does. VerdictApprove with non-blocking follow-ups. The emulation is correct for every case tested. It matches WARP, and for Close the host NVIDIA D3D12 runtime too, with and without Vulkan validation on the RTX 5070 Ti. The new test fails on main and catches a targeted mutation. Findings 1 and 2 are Close-parity gaps against the host runtime and are suited to a follow-up, not to blocking this PR. AI-assisted. |
…onida#1062's review (D3D-27) - The calls D3D12 forbids inside a pass (OMSetRenderTargets, the RTV/DSV clears, CopyResource, CopyTextureRegion, CopyBufferRegion, DiscardResource, ResolveSubresource(Region), Dispatch) make Close E_FAIL and are not recorded. - A pass on a bundle or a compute list, and more than eight targets, make Close E_FAIL instead of E_INVALIDARG. - A CLEAR with no descriptor and a RESOLVE with no source are skipped without an error, as WARP does, so an invalid access no longer leaves a pass half recorded. - Pass state is reset by Reset only, not by ClearState. d3d12_render_pass_test: 29 Close cases with expected values (each also checked on WARP), a D32_FLOAT depth RESOLVE, ALLOW_UAV_WRITES, and a suspended part whose RESOLVE would land elsewhere. The CMake block moves below the unrelated d3d12_typeless_rtv line.
|
Thanks for the review and the NVIDIA probe. All five findings are addressed in 3dcd091 (on top of 7d19436; it still merges into
Also: Results on an AMD Radeon RX 6600 (driver 26.6.4, Windows 10 19045):
The PR body is updated to match. AI-assisted. |
|
Independent Windows verification of Host: Windows 11 Pro 26300, NVIDIA GeForce RTX 5070 Ti (driver 621.24, Resizable BAR), live WARP, MSVC 19.44.35207 (VS 2022 Build Tools), Ninja, RelWithDebInfo,
Failures shared with the merge base |
|
Thanks for the independent run on the RTX 5070 Ti. One note: this verified The |
Claimed in the coordination issue as: D3D-27 (#14 (comment)). #628 had it before and was closed by its author with the branch deleted; this is a fresh implementation.
Problem
On
main,ID3D12GraphicsCommandList4::BeginRenderPass/EndRenderPassare the generated stubs. The device already reportsRenderPassesTier = TIER_0, so a title that records a frame with render passes binds no targets, runs no clears and no resolves.Change
Tier 0 emulation on the list's own commands, the way the D3D12 runtime handles a Tier 0 driver (
runtime/shims/d3d12_com.cpp):BeginRenderPassbinds the pass's RTVs/DSV through the same code asOMSetRenderTargets(bind_targets) and records eachCLEARbeginning access as aClearRenderTargetView/ClearDepthStencilView. Depth and stencil each go by their own access, in one clear.PRESERVE,DISCARD,NO_ACCESSandPRESERVE_LOCAL_*record nothing.RESOLVEending accesses are copied atBeginRenderPassand recorded atEndRenderPass, one per subresource parameter, throughResolveSubresourceRegion's checks. These are now in aresolve_regionhelper;ResolveSubresourceRegionbehaves the same.RESUMING_PASSskips the clears andSUSPENDING_PASSskips the resolves.Closereturns what Windows WARP returns (and, for the cases the review probed, the host D3D12 runtime on an RTX 5070 Ti):E_INVALIDARG:EndRenderPasswith no pass,EndRenderPasstwice, a nestedBeginRenderPass.E_FAIL: a pass left open; more than eight targets; a pass on a bundle or a compute list; andOMSetRenderTargets,ClearRenderTargetView,ClearDepthStencilView,CopyResource,CopyTextureRegion,CopyBufferRegion,DiscardResource,ResolveSubresource,ResolveSubresourceRegionorDispatchinside a pass (not recorded).S_OK: a resource barrier inside a pass, and aCLEARwith no descriptor or aRESOLVEwith no source, which WARP skips and so does the layer.Resetonly, not byClearState.docs/d3d12_vulkan.mdsection 4.3 and the M3 row are updated.Tested
New
d3d12_render_pass_test(in CMake and ctest). It runs eight cases through the D3D12 API on the Vulkan-backed device and on Windows WARP, and compares the readback bytes andCloseHRESULTs. It also checks WARP against the values written in the test, so a case cannot pass by both sides being wrong:mainALLOW_UAV_WRITESD32_FLOATdepth RESOLVE (MIN; skipped on a device without MIN depth resolves)Closecases, each with its expected HRESULTThe same eight pass with
LEONIDA_VK_VALIDATION=1(Khronos validation layer 1.4.341), 0 validation errors. Seven targeted mutations of the emulation (a forbidden call not checked, a bundle pass back toE_INVALIDARG, a null-RTV CLEAR made an error, RESUMING clearing, the depth resolve dropped, nine targets back toE_INVALIDARG, SUSPENDING resolving) each make one case fail.Setup: AMD Radeon RX 6600 (RDNA2), AMD Windows driver 26.6.4 (32.0.21043.19003), Windows 10 22H2 19045, MSVC 14.44 + Windows SDK 10.0.26100, Ninja, RelWithDebInfo.
Full
cteston this branch: 299/308 passed. 8 failures fail the same way onmainon this machine, because Windows 10 has an older D3D12 runtime and WARP:root_signature_oracle,d3d12_vulkan_device,d3d12_texture_tiles,d3d12_close_parity,d3d12_clear,d3d12_pso_validation,d3d12_mesh,d3d12_set_descriptor_heaps.d3d12_close_parity's output is line for line the same as onmain. The ninth,xmem("mapping them does not charge them", next to its remap race), failed once under the parallel run and passed 5/5 run alone; this PR does not touch xmem. Thetests/test_docs_*.pysuite,test_d3d12_stubs_generation.pyandcheck_no_game_data.pypass.Not covered: draws inside a pass (they use the same per-draw rendering scope as after
OMSetRenderTargets),PRESERVE_LOCAL_*, the forbidden calls WARP was not measured for (UAV clears,CopyTiles,ExecuteIndirect, queries), and a Tier 1 path.No game files. AI-assisted.