diff options
| author | QemmHD <stephenlethco2@gmail.com> | 2026-11-24 08:38:08 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-24 08:38:08 -0500 |
| commit | 47c6511747c93aa3fb908d7782ca96173d0eead3 (patch) | |
| tree | 28203b36ac5ae1f91eddf41594757eefc6fe9e5f /runtime/src/statistics_sum.comp | |
| parent | 3bb46d658b0c1c81a79091f6de933fba08d1af8a (diff) | |
| parent | 92977eee6c658d28a37f09615a7091afe26d61ff (diff) | |
Merge pull request #577 from Mby159/feature/d3d-mesh-clipping-counter
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 (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (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).
Diffstat (limited to 'runtime/src/statistics_sum.comp')
| -rw-r--r-- | runtime/src/statistics_sum.comp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/src/statistics_sum.comp b/runtime/src/statistics_sum.comp index 2478030d4..c4a02a459 100644 --- a/runtime/src/statistics_sum.comp +++ b/runtime/src/statistics_sum.comp | |||
| @@ -5,6 +5,8 @@ | |||
| 5 | // `mesh` segments come from the pool a mesh draw can run in (D3D-291), which counts only the fragment and compute | 5 | // `mesh` segments come from the pool a mesh draw can run in (D3D-291), which counts only the fragment and compute |
| 6 | // invocations: they are copied to counters 7 and 8 of their record, so PSInvocations takes the fragment one and | 6 | // invocations: they are copied to counters 7 and 8 of their record, so PSInvocations takes the fragment one and |
| 7 | // CSInvocations the compute one, and every other counter adds nothing. | 7 | // CSInvocations the compute one, and every other counter adds nothing. |
| 8 | // The clipping invocations of a mesh segment come from the mesh-primitives count of that segment, copied to | ||
| 9 | // counter 5 (D3D-MESH-CLIPPING-COUNTER); without that count the field stays 0. | ||
| 8 | layout(local_size_x = 11) in; | 10 | layout(local_size_x = 11) in; |
| 9 | layout(set = 0, binding = 0, std430) buffer QueryResults { | 11 | layout(set = 0, binding = 0, std430) buffer QueryResults { |
| 10 | uvec2 total[11]; | 12 | uvec2 total[11]; |
| @@ -15,7 +17,7 @@ layout(push_constant) uniform ResolveRange { uint count; uint mesh; }; | |||
| 15 | void main() { | 17 | void main() { |
| 16 | const uint counter = gl_LocalInvocationID.x; | 18 | const uint counter = gl_LocalInvocationID.x; |
| 17 | uvec2 sum = total[counter]; | 19 | uvec2 sum = total[counter]; |
| 18 | const bool counted = mesh == 0u || counter == 7u || counter == 10u; | 20 | const bool counted = mesh == 0u || counter == 5u || counter == 7u || counter == 10u; |
| 19 | const uint source = mesh != 0u && counter == 10u ? 8u : counter; | 21 | const uint source = mesh != 0u && counter == 10u ? 8u : counter; |
| 20 | for (uint i = 0; counted && i < count; ++i) { | 22 | for (uint i = 0; counted && i < count; ++i) { |
| 21 | uvec2 segment = segments[i * 11 + source]; | 23 | uvec2 segment = segments[i * 11 + source]; |