summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/performance_monitor.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/main/performance_monitor.c b/src/mesa/main/performance_monitor.c
index 359727777ff..253d42d989c 100644
--- a/src/mesa/main/performance_monitor.c
+++ b/src/mesa/main/performance_monitor.c
@@ -480,14 +480,18 @@ _mesa_SelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable,
if (enable) {
/* Enable the counters */
for (i = 0; i < numCounters; i++) {
- ++m->ActiveGroups[group];
- BITSET_SET(m->ActiveCounters[group], counterList[i]);
+ if (!BITSET_TEST(m->ActiveCounters[group], counterList[i])) {
+ ++m->ActiveGroups[group];
+ BITSET_SET(m->ActiveCounters[group], counterList[i]);
+ }
}
} else {
/* Disable the counters */
for (i = 0; i < numCounters; i++) {
- --m->ActiveGroups[group];
- BITSET_CLEAR(m->ActiveCounters[group], counterList[i]);
+ if (BITSET_TEST(m->ActiveCounters[group], counterList[i])) {
+ --m->ActiveGroups[group];
+ BITSET_CLEAR(m->ActiveCounters[group], counterList[i]);
+ }
}
}
}