mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-10 20:50:12 +00:00
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:
parent
58036ece96
commit
ae180f85ca
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user