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:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 18:48:12 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 18:48:12 -0500
commitfb2afdccc2314d7b5a59fac10e6d6df7f5df35ab (patch)
tree9e0b7e2e39b42823f148d135ce781e57fab52155 /runtime/src/statistics_sum.comp
parent862890c893eb19eb39eb2fd95e7786e42ff4b18c (diff)
parent864337351bc11a250db77c2fcdd3ba6f1d0f455f (diff)
Merge main into RT-QUEUE18 (#403)
Merged on top of the merge made for #396 (main 507029d1e plus RT-QUEUE35, RT-ALLOC9 and RT-LIST139). No conflicts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/statistics_sum.comp')
-rw-r--r--runtime/src/statistics_sum.comp10
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/src/statistics_sum.comp b/runtime/src/statistics_sum.comp
index c4960347c..c4a02a459 100644
--- a/runtime/src/statistics_sum.comp
+++ b/runtime/src/statistics_sum.comp
@@ -2,9 +2,11 @@
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.
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.
8layout(local_size_x = 11) in; 10layout(local_size_x = 11) in;
9layout(set = 0, binding = 0, std430) buffer QueryResults { 11layout(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; };
15void main() { 17void 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 >= 5u && 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];