diff options
| author | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-23 16:10:41 +0000 |
|---|---|---|
| committer | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-23 16:10:41 +0000 |
| commit | fc7d1f514d9d73c7366336c1e7adbdf5c689dfa0 (patch) | |
| tree | e46dc95057c9b935804d172c132e5ea4976a373d /runtime/src/statistics_sum.comp | |
| parent | 279898ee6ce736d77e03ca81eeeacde31f4f4f9f (diff) | |
| parent | 8575d36edc479218972497a7bded8651a42856c0 (diff) | |
Merge origin/main into test/877b-shader-programs-validation
Conflicts in vk_store_test.cpp and vk_texture_test.cpp: both new includes (vk_validation.h and spirv_capability.h) are kept.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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; |