i965: Add macros for creating performance monitor counters and groups.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 31 Oct 2013 22:50:19 +0000 (15:50 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Nov 2013 23:01:13 +0000 (15:01 -0800)
The Observability Architecture counters are 32-bit unsigned values, and
the Pipeline Statistics Register counters are 64-bit unsigned values.

These convenience macros make it easy to create those types of counters.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_performance_monitor.c

index c9673c55565c74cc1d465d09296693706759d0ab..a7a79ff8e3c1a833e773e98f681bcbed8c4618a4 100644 (file)
@@ -61,6 +61,32 @@ brw_perf_monitor(struct gl_perf_monitor_object *m)
 
 /******************************************************************************/
 
+#define COUNTER(name)           \
+   {                            \
+      .Name = name,             \
+      .Type = GL_UNSIGNED_INT,  \
+      .Minimum = { .u32 =  0 }, \
+      .Maximum = { .u32 = ~0 }, \
+   }
+
+#define COUNTER64(name)              \
+   {                                 \
+      .Name = name,                  \
+      .Type = GL_UNSIGNED_INT64_AMD, \
+      .Minimum = { .u64 =  0 },      \
+      .Maximum = { .u64 = ~0 },      \
+   }
+
+#define GROUP(name, max_active, counter_list)  \
+   {                                           \
+      .Name = name,                            \
+      .MaxActiveCounters = max_active,         \
+      .Counters = counter_list,                \
+      .NumCounters = ARRAY_SIZE(counter_list), \
+   }
+
+/******************************************************************************/
+
 static GLboolean brw_is_perf_monitor_result_available(struct gl_context *, struct gl_perf_monitor_object *);
 
 static void