mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #628] [CLOSED] d3d12: BeginRenderPass and EndRenderPass on the Vulkan-backed list (D3D-27) #669
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#669
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/628
Author: @dkdknight
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:d3d-27-render-passes📝 Commits (1)
a2e9ee3d3d12: BeginRenderPass and EndRenderPass on the Vulkan-backed list (D3D-27)📊 Changes
4 files changed (+764 additions, -7 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+19 -7)📝
runtime/CMakeLists.txt(+9 -0)📝
runtime/shims/d3d12_com.cpp(+128 -0)➕
runtime/test/d3d12_render_pass_test.cpp(+608 -0)📄 Description
Claimed in the coordination issue as: D3D-27 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7128178677)
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 (#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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.