]> git.cworth.org Git - fips/commitdiff
Fix conversion from group IDs to group array indices.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 23 Oct 2013 19:38:37 +0000 (12:38 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 23 Oct 2013 20:00:56 +0000 (13:00 -0700)
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 <kenneth@whitecape.org>
metrics.c

index 2ed90d6b33538bd2cb921b47664e4b086c6b3eaf..d9dd3a0b3faef6ff600f6a6a487c9f639def47ec 100644 (file)
--- 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;