Files
gtk3/debian/patches/gl-Synchronize-when-calling-MakeCurrent.patch
Simon McVittie 00a64e67fd d/patches: Update to gtk-3-24 branch commit 3.24.36-33-g5554113c74
Excluding Windows- and macOS-specific changes, and a workaround for a
libhandy bug which was applied and then reverted.

- Fix logic for when to build GObject-Introspection
- Treat XKB_MOD_NAME_LOGO as Super key in Wayland (GNOME/gtk#4913)
- Fix animations and transitions randomly stopping (GNOME/gtk#4426)
- Take UI scale into account when loading "image-missing" icon
- Replace upstream-rejected solution to GNOME/gtk#5386 (see 3.24.35-3,
  3.24.36-2) with the upstreamed solution
- Fix a touchscreen handling bug that can cause applications to become
  unresponsive (GNOME/gtk#4947)
- Fix GL rendering issues in Totem after the Mesa AMD driver enabled
  threaded rendering (GNOME/gtk#5517)
- Translation updates: ab, lt, tr
2023-02-04 12:23:53 +00:00

46 lines
1.2 KiB
Diff

From: Matthias Clasen <mclasen@redhat.com>
Date: Fri, 27 Jan 2023 07:07:36 -0500
Subject: gl: Synchronize when calling MakeCurrent
When making out GL context current, wait
until the GPU is done with commands from
the previous context.
Bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/5517
Origin: upstream, 3.24.37, commit:9811485990
---
gdk/gdkgl.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c
index 9690077..61cf164 100644
--- a/gdk/gdkgl.c
+++ b/gdk/gdkgl.c
@@ -352,6 +352,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
int alpha_size = 0;
cairo_region_t *clip_region;
GdkGLContextPaintData *paint_data;
+ GLsync sync = NULL;
impl_window = window->impl_window;
@@ -366,7 +367,18 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
clip_region = gdk_cairo_region_from_clip (cr);
+ if (gdk_gl_context_get_current () != paint_context)
+ sync = glFenceSync (GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
+
gdk_gl_context_make_current (paint_context);
+
+ if (sync)
+ {
+ glWaitSync (sync, 0, GL_TIMEOUT_IGNORED);
+ glDeleteSync (sync);
+ sync = NULL;
+ }
+
paint_data = gdk_gl_context_get_paint_data (paint_context);
if (paint_data->tmp_framebuffer == 0)