From: Carl Worth Date: Wed, 30 Oct 2013 21:39:47 +0000 (-0700) Subject: Collect any available results before switching contexts. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;ds=inline;h=158a5862aeea9224fcd60c28b0bb19cb6b9f9381;p=fips 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. --- 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);