summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2015-11-12 12:02:44 +0100
committerNicolai Hähnle <[email protected]>2015-11-20 17:27:18 +0100
commitafa6121b4ef2d249004cff0bb40237c71c61946d (patch)
tree4c66eedf569bee7dac9ce8d757bb96ae02df8ff3 /src/mesa/state_tracker
parent0aea83dc4ad8826648be7b400553083e0aeac004 (diff)
st/mesa: use BITSET_FOREACH_SET to loop through active perfmon counters
Reviewed-by: Samuel Pitoiset <[email protected]> Tested-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_perfmon.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_cb_perfmon.c b/src/mesa/state_tracker/st_cb_perfmon.c
index 80ff1706966..ec12eb22206 100644
--- a/src/mesa/state_tracker/st_cb_perfmon.c
+++ b/src/mesa/state_tracker/st_cb_perfmon.c
@@ -50,6 +50,7 @@ init_perf_monitor(struct gl_context *ctx, struct gl_perf_monitor_object *m)
for (gid = 0; gid < ctx->PerfMonitor.NumGroups; gid++) {
const struct gl_perf_monitor_group *g = &ctx->PerfMonitor.Groups[gid];
const struct st_perf_monitor_group *stg = &st->perfmon[gid];
+ BITSET_WORD tmp;
if (m->ActiveGroups[gid] > g->MaxActiveCounters) {
/* Maximum number of counters reached. Cannot start the session. */
@@ -60,14 +61,10 @@ init_perf_monitor(struct gl_context *ctx, struct gl_perf_monitor_object *m)
return false;
}
- for (cid = 0; cid < g->NumCounters; cid++) {
- const struct gl_perf_monitor_counter *c = &g->Counters[cid];
+ BITSET_FOREACH_SET(cid, tmp, m->ActiveCounters[gid], g->NumCounters) {
const struct st_perf_monitor_counter *stc = &stg->counters[cid];
struct st_perf_counter_object *cntr;
- if (!BITSET_TEST(m->ActiveCounters[gid], cid))
- continue;
-
cntr = CALLOC_STRUCT(st_perf_counter_object);
if (!cntr)
return false;