gsk: Allow Vulkan software rendering as fallback

There is no reason to exclude lavapipe when we accept llvmpipe,
and lavapipe has the advantage that it supports dmabufs.
This commit is contained in:
Matthias Clasen 2024-10-01 20:52:52 -04:00
parent 60878e4186
commit fdea496883

View File

@ -675,13 +675,15 @@ vulkan_supported_platform (GdkSurface *surface,
return FALSE; return FALSE;
} }
if (as_fallback)
return TRUE;
vkGetPhysicalDeviceProperties (display->vk_physical_device, &props); vkGetPhysicalDeviceProperties (display->vk_physical_device, &props);
if (props.deviceType == VK_PHYSICAL_DEVICE_TYPE_CPU) if (props.deviceType == VK_PHYSICAL_DEVICE_TYPE_CPU)
{ {
GSK_DEBUG (RENDERER, "Not using '%s'%s: device is CPU", GSK_DEBUG (RENDERER, "Not using '%s': device is CPU",
g_type_name (renderer_type), g_type_name (renderer_type));
as_fallback ? " as fallback" : "");
return FALSE; return FALSE;
} }
@ -690,16 +692,12 @@ vulkan_supported_platform (GdkSurface *surface,
if (!display->vk_dmabuf_formats || if (!display->vk_dmabuf_formats ||
gdk_dmabuf_formats_get_n_formats (display->vk_dmabuf_formats) == 0) gdk_dmabuf_formats_get_n_formats (display->vk_dmabuf_formats) == 0)
{ {
GSK_DEBUG (RENDERER, "Not using '%s'%s: no dmabuf support", GSK_DEBUG (RENDERER, "Not using '%s': no dmabuf support",
g_type_name (renderer_type), g_type_name (renderer_type));
as_fallback ? " as fallback" : "");
return FALSE; return FALSE;
} }
#endif #endif
if (as_fallback)
return TRUE;
#ifdef GDK_WINDOWING_WAYLAND #ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY (gdk_surface_get_display (surface))) if (GDK_IS_WAYLAND_DISPLAY (gdk_surface_get_display (surface)))
return TRUE; return TRUE;