diff options
| author | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-23 15:47:22 +0000 |
|---|---|---|
| committer | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-23 15:47:22 +0000 |
| commit | b721585aae2efb5e78cf7ee2467fe8c4d5e0ca35 (patch) | |
| tree | 62803d5697e35182026fc910b64827a108ffc819 /runtime/src/statistics_sum.comp | |
| parent | c6f15b16283081c72123e61ca08cf5eb83e301e2 (diff) | |
| parent | 6de3970e15dc2ef8542ea1a289105736e2241624 (diff) | |
Merge remote-tracking branch 'origin/main' into exe/import-fail-fast
# Conflicts:
# docs/README.md
Diffstat (limited to 'runtime/src/statistics_sum.comp')
| -rw-r--r-- | runtime/src/statistics_sum.comp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/src/statistics_sum.comp b/runtime/src/statistics_sum.comp index e4e2ce13c..c4960347c 100644 --- a/runtime/src/statistics_sum.comp +++ b/runtime/src/statistics_sum.comp | |||
| @@ -2,18 +2,23 @@ | |||
| 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 | ||
| 6 | // compute: they are copied to counters 5..8 of their record, so CSInvocations sits at 8 and the input-assembly, | ||
| 7 | // vertex, geometry and tessellation counters (0..4, 8 and 9 of the D3D12 order) add nothing. | ||
| 5 | layout(local_size_x = 11) in; | 8 | layout(local_size_x = 11) in; |
| 6 | layout(set = 0, binding = 0, std430) buffer QueryResults { | 9 | layout(set = 0, binding = 0, std430) buffer QueryResults { |
| 7 | uvec2 total[11]; | 10 | uvec2 total[11]; |
| 8 | uvec2 segments[]; // `count` results of 11 counters each | 11 | uvec2 segments[]; // `count` results of 11 counters each |
| 9 | }; | 12 | }; |
| 10 | layout(push_constant) uniform ResolveRange { uint count; }; | 13 | layout(push_constant) uniform ResolveRange { uint count; uint mesh; }; |
| 11 | 14 | ||
| 12 | void main() { | 15 | void main() { |
| 13 | const uint counter = gl_LocalInvocationID.x; | 16 | const uint counter = gl_LocalInvocationID.x; |
| 14 | uvec2 sum = total[counter]; | 17 | uvec2 sum = total[counter]; |
| 15 | for (uint i = 0; i < count; ++i) { | 18 | const bool counted = mesh == 0u || (counter >= 5u && counter <= 7u) || counter == 10u; |
| 16 | uvec2 segment = segments[i * 11 + counter]; | 19 | const uint source = mesh != 0u && counter == 10u ? 8u : counter; |
| 20 | for (uint i = 0; counted && i < count; ++i) { | ||
| 21 | uvec2 segment = segments[i * 11 + source]; | ||
| 17 | uint low = sum.x + segment.x; | 22 | uint low = sum.x + segment.x; |
| 18 | sum.y += segment.y + uint(low < sum.x); | 23 | sum.y += segment.y + uint(low < sum.x); |
| 19 | sum.x = low; | 24 | sum.x = low; |