From fdea4968830697bcd7e9c51586788256b106b303 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 1 Oct 2024 20:52:52 -0400 Subject: [PATCH] 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. --- gsk/gskrenderer.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c index cdb3678da4..45cac210f5 100644 --- a/gsk/gskrenderer.c +++ b/gsk/gskrenderer.c @@ -675,13 +675,15 @@ vulkan_supported_platform (GdkSurface *surface, return FALSE; } + if (as_fallback) + return TRUE; + vkGetPhysicalDeviceProperties (display->vk_physical_device, &props); if (props.deviceType == VK_PHYSICAL_DEVICE_TYPE_CPU) { - GSK_DEBUG (RENDERER, "Not using '%s'%s: device is CPU", - g_type_name (renderer_type), - as_fallback ? " as fallback" : ""); + GSK_DEBUG (RENDERER, "Not using '%s': device is CPU", + g_type_name (renderer_type)); return FALSE; } @@ -690,16 +692,12 @@ vulkan_supported_platform (GdkSurface *surface, if (!display->vk_dmabuf_formats || gdk_dmabuf_formats_get_n_formats (display->vk_dmabuf_formats) == 0) { - GSK_DEBUG (RENDERER, "Not using '%s'%s: no dmabuf support", - g_type_name (renderer_type), - as_fallback ? " as fallback" : ""); + GSK_DEBUG (RENDERER, "Not using '%s': no dmabuf support", + g_type_name (renderer_type)); return FALSE; } #endif - if (as_fallback) - return TRUE; - #ifdef GDK_WINDOWING_WAYLAND if (GDK_IS_WAYLAND_DISPLAY (gdk_surface_get_display (surface))) return TRUE;