-} context_t;
-
-/* FIXME: Need a map from integers to context objects and track the
- * current context with glXMakeContextCurrent, eglMakeCurrent, etc. */
-
-context_t current_context;
-
-int frames;
-int verbose;
-
-#define MAX_MONITORS_IN_FLIGHT 1000
-
-void
-metrics_collect_available (void);
-
-static void
-metrics_group_info_init (metrics_group_info_t *group, GLuint id)
-{
- GLsizei length;
- unsigned i;
-
- group->id = id;
-
- /* Get name */
- glGetPerfMonitorGroupStringAMD (id, 0, &length, NULL);
-
- group->name = xmalloc (length + 1);
-
- glGetPerfMonitorGroupStringAMD (id, length + 1, NULL, group->name);
-
- /* Get number of counters */
- group->num_counters = 0;
- group->max_active_counters = 0;
- glGetPerfMonitorCountersAMD (group->id,
- (int *) &group->num_counters,
- (int *) &group->max_active_counters,
- 0, NULL);
-
- /* Get counter numbers */
- group->counter_ids = xmalloc (group->num_counters * sizeof (GLuint));
-
- glGetPerfMonitorCountersAMD (group->id, NULL, NULL,
- group->num_counters,
- group->counter_ids);
-
- /* Get counter names */
- group->counter_names = xmalloc (group->num_counters * sizeof (char *));
- group->counter_types = xmalloc (group->num_counters * sizeof (GLuint));
-
- for (i = 0; i < group->num_counters; i++) {
- glGetPerfMonitorCounterInfoAMD (group->id,
- group->counter_ids[i],
- GL_COUNTER_TYPE_AMD,
- &group->counter_types[i]);
-
- glGetPerfMonitorCounterStringAMD (group->id,
- group->counter_ids[i],
- 0, &length, NULL);
-
- group->counter_names[i] = xmalloc (length + 1);
-
- glGetPerfMonitorCounterStringAMD (group->id,
- group->counter_ids[i],
- length + 1, NULL,
- group->counter_names[i]);
- }
-}