d3d12: mesh pipelines draw through compute on a GPU without mesh shaders (D3D12-MESH-COMPUTE-FALLBACK) #2580
Closed
qhukz13 wants to merge 9 commits from
upstream-pr/2580 into main
pull from: upstream-pr/2580
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
ProjectLeonida/mandy!2580
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2580"
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?
Imported from ubiquitarianism/leonida. Originally posted by qhukz13 on 2026-11-28T17:44:43Z.
Claimed in the coordination issue as: D3D12-MESH-COMPUTE-FALLBACK (#2570#issuecomment-7239097845)
What and why
leonida.exerefuses every mesh pipeline on a GPU without D3D12 mesh shaders (mesh shader tier 0: Pascal and older), so the world draws nothing there. This translates each mesh program as an ordinary compute shader writing its outputs to a buffer, and draws that buffer as a triangle list through a pass-through vertex shader of ours.set_host_mesh_shaders(false):cs_6_6; its four mesh output ops become raw stores into the root UAVSLOT_MESH_OUT, oneMeshOutslot per group;mesh_vs()reads it back:SV_VertexIDgives primitive and corner,SV_InstanceIDthe group, and per-primitive outputs are constant inputs where the pixel shader reads them;LEONIDA_MESH_COMPUTE=1forces it on any card, for comparison);Dispatch+DrawInstanced;WriteBufferImmediate+ twoExecuteIndirects (dispatch signature over the title's own record, then draw from the header).On Windows 10 this needs #2557 (shader model 6.6).
Tested
no host pipeline: the host GPU has no mesh shaders. Fallback pipelines made in a run: up to 567; no device removal.cargo test -p leonida-shader --lib mesh,-p leonida-gpu --lib shader_cache): 7 + 2 pass on the 1050 Ti. The device test draws the triangle mesh fixture as compute and checks the texels, and compares them with the mesh pipeline texel for texel on a device with mesh shaders. dxil.dll validates the compute variant and the vertex shader.LEONIDA_MESH_COMPUTE=1on an RTX card would show it.GPUs tested: GTX 1050 Ti 4 GB (Pascal, profile S), 582.66, Windows 10.
AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T21:10:14Z.
Code review location:
d3d12/crates/leonida-shader/src/emit/mesh_vs.rs; line 138groups_cap()counts usable slots, so slot indices below it are usable and the slot at that index is already the sink. The unsigned greater-than predicate still renders instancegroup == cap. I made the existing synthetic triangle fixture use a 4 KiB scratch cap, giving three usable slots. With only the last valid slot populated, it lit all 256 pixels as expected. With only the sink populated, instance 3 also lit all 256. Changing the comparison to unsigned greater-or-equal gave 0, as intended. Both the direct draw's instance count and the indirect header can currently include the sink instance. Could we exclude it at the comparison or cap the submitted draw count?Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T21:10:14Z.
Review: COMMENTED
Reviewed
094e948e9merged locally withmainaa918e5d9. The synthetic triangle variants (plain, edge flags, culled) matched the native mesh pipeline on RTX 5070 (610.88), Windows 10 22H2 with Agility SDK 1.614.1 and DXIL validator 1.9.2609. The mesh-filtered suite reported 7 passing entries, with the optional compiler comparison and WARP device subcase skipped. One extra GPU fixture reproduced the sink-slot boundary below.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T21:20:12Z.
Windows 11 + RTX 3090 D3D12 & WARP Verification (
094e948e99) — GPU Verified + Rebase Needed Againstmain(E0063)Verified commit
094e948e99a48d1476ac8adb33c5ce24ac8cb68don Windows 11 (x86_64-pc-windows-msvc) with physical NVIDIA GeForce RTX 3090 (Ampere, D3D12 driver610.88, native SM 6.6 mesh shaders enabled for direct hardware comparison) and WARP +dxil.dll.1. Red -> Green Physical GPU & DXIL Verification
main1bc055e6c2):shader_cacheMeshOutround-trip fails to compile (E0422/E0609/E0560:MeshOutandHostShader::mesh_outabsent).094e948e99standalone & merged ontomain1bc055e6c2with the 2-fieldTranslatedupdate below):cargo test --locked -p leonida-shader --lib -- --nocapture --test-threads=4 mesh:7/7passed (0.76s):a_mesh_program_translates_as_compute_without_mesh_shaders:dxil.dllvalidated both the loweredcs_6_6compute shader and the generatedmesh_vspass-through vertex shader.a_mesh_program_run_as_compute_draws_what_the_mesh_pipeline_draws: passed texel-for-texel against the native mesh pipeline on both physical RTX 3090 (hardware: the mesh program drew as compute (mesh shaders there: true)) and WARP (warp: the mesh program drew as compute (mesh shaders there: true)).cargo test --locked -p leonida-gpu --lib -- --nocapture --test-threads=4 shader_cache:2/2passed (MeshOutcache round-trip and damage rejection).LEONIDA_MESH_COMPUTE=1 LEONIDA_D3D12_DEBUG=1 cargo test --locked -p leonida-gpu --features diagnostics --lib -- --nocapture --test-threads=4 pipeline::host::tests:9/9passed on RTX 3090 (0D3D12 debug-layer errors) and8/8applicable tests passed on WARP (LEONIDA_D3D12_WARP=1).python -I scripts/check_no_game_data.py(0issues) andgit diff --checkclean.2. Blocking Rebase Note Against Current
main(aa918e5d9f)Although Git merges
094e948e99intomain(aa918e5d9f) without textual conflicts,leonida-gpufails to compile after the merge becausestruct Translatedind3d12/crates/leonida-gpu/src/pipeline.rsgainedstores_past_viewsandboundonmainsincec1ecf04edc:Adding
stores_past_views: false,andbound: Default::default(),to the syntheticvsTranslatedliteral inShader::mesh_fallback(d3d12/crates/leonida-gpu/src/pipeline.rs) resolves the compile error cleanly and passes all tests above onmain.3. Non-Blocking Notes
d3d12/crates/leonida-gpu/src/draw.rs):mesh_as_computeandmesh_indirect_as_computecalll.IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST)on the host command list without restoringself.topologyafterwards (if self.topology_set { self.set_topology(list, self.topology); }, analogous toself.mesh_scissor(list, false)). If an earlier draw on the same command list bound a non-TRIANGLELISTtopology (e.g.TRIANGLESTRIPorLINELIST) and a subsequent VS/PS draw after the mesh dispatch does not re-issueIASetPrimitiveTopology, it would inheritTRIANGLELIST.d3d12/crates/leonida-shader/src/emit/shader.rs:260):MeshOut::newtriggers#[warn(private_interfaces)]becauseSigElementispub(crate)(pub(crate) fn newsilences it).AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-28T23:17:32Z.
Independent Wine/vkd3d-proton check on RTX 4070 SUPER (NVIDIA 620.73.04, CachyOS, Wine 11.22, vkd3d-proton
71cae091). I tested094e948e9merged with mainadfb3821a. The unadjusted merge reproducesE0063for the two missingTranslatedfields. With the two local initializers from the earlier review, native mesh and compute readbacks matched texel for texel for the plain, edge-flagged and culled triangles. The mesh, shader-cache and host-pipeline filters reported 7, 4 and 9 passing test entries respectively. The optional DXC-dependent cases skipped. DXVK returned the physical adapter for the WARP request, so the WARP-labelled pass is also hardware coverage.I also reproduced the sink-slot finding at the stock 64 MiB capacity. The last usable slot (74,896) drew 256/256 texels. With only slot 74,897 populated, 74,897 instances drew zero texels, while 74,898 or 74,899 instances drew all 256. With the proposed
IUGT→IUGEchange the last usable slot still drew all 256 and all three sink-only draws stayed clear. Synthetic fixtures only. AI-assisted.Imported from ubiquitarianism/leonida. Originally posted by qhukz13 on 2026-11-28T23:47:29Z.
Rebased onto
maina9e247cd6.E0063the reviewers hit is fixed: the vertex half of a mesh program run as compute builds itsTranslatedwith the two fieldsmainadded (stores_past_views: false,bound).draw.rs:main'sis_depth_companionis kept besidemesh_buffer.MEASURED on a GTX 1050 Ti (582.66), Windows 10, with Agility 1.614.1 for the test binary:
leonida-shader: 356/356 passed.leonida-gpu: 516 passed; 3 WARP/device tests fail onmaintoo.Thanks @lixonik, @zmasi and @merzleckeier for the runs.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T00:56:48Z.
RUN of #2580 (native Windows, no game files), re-run at the new head
Heads: PR
dc5818bb84(2 commits,656cfa15e+dc5818bb8; merge-base with maina9e247cd6, 71 commits behind), main795e0904c2.Machine: NVIDIA GeForce RTX 3090 24 GB (has mesh shaders), driver 621.40, Windows 11 Pro 10.0.26300, rustc 1.98.1.
Commands (in d3d12/, CARGO_TARGET_DIR set outside the repo):
cargo test -j 8 -p leonida-shader --lib mesh
cargo test -j 8 -p leonida-gpu --lib shader_cache
cargo test -j 8 -p leonida-shader --lib a_mesh_program -- --nocapture
cargo check -j 8 -p leonida-shader -p leonida-gpu --tests (on main + PR merged)
GREEN (PR head):
Main (same filters): shader mesh 5 passed; gpu shader_cache 4 passed. Nothing failed, so nothing pre-existing to subtract.
RED:
MERGE WITH CURRENT MAIN: git merge-tree reports no conflict, and the merged tree (main + PR, git merge --no-commit) now compiles: cargo check -p leonida-shader -p leonida-gpu --tests finishes with no error (warnings only). The E0063 seen at the previous head (
094e948e9: missing fields bound and stores_past_views in a Translated initializer in leonida-gpu pipeline.rs) is gone; the new head sets stores_past_views there. On the merged tree: leonida-shader mesh 7 passed, leonida-gpu shader_cache 4 passed.Not checked: the real fallback on a card without mesh shaders (Pascal), and the game.
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T01:06:05Z.
Review: COMMENTED
Static audit of
dc5818bb8against48bae6cad. Request changes.d3d12/crates/leonida-gpu/src/draw.rs:5907creates a native mesh signature before the compute branch. Select the compute signature first so tier-0 drivers can reach the fallback.d3d12/crates/leonida-shader/src/emit/mesh_vs.rs:138admits the first sink instance. Suppressgroup >= capand avoid concurrent writes to the sink.d3d12/crates/leonida-gpu/src/draw.rs:4707and:4782leave the host topology set toTRIANGLELIST. Restore the caller's topology after the fallback draw.d3d12/crates/leonida-shader/src/emit/mesh_vs.rs:84drops rasterizer-consumed layer and viewport outputs when the PS omits them.d3d12/crates/leonida-shader/src/emit/shader.rs:270also builds the offsets before the signature is reordered. Keep rasterizer outputs and serialize each offset with its signature element.d3d12/crates/leonida-gpu/src/pipeline/host.rs:658can select the native path before the host is initialized, then cache a refusal on tier 0. Initialize the host before choosing the path.d3d12/crates/leonida-gpu/src/draw.rs:4824and:6024only account for the graphics stages' stores. Account for mesh compute stores so subsequent indirect commands see fresh arguments.Please add synthetic runtime coverage for the first overflow group, repeated direct and counted indirect dispatches, per-primitive outputs, and a following strip draw.
AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-29T02:17:23Z.
Code review location:
d3d12/crates/leonida-shader/src/emit/mesh_vs.rs; line 138Retested after the rebase at
dc5818bb8424d96b642ba07cd03a3251d529a147, merged withmain02944d4ca1. The crate builds here, and the translation test passes with DXIL validator 1.9.2609. The sink-slot case still reproduces.With synthetic triangle data and a 4 KiB scratch buffer, I drew four instances and populated one slot at a time. On RTX 5070 (610.88), Windows 10 22H2, Agility SDK 1.614.1, slot 2 lit 256/256 pixels and the sink at slot 3 also lit 256/256. Changing just
IUGTtoIUGEkept slot 2 at 256/256 and took the sink to 0/256. The plain, edge-flag, and culled comparisons with the native mesh pipeline passed with that local one-line change. WARP skipped for lack of SM 6.6 here.AI-assisted. Codex (GPT-6).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-29T17:38:54Z.
Mechanical note, no review: this branch conflicts with
main(4364a4fa6) on a rebase, and the conflict is smaller than it sounds.git merge-tree --write-tree origin/main refs/pull/2580/headreports 1 conflicted file(s):d3d12/crates/leonida-shader/src/emit/mod.rsmainchanged that file in three recent commits (0bc6e21a1,804280d80,0807f9cba). #2581 touches the same file, and the two branches merge with each other without conflict, so neither has to wait for the other - both just need a rebase ontomain.So a rebase is all it needs - the change itself may well be fine, I have not looked at its content, only at whether git can apply it.
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by qhukz13 on 2026-11-29T18:39:15Z.
Thanks for the audit, @timbot103. All six points held up in the code and are fixed in
bc0c72f50:groups_capon (the sink) draws nothing, and the direct path draws at mostcapinstances;MeshOut's OSG1/PSG1 keep elements in the order of their offsets (the test fails without it);Also:
1b33fa2bbputsdrew()'s doc comment back ondrew(), and1b6b223d3makesMeshOut::newcrate-private (theprivate_interfaceswarning).A per-primitive layer/viewport index is refused by
mesh_vsfor now: the translator does not export those yet (lower.rsrefuses them), so there is nothing to carry until it does.Runtime coverage (
924b29417). What the fallback records around the pipelines the draw path binds (barriers, the direct or counted indirect dispatch, the indirect draw's header, the triangle list from the buffer, the title's topology again) is now one recorder,mesh_fallback::MeshRun, whichdraw.rscalls.mesh_runs_in_one_list_draw_their_own_groups_and_the_strip_after_them_its_striprecords it on a device the way a title does, in one list:Every texel must come out as the runs and the strip draw it. As a check, without the topology restore the strip draws one triangle (64 of 256 texels differ), and without the header's instance count reset the count-0 run draws the first run's groups again (100 differ). The first overflow group is
the_mesh_sink_slot_draws_nothing.Tested on GTX 1050 Ti 4 GB / NVIDIA 582.66 / Windows 10 (no mesh shaders):
--libwith the Agility SDK: 233 passed, 0 failed, includinga_mesh_program_run_as_compute_draws_what_the_mesh_pipeline_drawsandthe_mesh_sink_slot_draws_nothingon the card;--lib: 517 passed, 3 failed. The same 3 fail on the base without this PR on this card:a_raw_view_is_moved_only_where_its_descriptor_says_where_it_is,views_are_made_beside_the_heap_and_copied_in, anddepth_bounds_pipeline_loads_and_filters_draws(E_INVALIDARG).AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by qhukz13 on 2026-11-29T20:03:33Z.
Merged main (
7c330c76d) in58c333368, plus:eab9c1e0f: the test programs from924b29417move toemit::test_programs(built on every platform), since a portable test needs them andemit::hostis Windows-only. Before this the Linux test build did not resolve them.74ac98c64: the fallback's shaders take main's newShader::mask/masked_twins.The fallback now takes the per-dispatch
mesh_test()mode as main's mesh paths do.GTX 1050 Ti / 582.66 / Windows 10:
mesh_runs_in_one_list…passes;--lib: the same 3 failures as clean main on this card, over 3 runs each.Linux: leonida-shader 226 passed. AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-29T21:06:14Z.
Code review location:
d3d12/crates/leonida-shader/src/emit/mesh_vs.rs; line 138Retested the sink fix at
74ac98c64on native Windows 10 22H2, RTX 5070 (610.88), with Agility SDK 1.614.1 and DXIL validator 1.9.2609. The committed sink fixture ran on hardware: slot 0 lit 256/256 pixels and slotgroups_cap()lit 0/256. The compute and native mesh draw comparison also passed. I used local Agility loader exports for the test binary and made the sink fixture require a hardware device. The optional WARP and external shader-compiler cases skipped.This resolves my sink-slot finding. AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T21:43:07Z.
Partial check by OreoFR on macOS 27.2.1 (26B131), Apple M5, Rust 1.98.1 (d3d12/rust-toolchain.toml), main
060c47160(merges cleanly; does not force a rebase of #2566 ateade9562c), PR head74ac98c64queue.rs:1417/1446,list.rs:2556/2562use#[cfg(windows)]modules fromlib.rs:53/126,resource.rs:712), so its tests (incl. GPU tests) are not covered here. In-game behaviour is not covered either.cargo test -p leonida-shader --locked): the new tests live inemit/mod.rswith the code, so red = main where they do not exist: main 224 passed / 2 ignored → merge 226 passed / 2 ignored, 0 failed. New:emit::tests::a_mesh_program_translates_as_compute_without_mesh_shaders,emit::tests::mesh_out_parts_keep_their_elements_beside_their_offsets(MEASURED n=3, alone).cargo check --target x86_64-pc-windows-msvc --features host --tests: 0 errors. Clippy-D warnings: nothing new on macOS; on the Windows target 2 new unused imports inemit/mod.rstests (super::bitcode::Attrl.1768,super::shader::Shaderl.1919) — main already fails-D warningsthere (6 lints).bc0c72f50; lixonik retested74ac98c64on an RTX 5070. No game data in the diff.Verdict: leonida-shader part green (no red possible); leonida-gpu not buildable on macOS — needs a Windows/GPU verifier.
AI-assisted: Claude Code
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T22:58:14Z.
Verified by OreoFR (Windows part: leonida-gpu, plus leonida-shader's Windows-only tests; oreofr-mac covered leonida-shader on macOS)
PR head
74ac98c64merged withgit merge --no-ffonto main060c47160, no conflict. Windows 11 Pro 10.0.26300, RTX 4070 Laptop 8 GB (native mesh shaders), NVIDIA 621.40, Rust 1.98.1. The GPU is used by the D3D12 host tests.cargo test -p leonida-gpu --locked: 550 passed / 0 failed / 47 ignored (main 549/0/47). The new GPU testmesh_fallback::tests::mesh_runs_in_one_list_draw_their_own_groups_and_the_strip_after_them_its_stripruns and passes on the 4070.cargo test -p leonida-shader --lockedon Windows (where theemit::hostD3D12 tests also run): 372 passed / 0 failed / 4 ignored (main 368/0/4).mesh_fallback, a module the PR adds, so without the change it does not compile. The leonida-shader tests are inline in the modules they test, as noted for macOS.--all-targets, leonida-gpu): no new lint in the files the PR touches.eade9562c) rebase needed after this: no (git merge-treeis clean).Verdict: NO RED (green on Windows, no failing test possible without the change).
This verification was AI-assisted (Claude Code, oreofr-agent).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:47:20Z.
For information: this pull request is carried in #3128, which merges your head
74ac98c64(your commits are kept) into currentmainand resolves the conflicts in mod.rs, shader.rs, lower.rs, shader_cache.rs and pipeline/host.rs, keeping both sides. If you rebase this one yourself, say so and #3128 can be closed.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:29:09Z.
Verification triage of #2580
Head
74ac98c64: the PR conflicts withmain(dirty), and the work is carried by MoonEyes' #3128. Verdict: superseded by #3128.AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T18:02:22Z.
Thanks for the work on this. This pull request has a merge conflict with the current
mainand has had no new commit, comment or review for more than 5 hours, so I am closing it to keep the list of open pull requests manageable. This is not a judgement of the change. Whenever you like, merge the latestmaininto your branch, resolve the conflict, and reopen it (or open a new pull request that links this one). Please re-run the relevant tests on the new head; a reviewer will look at it when time allows, with no guarantee of timing or outcome.Generated by Claude Code
Pull request closed