summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-01-30 08:35:43 -0500
committerBenjamin Otte <otte@redhat.com>2023-04-27 06:57:02 +0200
commit6efaa79e3c1b9b17a99f93de2e8a76705f3409ff (patch)
tree7be561c694e1b2810290f396863a1d70ddc3c56a /gdk
parent92eb845482116ca869ced8183d64f045e1ab3d38 (diff)
downloadgtk+-6efaa79e3c1b9b17a99f93de2e8a76705f3409ff.tar.gz
gltexture: Synchronize when downloading
If the GL texture has a sync object, wait on it before downloading the data.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdkgltexture.c4
1 files changed, 4 insertions, 0 deletions
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);