- unsigned i, j;
- GLuint *group_ids;
- metrics_info_t *info = ¤t_context.metrics_info;
-
- glGetPerfMonitorGroupsAMD ((int *) &info->num_groups, 0, NULL);
-
- group_ids = xmalloc (info->num_groups * sizeof (GLuint));
-
- glGetPerfMonitorGroupsAMD (NULL, info->num_groups, group_ids);
-
- info->groups = xmalloc (info->num_groups * sizeof (metrics_group_info_t));
-
- for (i = 0; i < info->num_groups; i++)
- metrics_group_info_init (&info->groups[i], group_ids[i]);
-
- free (group_ids);
-
- /* Identify each shader stage (by looking at
- * performance-counter names for specific patterns) and
- * initialize structures referring to the corresponding
- * counter numbers for each stage. */
- info->num_shader_stages = 0;
- info->stages = NULL;
-
- for (i = 0; i < info->num_groups; i++) {
- metrics_group_info_t *group = &info->groups[i];
- for (j = 0; j < group->num_counters; j++) {
- char *name = group->counter_names[j];
- if (strstr (name, "Shader Active Time")) {
- _add_shader_stage (info, name, i, j,
- SHADER_ACTIVE);
- }
- if (strstr (name, "Shader Stall Time")) {
- _add_shader_stage (info, name, i, j,
- SHADER_STALL);
- }
- }
- }
-
- info->initialized = 1;
-}
-
-void
-metrics_info_fini (void)
-{
- context_t *ctx = ¤t_context;
- metrics_info_t *info = &ctx->metrics_info;
- unsigned i;