gltexture: Synchronize when downloading

If the GL texture has a sync object, wait
on it before downloading the data.
This commit is contained in:
Matthias Clasen
2023-01-30 08:35:43 -05:00
parent f3d84fd513
commit ac991483f2

View File

@@ -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);