From b43fb9fd9802c9ac096a81fa0126f74c1e632817 Mon Sep 17 00:00:00 2001 From: Dor Askayo Date: Mon, 19 Jun 2023 23:42:32 +0300 Subject: [PATCH] cogl/onscreen/egl: Record CPU time only when GPU time can be queried These are only useful together at the moment. Part-of: --- cogl/cogl/winsys/cogl-onscreen-egl.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cogl/cogl/winsys/cogl-onscreen-egl.c b/cogl/cogl/winsys/cogl-onscreen-egl.c index 54f37e264..dc11c1be4 100644 --- a/cogl/cogl/winsys/cogl-onscreen-egl.c +++ b/cogl/cogl/winsys/cogl-onscreen-egl.c @@ -313,13 +313,9 @@ cogl_onscreen_egl_swap_buffers_with_damage (CoglOnscreen *onscreen, { info->gpu_time_before_buffer_swap_ns = cogl_context_get_gpu_time_ns (context); - } + info->cpu_time_before_buffer_swap_us = g_get_monotonic_time (); - info->cpu_time_before_buffer_swap_us = g_get_monotonic_time (); - - /* Set up a timestamp query for when all rendering will be finished. */ - if (cogl_has_feature (context, COGL_FEATURE_ID_TIMESTAMP_QUERY)) - { + /* Set up a timestamp query for when all rendering will be finished. */ info->timestamp_query = cogl_framebuffer_create_timestamp_query (COGL_FRAMEBUFFER (onscreen)); }