From 013401b594cac5c5e1ee5541789703784acfa969 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 15 May 2023 19:11:35 -0400 Subject: Fix texture tests with GLES No sync for you if you're using GLES. --- testsuite/gdk/gltexture.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/testsuite/gdk/gltexture.c b/testsuite/gdk/gltexture.c index f1145647c3..cb00e842ff 100644 --- a/testsuite/gdk/gltexture.c +++ b/testsuite/gdk/gltexture.c @@ -1,6 +1,7 @@ #include #include #include "gdk/gdktextureprivate.h" +#include "gdk/gdkglcontextprivate.h" static cairo_surface_t * make_surface (void) @@ -177,7 +178,10 @@ G_GNUC_END_IGNORE_DEPRECATIONS id = make_gl_texture (context, surface); - sync = glFenceSync (GL_SYNC_GPU_COMMANDS_COMPLETE, 0); + if (gdk_gl_context_has_sync (context)) + sync = glFenceSync (GL_SYNC_GPU_COMMANDS_COMPLETE, 0); + else + sync = NULL; update_region = cairo_region_create_rectangle (&(cairo_rectangle_int_t) { 10, 10, 32, 32 }); @@ -219,7 +223,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS cairo_surface_destroy (surface); - glDeleteSync (sync); + if (sync) + glDeleteSync (sync); cairo_region_destroy (update_region); g_object_unref (old_texture); -- cgit v1.2.1