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:
@@ -653,6 +653,15 @@ vulkan_supported_platform (GdkSurface *surface,
|
|||||||
VkPhysicalDeviceProperties props;
|
VkPhysicalDeviceProperties props;
|
||||||
GError *error = NULL;
|
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))
|
if (!gdk_display_prepare_vulkan (display, &error))
|
||||||
{
|
{
|
||||||
GSK_DEBUG (RENDERER, "Not using Vulkan%s: %s",
|
GSK_DEBUG (RENDERER, "Not using Vulkan%s: %s",
|
||||||
@@ -685,15 +694,7 @@ vulkan_supported_platform (GdkSurface *surface,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GDK_WINDOWING_WAYLAND
|
return TRUE;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GType
|
static GType
|
||||||
|
Reference in New Issue
Block a user