upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/statistics_sum.comp
diff options
context:
space:
mode:
authorQemmHD <stephenlethco2@gmail.com>2026-11-24 08:37:58 -0500
committerGitHub <noreply@github.com>2026-11-24 08:37:58 -0500
commit3bb46d658b0c1c81a79091f6de933fba08d1af8a (patch)
treefdf7ae6f94fd8fd38809042a110834db30b54580 /runtime/src/statistics_sum.comp
parent5435a765b14512ae462be6193efac006149b1d20 (diff)
parent916dbc619df63fb169cf5e587f4d53d8884eaccd (diff)
Merge pull request #540 from Mby159/d3d-291-mesh-statistics
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 916dbc619 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 (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.comp8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/src/statistics_sum.comp b/runtime/src/statistics_sum.comp
index c4960347c..2478030d4 100644
--- a/runtime/src/statistics_sum.comp
+++ b/runtime/src/statistics_sum.comp
@@ -2,9 +2,9 @@
2 2
3// Adds the D3D12_QUERY_DATA_PIPELINE_STATISTICS segments of one split pipeline-statistics query (D3D-162): one 3// Adds the D3D12_QUERY_DATA_PIPELINE_STATISTICS segments of one split pipeline-statistics query (D3D-162): one
4// invocation per counter, in the order of VkQueryPipelineStatisticFlagBits, which is the D3D12 field order. 4// invocation per counter, in the order of VkQueryPipelineStatisticFlagBits, which is the D3D12 field order.
5// `mesh` segments come from the pool a mesh draw can run in (D3D-291), which counts only clipping, fragment and 5// `mesh` segments come from the pool a mesh draw can run in (D3D-291), which counts only the fragment and compute
6// compute: they are copied to counters 5..8 of their record, so CSInvocations sits at 8 and the input-assembly, 6// invocations: they are copied to counters 7 and 8 of their record, so PSInvocations takes the fragment one and
7// vertex, geometry and tessellation counters (0..4, 8 and 9 of the D3D12 order) add nothing. 7// CSInvocations the compute one, and every other counter adds nothing.
8layout(local_size_x = 11) in; 8layout(local_size_x = 11) in;
9layout(set = 0, binding = 0, std430) buffer QueryResults { 9layout(set = 0, binding = 0, std430) buffer QueryResults {
10 uvec2 total[11]; 10 uvec2 total[11];
@@ -15,7 +15,7 @@ layout(push_constant) uniform ResolveRange { uint count; uint mesh; };
15void main() { 15void main() {
16 const uint counter = gl_LocalInvocationID.x; 16 const uint counter = gl_LocalInvocationID.x;
17 uvec2 sum = total[counter]; 17 uvec2 sum = total[counter];
18 const bool counted = mesh == 0u || (counter >= 5u && counter <= 7u) || counter == 10u; 18 const bool counted = mesh == 0u || counter == 7u || counter == 10u;
19 const uint source = mesh != 0u && counter == 10u ? 8u : counter; 19 const uint source = mesh != 0u && counter == 10u ? 8u : counter;
20 for (uint i = 0; counted && i < count; ++i) { 20 for (uint i = 0; counted && i < count; ++i) {
21 uvec2 segment = segments[i * 11 + source]; 21 uvec2 segment = segments[i * 11 + source];