[gtk/wip/on-the-fence-about-damage: 3/4] wip! gdkdisplay-x11: flag nvidia as needing special damage handling



commit 5fa6c97c69b7fd624efefa5dd409acea5f22a85f
Author: Ray Strode <rstrode redhat com>
Date:   Wed May 27 15:12:35 2020 -0400

    wip! gdkdisplay-x11: flag nvidia as needing special damage handling

 gdk/x11/gdkdisplay-x11.h   |  1 +
 gdk/x11/gdkglcontext-x11.c | 10 ++++++++++
 2 files changed, 11 insertions(+)
---
diff --git a/gdk/x11/gdkdisplay-x11.h b/gdk/x11/gdkdisplay-x11.h
index 3e4fb24d63..172e03d73d 100644
--- a/gdk/x11/gdkdisplay-x11.h
+++ b/gdk/x11/gdkdisplay-x11.h
@@ -149,6 +149,7 @@ struct _GdkX11Display
   guint has_glx_multisample : 1;
   guint has_glx_visual_rating : 1;
   guint has_glx_create_es2_context : 1;
+  guint has_glx_implicit_damage : 1;
 
   gint damage_event_base;
   gint damage_error_base;
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 95d8e66c66..148a2cb3c4 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -841,6 +841,16 @@ gdk_x11_screen_init_gl (GdkX11Screen *screen)
   display_x11->has_glx_visual_rating =
     epoxy_has_glx_extension (dpy, screen_num, "GLX_EXT_visual_rating");
 
+  if (g_strcmp0 (glXGetClientString (dpy, GLX_VENDOR), "NVIDIA Corporation") == 0)
+    {
+      /* NVidia doesn't send damage from the client library during buffer swap.
+       * Instead, damage only gets sent by the Xserver later, and we can't
+       * continue the frame paint cycle until we know the compositor has seen
+       * the damage.
+       */
+      display_x11->has_glx_implicit_damage = TRUE;
+    }
+
   GDK_DISPLAY_NOTE (display, OPENGL,
             g_message ("GLX version %d.%d found\n"
                        " - Vendor: %s\n"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]