summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2017-01-24 02:07:43 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2017-01-24 02:07:43 +0200
commitf77a40519f5b40aa29dbf3f8d857001b7cd9e848 (patch)
tree81fdbb1ec0e64d221ba983df34c27bbe9720b67d
parentdf6ec90e48c80b981cd80adf1eeaebb09c28f981 (diff)
Add performance warning
-rw-r--r--glcapture.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/glcapture.c b/glcapture.c
index d7b4a78..99db7eb 100644
--- a/glcapture.c
+++ b/glcapture.c
@@ -468,6 +468,8 @@ draw_indicator(const GLint view[4])
static void
swap_buffers(void)
{
+ const uint64_t start = get_time_ns();
+
void* (*procs[])(const char*) = {
(void*)_eglGetProcAddress,
(void*)_glXGetProcAddressARB,
@@ -487,6 +489,10 @@ swap_buffers(void)
WARNX("glError occured");
reset_capture(&gl);
}
+
+ const double ms = (get_time_ns() - start) / 1e6;
+ if (ms >= 1.0)
+ WARNX("WARNING: capture took %.2f ms (>=1ms)", ms);
}
static const char*