gsk: Move the platform check up

In some cases, we can know that we're not going to use Vulkan
without initializing it. Handle those before calling
gdk_display_prepare_vulkan.
This commit is contained in:
Matthias Clasen 2024-11-12 15:40:32 -05:00
parent 58036ece96
commit ae180f85ca

View File

@ -653,6 +653,15 @@ vulkan_supported_platform (GdkSurface *surface,
VkPhysicalDeviceProperties props;
GError *error = NULL;
#ifdef GDK_WINDOWING_WAYLAND
if (!GDK_IS_WAYLAND_DISPLAY (gdk_surface_get_display (surface)) && !as_fallback)
{
GSK_DEBUG (RENDERER, "Not using '%s': platform is not Wayland",
g_type_name (renderer_type));
return FALSE;
}
#endif
if (!gdk_display_prepare_vulkan (display, &error))
{
GSK_DEBUG (RENDERER, "Not using Vulkan%s: %s",
@ -685,15 +694,7 @@ vulkan_supported_platform (GdkSurface *surface,
}
#endif
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY (gdk_surface_get_display (surface)))
return TRUE;
#endif
GSK_DEBUG (RENDERER, "Not using '%s': platform is not Wayland",
g_type_name (renderer_type));
return FALSE;
return TRUE;
}
static GType