Skip to content

d3d12/vulkan: a mesh segment's clipping invocations come from a mesh-primitives query (D3D-MESH-CLIPPING-COUNTER) - #577

Merged
QemmHD merged 3 commits into
ProjectLeonida:mainfrom
Mby159:feature/d3d-mesh-clipping-counter
Nov 24, 2026
Merged

QemmHD merged 3 commits into
ProjectLeonida:mainfrom
Mby159:feature/d3d-mesh-clipping-counter

Conversation

@Mby159

@Mby159 Mby159 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: D3D-MESH-CLIPPING-COUNTER (#14)

Depends on: #540 (this is the follow-up that pull request asks for).

What and why

#540 leaves the clipping fields of a mesh segment at 0: VUID-vkCmdDrawMeshTasksEXT-pipelineStatistics-07076 forbids the
clipping counters in a pipeline-statistics pool that is active during a mesh draw, and Vulkan has no other counter for
them during one. D3D12 does count the clipping invocations and primitives of a mesh pipeline, so the two numbers differ.

Where the device has the meshShaderQueries feature of VK_EXT_mesh_shader, the number of primitives the mesh
shader emitted comes from a VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT query instead: a third pool of the
submission, begun and ended with each mesh segment, next to the two the statistics split needs. Its count is copied to
field 5 of the segment's record and statistics_sum.comp adds it as CInvocations. CPrimitives stays 0, because
Vulkan has no clipped-primitive counter and D3D12's CPrimitives is the clipper's output: 0 when a triangle is
dropped, 2 when it is split.

This is the addition milk4sale describes in
#14, measured on an RTX 4070 Ti and
cross-checked by sodove against native D3D12 on the RTX 5070 Ti
(#14). The three questions asked on
#540 are answered:

  • The count goes into CInvocations only. CPrimitives stays 0: the clipper's output is not a number Vulkan keeps
    for a mesh draw.
  • Where the device has no meshShaderQueries, the fields stay 0, as in d3d12/vulkan: the mesh statistics pool enables no forbidden counter (D3D-291) #540. The feature is asked for when the
    device is created, and the pool is only made where the device has it.
  • A third per-submission pool of that query type, begun and ended with each mesh segment, with the count added as
    field 5 in statistics_sum.comp.

One divergence to document: Vulkan counts a primitive the mesh shader culled with gl_CullPrimitiveEXT, which D3D12
does not count, so the CInvocations of a mesh segment can be higher than D3D12's. Both measurements above show it.

What changed

  • runtime/src/vulkan_replay.h: the segment pool keeps the mesh-primitives pool, the prepared list and the resolve
    run carry it, and a mesh segment begins and ends that query with its statistics segment.
  • runtime/src/vulkan_backend.h: the third pool is made where the device has the feature, and the sum copies its
    count into the clipping-invocations field. A mesh chunk is cleared first, so the field reads 0 where the device has
    no mesh-primitives count.
  • runtime/src/statistics_sum.comp and the regenerated runtime/src/statistics_sum_spirv.h: a mesh segment adds
    field 5 as well. The module is regenerated with glslang 16.6.0, the version the CI pins, with the command its
    header names; the ID numbering differs slightly from the build it replaces, the code is the same apart from that one
    condition.
  • runtime/shims/d3d12_com.h, runtime/shims/d3d12_vulkan_device.cpp: the device enables the
    meshShaderQueries feature where the GPU has it, and the layer is told.
  • runtime/test/vk_test_device.h: the test device enables the same feature.
  • runtime/test/replay_query_predication_test.cpp, runtime/test/replay_query_edges_test.cpp: the resolve plan
    carries the pool, and the mesh sum through the CPU mocks fills CInvocations, PSInvocations and
    CSInvocations.
  • runtime/test/d3d12_mesh_test.cpp: the mesh statistics expectations follow the feature; the counts are compared
    with each other, not written down, because how many primitives reach the fragment shader is the driver's.
  • docs/d3d12_vulkan.md: the new paragraph.

Tested

  • ctest --test-dir runtime/build -C Release: 72 of 72 tests passed (2 skipped: shader_library_corpus needs the
    game's shaders, vk_sync_validation needs a device with the feature). Built with clang 23.1.6 (llvm-mingw
    20261117) against the pinned Vulkan headers (6802bb47, vulkan-sdk-1.4.363.0).
  • replay_query_edges_test runs the mesh sum through the CPU mocks: the mesh segment is read from the mesh pool and
    the mesh-primitives pool, and it fills CInvocations, PSInvocations and CSInvocations and no other field.
  • replay_query_predication_test checks that the resolve plan hands the mesh-primitives pool to the sum.
  • python -I scripts/check_no_game_data.py <the eleven changed files>: passes.
  • The regenerated SPIR-V passes spirv-val.

The GPU half is not run here: this machine's Radeon 780M is RDNA3, which has no mesh shader support, so the
mesh-primitives query cannot be created on it and d3d12_mesh_test cannot run. sodove offered the RTX 5070 Ti under
the Khronos validation layer, and milk4sale the RTX 4070 Ti; the test compares the counts with each other rather
than writing driver-dependent numbers down, so the run confirms the wiring and the field, not an exact count. A run
with the feature disabled is the other half of the check: the fields must read 0 there.

GPUs tested: n/a on this host.

AI-assisted: yes.

Checklist

@Mby159

Mby159 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

This is the follow-up to #540, stacked on its head: until #540 merges, the diff here shows both changes (the branch is c9f4a569 plus this commit). The branch itself is one commit on top of #540.

Three things to make the design explicit, answering the questions asked on #540:

  • The count goes into CInvocations only. CPrimitives stays 0: Vulkan keeps no clipped-primitive counter, and D3D12's CPrimitives is the clipper's output (0 when a triangle is dropped, 2 when it is split). The generated count is 1 in both of those cases.
  • Where the device has no meshShaderQueries, the fields stay 0, as in d3d12/vulkan: the mesh statistics pool enables no forbidden counter (D3D-291) #540. The feature is asked for when the device is created, and the third pool is only made where the device has it.
  • A third per-submission pool of that query type, begun and ended with each mesh segment, and the count added as field 5 of the segment's record, which statistics_sum.comp adds as CInvocations.

One divergence, which the documentation now states: Vulkan counts a primitive the mesh shader culled with gl_CullPrimitiveEXT, which D3D12 does not count, so a mesh segment's CInvocations can be higher than D3D12's. milk4sale's table and sodove's cross-API comparison both show it.

The GPU half is what is missing here. This machine's Radeon 780M is RDNA3, which has no mesh shader support, so the mesh-primitives query cannot be created on it and d3d12_mesh_test cannot run. The test compares the counts with each other rather than writing driver-dependent numbers down, so the run confirms the wiring and the field, not an exact count. The other half is a device without the feature: the fields must read 0 there.

sodove offered the RTX 5070 Ti under the Khronos validation layer, and milk4sale the RTX 4070 Ti. Either would do; say here and I will hand the GPU runs over instead.

What ran here: ctest --test-dir runtime/build -C Release on the delivered tree (upstream d42773d0 plus #540 plus this change), 71 of 72 passed and 2 skipped; the one failure is vk_queue_query_sync, which fails the same way on the unmodified d42773d0 tree (4 of 5 runs), so it is not this change. replay_query_edges_test runs the mesh sum through the CPU mocks and checks that the mesh segment is read from the mesh pool and the mesh-primitives pool, and that it fills CInvocations, PSInvocations and CSInvocations. replay_query_predication_test checks that the resolve plan hands the pool to the sum. The semantic suite: 465 files, 6105 tests, 0 files failed. check_no_game_data.py passes on all eleven changed files, and the regenerated SPIR-V passes spirv-val.

AI-assisted: yes.

@Mby159

Mby159 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Note on the duplicate: #575 is the same work, published a moment earlier from a session whose state was lost. It is closed in favour of this one. It never asks for the meshShaderQueries feature, so context_.mesh_queries would stay false and the third pool would never be made, and its d3d12_mesh_test.cpp reads a member the branch does not add, so it does not build. The three files that fix that are here: the feature is asked for when the device is created (runtime/shims/d3d12_vulkan_device.cpp, runtime/shims/d3d12_com.h) and the test device enables it (runtime/test/vk_test_device.h).

Review this pull request.

@sodove

sodove commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Windows GPU verification of exact head 62c8311 on RTX 5070 Ti (610.74), MSVC Release and Khronos validation 1.4.369. The stock mesh test and both replay-query tests passed (3/3). The mesh test matched all 4,096 pixels, with zero validation errors.

I also printed the counters from the stock synthetic draw with a test-only change. With meshShaderQueries enabled, the mesh-only CInvocations was 8, the mixed result after subtracting its vertex-only contribution was 10, and mesh CPrimitives was 0. With the feature disabled at Vulkan device creation, all three counters were 0. Both runs again matched 4,096 pixels and had zero validation errors.

One test gap showed up in a negative control. I left the Vulkan feature enabled and passed false only in the layer's test device options. The stock enabled-feature assertion still passed with both invocation counts at zero. Asserting a positive mesh-only count for this visible synthetic draw would catch that loss of wiring while keeping the exact count driver-independent.

AI-assisted, synthetic tests only.

@Mby159

Mby159 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@sodove your negative control found a real gap in the test, and it is fixed in 972a1e47 (parent 62c8311, the head you verified).

What the control showed: with the layer reporting the feature but the mesh-primitives pool never created, both counts stay at 0 and the enabled-feature assertion still held, because it compared 0 >= 0. The enabled branch now asks for a positive count:

if (d.mesh_shader_queries) {
    EXPECT(mesh_clipping >= mesh_only.CInvocations);
    EXPECT(mesh_only.CInvocations > 0);
} else {
    EXPECT(mesh_clipping == 0);
}

mesh_only is query 1, the DispatchMesh(2, 2, 1) draw whose red tint fills the top-left quadrant, so the mesh shader emits at least one primitive on any correct driver. The number stays driver-dependent, so the test asks for a positive count and not for a number. The disabled case is unchanged and stays pinned at zero (mesh_clipping == 0 and mesh_only.CInvocations == 0).

Your numbers are consistent with this: mesh-only CInvocations was 8, and the mixed range's mesh share was 10, which is the DispatchMesh(2, 2) draw plus the DispatchMesh(1, 1) one.

This is a test-only change, so the implementation is exactly the head you verified. The new head is 972a1e47 - could you re-run the mesh test on it, so the pull request carries a verification of the exact head?

Local verification is limited, and I want to be exact about it: this machine's GPU has no VK_EXT_mesh_shader, so the mesh block is skipped here, and the file does not compile here at all - the repository's d3d12_com.h wants the SDK's d3d12.h and MinGW's is older (ID3D12GraphicsCommandList8 and D3D12_RASTERIZER_DESC2 are missing), so the file needs the CI Windows build. The added block was compiled on its own with -Wall -Wextra -Wsign-compare and is clean, and python -I scripts/check_no_game_data.py on the file passes.

AI-assisted (MiniMax Code).

@sodove

sodove commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

@Mby159 Confirmed on exact head 972a1e47: the stock d3d12_mesh test built with MSVC Release and passed on the RTX 5070 Ti (610.74), matching 4,096 pixels under Khronos validation 1.4.369 with zero validation errors.

The same test-only probe still reports 8 mesh-only clipping invocations and 10 mesh invocations added to the mixed range. Disabling the device feature gave zero and passed. Keeping it enabled on the device but disconnecting only the layer option now fails specifically at mesh_only.CInvocations > 0 with no validation errors. The new assertion catches the missing wiring.

AI-assisted, synthetic tests only.

@Mby159
Mby159 force-pushed the feature/d3d-mesh-clipping-counter branch from 972a1e4 to 5c79367 Compare November 24, 2026 12:34
…primitives query (D3D-MESH-CLIPPING-COUNTER)

Where the device has the meshShaderQueries feature of VK_EXT_mesh_shader, the number of
primitives the mesh shader emitted comes from a VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT
query run around each mesh segment, and it is added as the clipping invocations of that
segment. CPrimitives stays 0: Vulkan has no clipped-primitive counter, and D3D12's
CPrimitives is the clipper's output.

Claim: D3D-MESH-CLIPPING-COUNTER
Depends on: ProjectLeonida#540
sodove's negative control on this head showed the gap: with the layer reporting the feature but the
mesh-primitives pool never created, both counts stay at 0 and the enabled-feature assertion still held,
because it compared 0 >= 0. The count has to be positive to show the wiring is there. How many primitives
the mesh shader emits is the driver's, so the test asks for a positive count and not for a number.

The disabled case stays pinned at zero. AI-assisted.
@Mby159
Mby159 force-pushed the feature/d3d-mesh-clipping-counter branch from 5c79367 to 92977ee Compare November 24, 2026 12:35
@Mby159

Mby159 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main at 21625bca8 together with #540: new head 92977eee (parent 1bb23a28 = #540's new head 916dbc61). The three commits are the same three - d3d12/vulkan: the mesh statistics pool enables no forbidden counter, d3d12/vulkan: a mesh segment's clipping invocations come from a mesh-primitives query, tests: require a positive mesh clipping count when the feature is on - and the diff against main is the same eleven files and the same +289/-98 as on 972a1e47.

Why now. The base this pull request carried (7430f59b) is old enough that tests/test_cmake_translator_deps.py fails on the test merge, for a reason that has nothing to do with this change: build.py reaches tools/rdna2_isa_tables.py and tools/rdna2_decode.py, and the dependency list the test compares against was updated on main afterwards. main passes that test today; the test merge of this pull request did not.

The verification still applies. @sodove's negative-control run was on 972a1e47: the same content now sits on 92977eee, including the mesh_only.CInvocations > 0 assertion that the control trips, and the counts it measured - 8 mesh-only clipping invocations, 10 in the mixed range, 0 with the device feature off - are unchanged by the rebase.

What stays red, and why. macos and linux-gpu-tools fail on cs_imgload_tfe and cs_imgload_d16_tfe, the two shaders main fails as well (#31). The Windows job's crt_timed_wait is a timing-sensitive test, and the same job passed on #540's head minutes earlier.

QemmHD added a commit that referenced this pull request Nov 24, 2026
Merging.

**Why merged:** Indexes the DXBC identities the Xbox native graphics pipelines use, which the native-PSO path needs. The earlier hold (new tool not listed as a translator input) is fixed in 62a9588: native_pso_hashes is now in translator_deps.cmake, make_game.py's translation sources and runtime.yml.

**Why it's good:** Security read of the three-dot diff: tools and tests only, no binaries, downloads or network calls. The PR's own tests: 129 passed. The consistency set, which caught the missing input registration last time, is clean now.

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bc or 51f3160) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c24 (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD added a commit that referenced this pull request Nov 24, 2026
Merging.

**Why merged:** Adds the named NonSemantic.Shader.DebugInfo.100 instruction table so SPIR-V debug instructions disassemble by name. Oliwettoo checked that the table matches SPIRV-Headers' grammar exactly (44 names).

**Why it's good:** Data table plus tests only. Its tests: 47 passed. No behaviour change for shaders without debug info.

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bc or 51f3160) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c24 (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD added a commit that referenced this pull request Nov 24, 2026
Merging.

**Why merged:** manifest_verifier refuses a --cache path that aliases the input manifest (another spelling, a hard link, a symlink or a case alias), which would otherwise overwrite the manifest: a real data-loss guard. Reviewed as good by Oliwettoo.

**Why it's good:** Its tests: 82 passed, 4 skipped. It merges cleanly together with #346, which touches the same tool; the cumulative run includes both. Note from Oliwettoo: this conflicts with #344, which will need a rebase.

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bc or 51f3160) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c24 (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD added a commit that referenced this pull request Nov 24, 2026
Merging.

**Why merged:** manifest_verifier also protects every file the manifest lists from being overwritten by cache writes (the companion to #334). Reviewed as good by Oliwettoo.

**Why it's good:** Its tests: 83 passed, 4 skipped, on its own and stacked with #334.

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bc or 51f3160) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c24 (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD added a commit that referenced this pull request Nov 24, 2026
Merging.

**Why merged:** CI-only: a hung Windows runtime test now fails on its own (per-test ctest --timeout 300, TIMEOUT 180 on the loader test) instead of cancelling the whole job, and the job limit goes from 20 to 35 minutes. Each value is explained in a comment. Reviewed as good by Oliwettoo.

**Why it's good:** Workflow change with no new permissions, actions or downloads. The local tests it touches: 87 passed, 9 skipped. The runner-side effect can only be seen in CI, but there's nothing risky in it: the timeouts only turn hangs into failures.

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bc or 51f3160) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c24 (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD added a commit that referenced this pull request Nov 24, 2026
Merging.

**Why merged:** d3d12_xs_surface SDK discovery skips a Windows Kits version folder that lacks um/d3d12.h (a WDK-only folder), while an explicit WINDOWS_SDK_INCLUDE/SDK_INCLUDE is still taken as given. Reviewed as good by Oliwettoo.

**Why it's good:** Its tests: 18 passed, 1 skipped. The runtime build on this machine is unaffected (same ctest).

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bc or 51f3160) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c24 (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD added a commit that referenced this pull request Nov 24, 2026
Merging.

**Why merged:** stale_build follows includes through the CMake include directories, so a header change in another include dir correctly marks a target stale. Dezmonius independently re-checked the fixed head; the "six failures" he first reported were the new tests running against the old implementation, which is expected.

**Why it's good:** Its tests: 55 passed, 8 skipped, and on current main with main's new tests/test_stale_build.py: 26/26.

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bc or 51f3160) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c24 (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD added a commit that referenced this pull request Nov 24, 2026
Merging.

**Why merged:** Fixes the mesh half of #506: the statistics pool active during vkCmdDrawMeshTasksEXT no longer enables the two clipping counters that VUID-vkCmdDrawMeshTasksEXT-pipelineStatistics-07076 forbids. Verified on an RTX 5070 Ti (sodove), RTX 4080 (quartz-heron-58) and RX 7900 XTX (bvtterbroot), all with validation on; the rebase to 916dbc6 is byte-identical (range-diff checked). Merged on its own first because #577 is stacked on it.

**Why it's good:** On the 4070 SUPER with LEONIDA_VK_VALIDATION=1: plain main fails d3d12_mesh with 3x VUID-...-07076; main + #540 + #577 passes d3d12_mesh, replay_query_edges and replay_query_predication with 0 validation errors, and the counters match sodove's numbers (mesh-only C 8/0, PS 1024).

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bc or 51f3160) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c24 (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).
@QemmHD

QemmHD commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Merging.

Why merged: Stacked on #540: the clipping invocations of a mesh segment now come from a mesh-pipeline query, so CInvocations/CPrimitives stay correct for mixed vertex + mesh work. sodove verified the exact head, including the disconnected-feature negative control that found (and now proves fixed) a gap in the test.

Why it's good: The embedded SPIR-V in statistics_sum_spirv.h was recompiled from the PR's .comp: all 431 words are identical and spirv-val passes. d3d12_mesh with validation: 0 errors, mixed C 12 vs vertex-only C 2, so the mesh share is 10, as expected.

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bc or 51f3160) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c24 (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).

@QemmHD
QemmHD merged commit 47c6511 into ProjectLeonida:main Nov 24, 2026
7 of 12 checks passed
Taffyyy-ops added a commit to Taffyyy-ops/leonida that referenced this pull request Nov 24, 2026
…_cache_seed test (RT-PIPELINE-CACHE-SEED)

Restores the vk_pipeline_check / runtime Vulkan device cache-key parity fix from
ancestor commit c8a102d (Senne Cools), which had been dropped in bulk merge
6dece92, and extends it for NVIDIA Blackwell (RTX 5060, driver 621.24) + ProjectLeonida#577:

- Disable robustBufferAccess, scalarBlockLayout and robustImageAccess on
  vk_pipeline_check's VkDevice to match create_vulkan_device_standalone.
- Always enable VK_EXT_mesh_shader and VK_KHR_maintenance8 when supported
  (rather than only when selected shaders request them) and keep
  meshShaderQueries as supported (matching ProjectLeonida#577 in d3d12_vulkan_device.cpp),
  because NVIDIA hashes both into pipeline cache keys even for compute shaders.
- Restore and register the pipeline_cache_seed CTest with a self-contained
  pipeline_cache_seed_test that embeds a minimal synthetic compute SPIR-V module
  (no glslangValidator required) and runs vk_pipeline_check under its own exe
  filename.
- Update docs/pipeline_check.md ("The cache and the runtime's device").

AI-assisted: yes
demoz53 added a commit to demoz53/leonida that referenced this pull request Nov 24, 2026
Brings 58 PRs integration did not have (among them ProjectLeonida#359 ProjectLeonida#360 ProjectLeonida#402 ProjectLeonida#497 ProjectLeonida#557 ProjectLeonida#558
ProjectLeonida#560 ProjectLeonida#561 ProjectLeonida#572 ProjectLeonida#573 ProjectLeonida#574 ProjectLeonida#577) and the newer heads of ProjectLeonida#401 and ProjectLeonida#404. 15 files
conflicted; resolved by hand:

- frame_pacer.h, d3d12_xs_device.h/.cpp: ProjectLeonida#402's pacer (per-event ticks,
  issue_token_locked) now issues from ProjectLeonida#414's shared FrameTokenSource, so a token
  from the device-side WaitFrameEventX is one the pacer accepts (towade's ProjectLeonida#14
  finding: without it every PresentX is refused). The dead frame_next_token and
  issued_ counters are dropped. Queue slot 32 stays ProjectLeonida#414's PresentX; ProjectLeonida#402's
  presentation-handler routes serve slot 30 or LEONIDA_XS_PRESENT_X_SLOT.
  ProjectLeonida#402's GetFrameStatisticsX route moves into ProjectLeonida#385's route_xbox_device_slot.
- acphal.cpp/acphal_test.cpp: upstream's reworked SHAPE allocation and release;
  the release writes nothing through its first argument, as ProjectLeonida#405 requires; both
  sides' tests kept. Upstream's ProjectLeonida#401/ProjectLeonida#404 heads remove lifecycle.cpp and the C++
  xma2_decoder.cpp (replaced by runtime/xma_decoder), so build_runtime.ps1's
  cl.exe list drops them and keeps ProjectLeonida#549's and ProjectLeonida#400's files.
- vulkan_backend.h, statistics_sum.comp, its SPIR-V header, d3d12_mesh_test,
  replay_query_edges_test, d3d12_vulkan_device.cpp, docs: ProjectLeonida#577's clipping
  counter on top of ProjectLeonida#540, which both sides carry; the Timestamps sentence keeps
  integration's corrected wording (c33ce87).
- xs_proxy_mock_test.cpp: both sides' cases; pr_conflict_label.py keeps the
  guarded reconfigure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants