From: Matthias Clasen Date: Mon, 30 Jan 2023 13:35:43 +0000 (-0500) Subject: gltexture: Synchronize when downloading X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~354^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6efaa79e3c1b9b17a99f93de2e8a76705f3409ff;p=gtk4.git gltexture: Synchronize when downloading If the GL texture has a sync object, wait on it before downloading the data. --- diff --git a/gdk/gdkgltexture.c b/gdk/gdkgltexture.c index 3b6c20a637..b409ae852d 100644 --- a/gdk/gdkgltexture.c +++ b/gdk/gdkgltexture.c @@ -100,6 +100,10 @@ gdk_gl_texture_invoke_callback (gpointer data) context = gdk_display_get_gl_context (gdk_gl_context_get_display (invoke->self->context)); gdk_gl_context_make_current (context); + + if (invoke->self->sync && context != invoke->self->context) + glWaitSync (invoke->self->sync, 0, GL_TIMEOUT_IGNORED); + glBindTexture (GL_TEXTURE_2D, invoke->self->id); invoke->func (invoke->self, context, invoke->data);