Repository navigation
Conversation
…3D-27) Both were the generated stubs, so a render pass bound no targets and ran none of its accesses while the device reports RenderPassesTier 0. They are now emulated on the list's own commands, as the PC runtime does at tier 0: Begin binds the targets and runs the CLEAR beginning accesses (colour, depth and stencil planes), End runs each RESOLVE ending access through ResolveSubresourceRegion; SUSPENDING keeps the ending accesses for the resuming pass, which skips its beginning accesses. The recording rules are WARP's, measured by the new d3d12_render_pass_test (6 data cases byte for byte, 26 Close cases): no nesting, no End without a pass, at most 8 targets, direct lists only, Close fails while a pass is open, copies/resolves/clears/DiscardResource/OMSetRenderTargets fail inside a pass, and nothing may be recorded between a suspended pass and the one that resumes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: D3D-27 (#14 (comment))
What and why
On
main,ID3D12GraphicsCommandList4::BeginRenderPass/EndRenderPassare the generated stubs (GraphicsCommandListinruntime/shims/d3d12_com.cppdoes not override them): a render pass binds no targets and runs none of its beginning or ending accesses, while the device reportsRenderPassesTier = TIER_0anddocs/d3d12_vulkan.mdlists render passes as handled.This emulates them on the list's own commands, which is what the PC runtime does for a driver at tier 0 (WARP reports tier 0 too):
BeginRenderPassbinds the pass's render targets and depth/stencil view asOMSetRenderTargetswould, and records a clear for eachCLEARbeginning access (colour targets one by one; depth and stencil planes with their own flags and values).EndRenderPassrecords aResolveSubresourceRegionfor every subresource of eachRESOLVEending access (colour, depth or stencil).ResolveSubresourceRegion's body moved into a privateresolve_regionso both paths share it.DISCARD,PRESERVE,PRESERVE_LOCAL_*andNO_ACCESSrecord nothing, which each of them allows.SUSPENDING_PASSkeeps its ending accesses for the pass that resumes it; aRESUMING_PASSdoes not run its beginning accesses again (matches WARP byte for byte).EndRenderPasswithout a pass, at most 8 targets, direct lists only (bundles fail), Close fails while a pass is open but not while one is suspended, copies / resolves /Clear*View/DiscardResource/OMSetRenderTargetsfail inside a pass while barriers do not, and the pass after a suspended one must be aRESUMING_PASSwith nothing recorded in between (a barrier counts).docs/d3d12_vulkan.mdsection 4.3 describes this (it used to describe a plannedvkCmdBeginRenderingmapping), and the command table and the M3 row point at it.Tested
New
runtime/test/d3d12_render_pass_test.cpp(ctestd3d12_render_pass, exit 77 without a Vulkan GPU or under Wine): 6 data cases compared byte for byte with WARP after readback (colour CLEAR + PRESERVE with depth or stencil CLEAR, two passes on one target, SUSPENDING then RESUMING, RESOLVE ending into a region and into the whole texture) and 26 Close cases.mainbefore the change: 8 matched WARP, 24 differ (all 6 data cases and 18 of the 26 Close cases).LEONIDA_VK_VALIDATION=1, validation clean.cteston Windows (MSVC 19.51, RelWithDebInfo): 295 registered, 282 passed, 11 skipped, 1 disabled, 1 failed — the failure is the knownd3d12_execute_indirect_validationparity case (d3d12: ExecuteIndirect accepts the argument ranges newer D3D12 runtimes accept (D3D-EXECIND-RANGE) #337), the same as onmainwithout this change (281 passed there; the new test is the one more).tests/test_ctest_registration.py,test_docs_list_items.py,test_docs_repeated_lines.py,test_docs_table_ids.py: OK.git diff --checkclean;scripts/check_no_game_data.pyon the changed files: OK.Not covered: draws inside a pass (the test has no shaders; draws keep using their own dynamic-rendering scope), and which targets are bound after
EndRenderPass(they stay bound here).GPUs tested: NVIDIA GeForce RTX 5080, driver 621.14, Windows 11 Home build 26200 (WARP from the same Windows).
AI-assisted: yes (Claude Code). No game files.
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code