diff options
author | Matthias Clasen <mclasen@redhat.com> | 2023-01-28 11:04:10 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-04-25 11:54:34 +0200 |
commit | c9e02edfc3ed260673e347dfc854686d449b93d3 (patch) | |
tree | 62f6294f5f90a82c80bcc0d60b2de9a9d4c52785 | |
parent | 12ed685013bb6ef44047780d4a8b00125b1ab90e (diff) | |
download | gtk+-c9e02edfc3ed260673e347dfc854686d449b93d3.tar.gz |
glarea: Synchronize
Create a fence object and pass it along when
creating the GL texture, so that the GL renderer
can wait for the texture to be ready.
-rw-r--r-- | gtk/gtkglarea.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c index 33f7881281..19930f9e2f 100644 --- a/gtk/gtkglarea.c +++ b/gtk/gtkglarea.c @@ -32,6 +32,7 @@ #include "gtksnapshot.h" #include "gtkrenderlayoutprivate.h" #include "gtkcssnodeprivate.h" +#include "gdk/gdkgltextureprivate.h" #include <epoxy/gl.h> @@ -760,6 +761,8 @@ gtk_gl_area_snapshot (GtkWidget *widget, priv->texture = NULL; priv->textures = g_list_prepend (priv->textures, texture); + gdk_gl_texture_builder_set_sync (texture->builder, glFenceSync (GL_SYNC_GPU_COMMANDS_COMPLETE, 0)); + texture->holder = gdk_gl_texture_builder_build (texture->builder, release_texture, texture); |