[gtk/matthiasc/for-master] inspector: Respect GDK_DEBUG=vulkan-disable
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] inspector: Respect GDK_DEBUG=vulkan-disable
- Date: Thu, 18 Mar 2021 03:20:33 +0000 (UTC)
commit a576bd190bfe35bc22b0639f8b9bb563344c0ffe
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Mar 17 23:19:08 2021 -0400
inspector: Respect GDK_DEBUG=vulkan-disable
Respect the debug settings for disabling Vulkan or GL,
and do not try to initialize those contexts. This can
be necessary to work around crashes.
Fixes: #3748
gtk/inspector/general.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c
index b48836190c..3bc2c5a2cd 100644
--- a/gtk/inspector/general.c
+++ b/gtk/inspector/general.c
@@ -294,6 +294,13 @@ wayland_get_display (struct wl_display *wl_display)
static void
init_gl (GtkInspectorGeneral *gen)
{
+ if (gdk_display_get_debug_flags (gen->display) & GDK_DEBUG_GL_DISABLE)
+ {
+ gtk_label_set_text (GTK_LABEL (gen->gl_version), C_("GL version", "Disabled"));
+ gtk_label_set_text (GTK_LABEL (gen->gl_vendor), C_("GL vendor", "Disabled"));
+ return;
+ }
+
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (gen->display))
{
@@ -329,7 +336,11 @@ init_gl (GtkInspectorGeneral *gen)
dpy = wayland_get_display (gdk_wayland_display_get_wl_display (gen->display));
if (!eglInitialize (dpy, &major, &minor))
- return;
+ {
+ gtk_label_set_text (GTK_LABEL (gen->gl_version), C_("GL version", "None"));
+ gtk_label_set_text (GTK_LABEL (gen->gl_vendor), C_("GL vendor", "None"));
+ return;
+ }
version = g_strconcat ("EGL ", eglQueryString (dpy, EGL_VERSION), NULL);
gtk_label_set_text (GTK_LABEL (gen->gl_version), version);
@@ -394,6 +405,14 @@ init_vulkan (GtkInspectorGeneral *gen)
GdkSurface *surface;
GdkVulkanContext *context;
+ if (gdk_display_get_debug_flags (gen->display) & GDK_DEBUG_VULKAN_DISABLE)
+ {
+ gtk_label_set_text (GTK_LABEL (gen->vk_device), C_("Vulkan device", "Disabled"));
+ gtk_label_set_text (GTK_LABEL (gen->vk_api_version), C_("Vulkan version", "Disabled"));
+ gtk_label_set_text (GTK_LABEL (gen->vk_driver_version), C_("Vulkan version", "Disabled"));
+ return;
+ }
+
surface = gdk_surface_new_toplevel (gen->display);
context = gdk_surface_create_vulkan_context (surface, NULL);
gdk_surface_destroy (surface);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]