From 158a5862aeea9224fcd60c28b0bb19cb6b9f9381 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 30 Oct 2013 14:39:47 -0700 Subject: [PATCH] Collect any available results before switching contexts. Rather than missing out on any measured results by just throwing them away, we collect anything that is ready. This way, if any queries don't actually have results ready, we will throw those away, since we're not going to be able to get a meaningful result from them with the current context going away. --- metrics.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/metrics.c b/metrics.c index 4e67ab9..6e81fae 100644 --- a/metrics.c +++ b/metrics.c @@ -331,6 +331,8 @@ metrics_info_fini (void) if (! info->initialized) return; + metrics_collect_available (); + if (ctx->timer_begun_id) { glEndQuery (GL_TIME_ELAPSED); glDeleteQueries (1, &ctx->timer_begun_id); -- 2.43.0