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 972134abe4 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
This commit is contained in:
Ray Strode 2020-06-22 11:07:32 -04:00
parent 8a91d1d1ce
commit 05736afaf8

View File

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