From e3621e81b74327bffee11d59823e6fa0e2855a4c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 26 Nov 2024 13:17:35 -0800 Subject: [PATCH] apprt/gtk: use proper env var for vulkan disable on <= 4.14 --- src/apprt/gtk/App.zig | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 95942bc9a..93f08c459 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -100,9 +100,11 @@ pub fn init(core_app: *CoreApp, opts: Options) !App { }); // Disabling Vulkan can improve startup times by hundreds of - // milliseconds on some systems + // milliseconds on some systems. We don't use Vulkan so we can just + // disable it. if (version.atLeast(4, 16, 0)) { - // From gtk 4.16, GDK_DEBUG is split into GDK_DEBUG and GDK_DISABLE + // From gtk 4.16, GDK_DEBUG is split into GDK_DEBUG and GDK_DISABLE. + // For the remainder of "why" see the 4.14 comment below. _ = internal_os.setenv("GDK_DISABLE", "gles-api,vulkan"); _ = internal_os.setenv("GDK_DEBUG", "opengl"); } else if (version.atLeast(4, 14, 0)) { @@ -112,14 +114,14 @@ pub fn init(core_app: *CoreApp, opts: Options) !App { // reassess... // // Upstream issue: https://gitlab.gnome.org/GNOME/gtk/-/issues/6589 - _ = internal_os.setenv("GDK_DISABLE", "vulkan"); - _ = internal_os.setenv("GDK_DEBUG", "opengl,gl-disable-gles"); + _ = internal_os.setenv("GDK_DEBUG", "opengl,gl-disable-gles,vulkan-disable"); } else { - _ = internal_os.setenv("GDK_DISABLE", "vulkan"); + _ = internal_os.setenv("GDK_DEBUG", "vulkan-disable"); } if (version.atLeast(4, 14, 0)) { - // We need to export GSK_RENDERER to opengl because GTK uses ngl by default after 4.14 + // We need to export GSK_RENDERER to opengl because GTK uses ngl by + // default after 4.14 _ = internal_os.setenv("GSK_RENDERER", "opengl"); }