From 0b195cbffc54d937c4901f56b7eead5d27aff259 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Sat, 30 Nov 2013 11:47:03 +0100 Subject: [PATCH] Perftimer: Make GPU query count configurable --- src/perftimer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/perftimer.cpp b/src/perftimer.cpp index 5216104..a0cbfe9 100644 --- a/src/perftimer.cpp +++ b/src/perftimer.cpp @@ -86,9 +86,11 @@ struct TimerQuery bool TimerQuery::queryActive = false; +#define GPU_QUERIES 2 + struct GPUTimerGLQuery : public PerfTimer { - TimerQuery queries[2]; + TimerQuery queries[GPU_QUERIES]; const int iter; uint8_t ind; @@ -138,7 +140,8 @@ struct GPUTimerGLQuery : public PerfTimer void swapInd() { - ind = ind ? 0 : 1; + if (++ind > GPU_QUERIES) + ind = 0; } };