summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2015-12-12 15:20:33 -0500
committerNicolai Hähnle <[email protected]>2015-12-15 11:23:40 -0500
commit819543adb44b9ef8e6ea337f1afdc3d109d7e388 (patch)
tree244f59b77dbe2d2fadba6ac70551ac8020771c00
parent9c0773958e0df2bc8f2e2a50eaad49f1593d115e (diff)
mesa/main: use BITSET_FOREACH_SET in perf_monitor_result_size
This should make the code both faster and slightly clearer. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
-rw-r--r--src/mesa/main/performance_monitor.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mesa/main/performance_monitor.c b/src/mesa/main/performance_monitor.c
index 98dfbea083c..43529b2b35a 100644
--- a/src/mesa/main/performance_monitor.c
+++ b/src/mesa/main/performance_monitor.c
@@ -591,11 +591,10 @@ perf_monitor_result_size(const struct gl_context *ctx,
for (group = 0; group < ctx->PerfMonitor.NumGroups; group++) {
const struct gl_perf_monitor_group *g = &ctx->PerfMonitor.Groups[group];
- for (counter = 0; counter < g->NumCounters; counter++) {
- const struct gl_perf_monitor_counter *c = &g->Counters[counter];
+ BITSET_WORD tmp;
- if (!BITSET_TEST(m->ActiveCounters[group], counter))
- continue;
+ BITSET_FOREACH_SET(counter, tmp, m->ActiveCounters[group], g->NumCounters) {
+ const struct gl_perf_monitor_counter *c = &g->Counters[counter];
size += sizeof(uint32_t); /* Group ID */
size += sizeof(uint32_t); /* Counter ID */