From 583e41faf104e7a7ee168761361c8c64aa3c5462 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 23 Oct 2013 12:38:37 -0700 Subject: [PATCH] Fix conversion from group IDs to group array indices. The loop that found the array index for a particular group based on the group ID had a subtle bug: it compared against "i" instead of group_id. In the i965 implementation, the first group happens to have ID 0, which meant that the loop would always select the first group (since the ID equals the array index). This led to assertion failures about the number of counters in each group. Signed-off-by: Kenneth Graunke --- metrics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics.c b/metrics.c index 2ed90d6..d9dd3a0 100644 --- a/metrics.c +++ b/metrics.c @@ -532,7 +532,7 @@ accumulate_program_metrics (metrics_op_t op, GLuint *result, GLuint size) CONSUME (value); for (i = 0; i < info->num_groups; i++) { - if (info->groups[i].id == i) + if (info->groups[i].id == group_id) break; } group_index = i; -- 2.43.0