mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:50:53 +01:00
[PR #841] d3d12: defer DispatchMesh in bundles (D3D-BUNDLE-DISPATCH-MESH) #879
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#879
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/841
Author: @Maticcm
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:feat/d3d12-bundle-dispatch-mesh📝 Commits (2)
9958fc0d3d12: defer DispatchMesh in bundlesa74ab14d3d12: address Copilot review on bundle DispatchMesh📊 Changes
3 files changed (+122 additions, -9 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+1 -1)📝
runtime/shims/d3d12_com.cpp(+12 -6)📝
runtime/test/d3d12_mesh_test.cpp(+109 -2)📄 Description
Claimed in the coordination issue as: D3D-BUNDLE-DISPATCH-MESH
What and why
ID3D12GraphicsCommandList6::DispatchMeshinruntime/shims/d3d12_com.cpppreviously evaluatedgraphics_pipeline_,graphics_.layout, andviewport_immediately when recorded, so callingDispatchMeshinside aD3D12_COMMAND_LIST_TYPE_BUNDLEcommand list did not defer throughdefer()and failed to inherit the parent direct list's render targets, viewport, scissor, or root arguments atExecuteBundle. It also skippednote_direct_heap_indexing(graphics_.layout).This change:
d3d12_trace::recordand the D3D12 grid-dimension checks (<= 65535per axis and product<= 2^22) at record time inGraphicsCommandList::DispatchMesh, then routes the recording throughdefer([=](GraphicsCommandList& l) { l.record_dispatch_mesh(x, y, z); }, true).record_dispatch_mesh(UINT x, UINT y, UINT z)(matchingrecord_drawandrecord_dispatch) withnote_direct_heap_indexing(graphics_.layout), empty-viewport skip, andleonida::Draw(draw.mesh = true).docs/d3d12_vulkan.mdsection 3.2 to note thatDispatchMeshis deferred alongside draws and dispatches.runtime/test/d3d12_mesh_test.cpp:mesh_psoexecutingDispatchMesh(2, 2, 1)twice from a parent created withvs_psousing different parent root constants/CBVs (verifying bundle initial PSO override and inherited render target, viewport, scissor, and root arguments).mesh_psoand root arguments to the parent for a subsequentDispatchMesh(2, 2, 1), verifying all 4,096 pixels (64x64) read back exact.E_INVALIDARGon bundleClose), executing aDispatchMeshbundle on a parent with no graphics root signature (E_INVALIDARGon parentClose), and callingDispatchMeshon an already-closed bundle (E_INVALIDARGon parentClose).Tested
scripts\build_runtime.ps1(MSVC 19.50.35729.0, Windows SDK 10.0.26100.0, Vulkan SDK 1.4.363.1, RelWithDebInfo):[263/263]targets built cleanly.ctest --test-dir runtime/build -R "^(d3d12_mesh|d3d12_bundle|d3d12_bundle_forbidden|d3d12_close_parity)$" --output-on-failure:4/4passed (100%).LEONIDA_VK_VALIDATION=1(VK_ADD_LAYER_PATH):4/4passed (100%, 0 Vulkan validation errors).python -I scripts/check_no_game_data.py runtime/shims/d3d12_com.cpp runtime/test/d3d12_mesh_test.cpp docs/d3d12_vulkan.md:ok (3 file(s)).python -m compileall -q make_game.py tools tests: exit 0.GPUs tested: NVIDIA GeForce RTX 3080, driver 630.20, Windows 11
AI-assisted: yes
Known limitations:
ExecuteIndirectinside a bundle remains un-deferred, and bundleDispatchstill has no dedicated GPU test (both noted indocs/d3d12_vulkan.md).Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — no translator changes)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.