diff --git a/cogl/cogl/cogl-context.c b/cogl/cogl/cogl-context.c index 67bea6b8d..276617554 100644 --- a/cogl/cogl/cogl-context.c +++ b/cogl/cogl/cogl-context.c @@ -519,7 +519,7 @@ int64_t cogl_context_get_gpu_time_ns (CoglContext *context) { g_return_val_if_fail (cogl_has_feature (context, - COGL_FEATURE_ID_GET_GPU_TIME), + COGL_FEATURE_ID_TIMESTAMP_QUERY), 0); return context->driver_vtable->get_gpu_time_ns (context); diff --git a/cogl/cogl/cogl-context.h b/cogl/cogl/cogl-context.h index 38ac11be8..dd4c3e8ef 100644 --- a/cogl/cogl/cogl-context.h +++ b/cogl/cogl/cogl-context.h @@ -210,7 +210,6 @@ typedef enum _CoglFeatureID COGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL, COGL_FEATURE_ID_BLIT_FRAMEBUFFER, COGL_FEATURE_ID_TIMESTAMP_QUERY, - COGL_FEATURE_ID_GET_GPU_TIME, /*< private >*/ _COGL_N_FEATURE_IDS /*< skip >*/ @@ -385,7 +384,7 @@ cogl_context_timestamp_query_get_time_ns (CoglContext *context, * cogl_context_get_gpu_time_ns: * @context: a #CoglContext pointer * - * This function should only be called if the COGL_FEATURE_ID_GET_GPU_TIME + * This function should only be called if the COGL_FEATURE_ID_TIMESTAMP_QUERY * feature is advertised. * * Return value: Current GPU time in nanoseconds diff --git a/cogl/cogl/driver/gl/cogl-util-gl.c b/cogl/cogl/driver/gl/cogl-util-gl.c index 59d2e74d4..32ecbd3c3 100644 --- a/cogl/cogl/driver/gl/cogl-util-gl.c +++ b/cogl/cogl/driver/gl/cogl-util-gl.c @@ -558,7 +558,7 @@ cogl_gl_get_gpu_time_ns (CoglContext *context) int64_t gpu_time_ns; g_return_val_if_fail (cogl_has_feature (context, - COGL_FEATURE_ID_GET_GPU_TIME), + COGL_FEATURE_ID_TIMESTAMP_QUERY), 0); GE (context, glGetInteger64v (GL_TIMESTAMP, &gpu_time_ns)); diff --git a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c index 83939e882..e498263aa 100644 --- a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c +++ b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c @@ -543,12 +543,9 @@ _cogl_driver_update_features (CoglContext *ctx, COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_HALF_FLOAT, TRUE); - if (ctx->glGenQueries && ctx->glQueryCounter) + if (ctx->glGenQueries && ctx->glQueryCounter && ctx->glGetInteger64v) COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_TIMESTAMP_QUERY, TRUE); - if (ctx->glGetInteger64v) - COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_GET_GPU_TIME, TRUE); - /* Cache features */ for (i = 0; i < G_N_ELEMENTS (private_features); i++) ctx->private_features[i] |= private_features[i]; diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c index 33d28848c..1780c3fbe 100644 --- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c +++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c @@ -437,12 +437,9 @@ _cogl_driver_update_features (CoglContext *context, COGL_FEATURE_ID_TEXTURE_RG, TRUE); - if (context->glGenQueries && context->glQueryCounter) + if (context->glGenQueries && context->glQueryCounter && context->glGetInteger64v) COGL_FLAGS_SET (context->features, COGL_FEATURE_ID_TIMESTAMP_QUERY, TRUE); - if (context->glGetInteger64v) - COGL_FLAGS_SET (context->features, COGL_FEATURE_ID_GET_GPU_TIME, TRUE); - /* Cache features */ for (i = 0; i < G_N_ELEMENTS (private_features); i++) context->private_features[i] |= private_features[i]; diff --git a/cogl/cogl/winsys/cogl-onscreen-egl.c b/cogl/cogl/winsys/cogl-onscreen-egl.c index 8a587049e..f07896866 100644 --- a/cogl/cogl/winsys/cogl-onscreen-egl.c +++ b/cogl/cogl/winsys/cogl-onscreen-egl.c @@ -295,7 +295,7 @@ cogl_onscreen_egl_swap_buffers_with_damage (CoglOnscreen *onscreen, COGL_FRAMEBUFFER (onscreen), COGL_FRAMEBUFFER_STATE_BIND); - if (cogl_has_feature (context, COGL_FEATURE_ID_GET_GPU_TIME)) + if (cogl_has_feature (context, COGL_FEATURE_ID_TIMESTAMP_QUERY)) { info->gpu_time_before_buffer_swap_ns = cogl_context_get_gpu_time_ns (context); diff --git a/src/backends/native/meta-drm-buffer-gbm.c b/src/backends/native/meta-drm-buffer-gbm.c index 30a8f5cbc..2b00b1ebf 100644 --- a/src/backends/native/meta-drm-buffer-gbm.c +++ b/src/backends/native/meta-drm-buffer-gbm.c @@ -324,7 +324,7 @@ meta_drm_buffer_gbm_fill_timings (MetaDrmBuffer *buffer, cogl_fbo = cogl_offscreen_new_with_texture (COGL_TEXTURE (cogl_tex)); cogl_object_unref (cogl_tex); - if (cogl_has_feature (cogl_context, COGL_FEATURE_ID_GET_GPU_TIME)) + if (cogl_has_feature (cogl_context, COGL_FEATURE_ID_TIMESTAMP_QUERY)) { info->gpu_time_before_buffer_swap_ns = cogl_context_get_gpu_time_ns (cogl_context);