[gtk/wip/dont-assert-without-evidence] x11: be more verbose when glClientWaitSync behaves unexpectedtly



commit 05736afaf8c1f934f72aec49c308acb2febd3bae
Author: Ray Strode <rstrode redhat com>
Date:   Mon Jun 22 11:07:32 2020 -0400

    x11: be more verbose when glClientWaitSync behaves unexpectedtly
    
    When given a 0 timeout, glClientWaitSync is only supposed to return one
    of three possible values:
    
     - GL_ALREADY_SIGNALED - fence fired
     - GL_WAIT_FAILED - there was an error
     - GL_TIMEOUT_EXPIRED - fence hasn't fired yet
    
    In addition, it can also return GL_CONDITION_SATISFIED if a non-zero
    timeout is passed, and the fence fires while waiting on the timeout.
    
    Since commit 972134abe48a4c9c7b6ad41b0723f30f4e7ae16b we now call
    glClientWaitSync (with a 0 timeout), but one user is reporting it's
    returning some value that's not one of the above four.
    
    This commit changes the g_assert to a g_error so we can see what
    value is getting returned.
    
    May help with https://gitlab.gnome.org/GNOME/gtk/-/issues/2858

 gdk/x11/gdkglcontext-x11.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 72c775885b..834d23ac93 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -648,7 +648,7 @@ on_gl_surface_xevent (GdkGLContext   *context,
           case GL_TIMEOUT_EXPIRED:
             break;
           default:
-            g_assert_not_reached ();
+            g_error ("glClientWaitSync returned unexpected result: %x", (guint) wait_result);
         }
     }
 


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