1 /* Copyright © 2013, Intel Corporation
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 #ifndef METRICS_INFO_H
23 #define METRICS_INFO_H
25 #include "fips-dispatch-gl.h"
27 typedef struct metrics_group_info
33 GLuint max_active_counters;
37 GLuint *counter_types;
39 } metrics_group_info_t;
41 typedef struct shader_stage_info
45 GLuint active_group_index;
46 GLuint active_counter_index;
48 GLuint stall_group_index;
49 GLuint stall_counter_index;
51 } shader_stage_info_t;
53 typedef struct metrics_info
58 bool printed_missing_perfmon_warning;
61 metrics_group_info_t *groups;
63 unsigned num_shader_stages;
64 shader_stage_info_t *stages;
68 /* Initialize metrics info
70 * This queries the names and ranges for all available performance counters.
72 * This should be called before any other metrics functions.
74 * The Boolean have_perfmon must be set to correctly indicate whether
75 * the current OpenGL context has the AMD_performance_monitor
79 metrics_info_init (metrics_info_t *info, bool have_perfmon);
81 /* Finalize metrics info state.
83 * The function should be called just before setting a new, current,
87 metrics_info_fini (metrics_info_t *info);