]> git.cworth.org Git - fips/blob - metrics-info.h
Add explicit link to libpthread, to work around debugging issues
[fips] / metrics-info.h
1 /* Copyright © 2013, Intel Corporation
2  *
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:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
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
19  * THE SOFTWARE.
20  */
21
22 #ifndef METRICS_INFO_H
23 #define METRICS_INFO_H
24
25 #include "fips-dispatch-gl.h"
26
27 typedef struct metrics_group_info
28 {
29         GLuint id;
30         char *name;
31
32         GLuint num_counters;
33         GLuint max_active_counters;
34
35         GLuint *counter_ids;
36         char **counter_names;
37         GLuint *counter_types;
38
39 } metrics_group_info_t;
40
41 typedef struct shader_stage_info
42 {
43         char *name;
44
45         GLuint active_group_index;
46         GLuint active_counter_index;
47
48         GLuint stall_group_index;
49         GLuint stall_counter_index;
50
51 } shader_stage_info_t;
52
53 typedef struct metrics_info
54 {
55         int initialized;
56
57         bool have_perfmon;
58
59         unsigned num_groups;
60         metrics_group_info_t *groups;
61
62         unsigned num_shader_stages;
63         shader_stage_info_t *stages;
64
65 } metrics_info_t;
66
67 /* Initialize metrics info
68  *
69  * This queries the names and ranges for all available performance counters.
70  *
71  * This should be called before any other metrics functions.
72  *
73  * The Boolean have_perfmon must be set to correctly indicate whether
74  * the current OpenGL context has the AMD_performance_monitor
75  * extension.
76  */
77 void
78 metrics_info_init (metrics_info_t *info, bool have_perfmon);
79
80 /* Finalize metrics info state.
81  *
82  * The function should be called just before setting a new, current,
83  * OpenGL context.
84  */
85 void
86 metrics_info_fini (metrics_info_t *info);
87
88 #endif