#version 450 // Adds the D3D12_QUERY_DATA_PIPELINE_STATISTICS segments of one split pipeline-statistics query (D3D-162): one // invocation per counter, in the order of VkQueryPipelineStatisticFlagBits, which is the D3D12 field order. layout(local_size_x = 11) in; layout(set = 0, binding = 0, std430) buffer QueryResults { uvec2 total[11]; uvec2 segments[]; // `count` results of 11 counters each }; layout(push_constant) uniform ResolveRange { uint count; }; void main() { const uint counter = gl_LocalInvocationID.x; uvec2 sum = total[counter]; for (uint i = 0; i < count; ++i) { uvec2 segment = segments[i * 11 + counter]; uint low = sum.x + segment.x; sum.y += segment.y + uint(low < sum.x); sum.x = low; } total[counter] = sum; }