From 32a4f805b8d428ad0145fdf69881430447897cd1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 1 May 2024 21:26:54 -0400 Subject: [PATCH] gsk: Require dmabuf support for Vulkan Don't use the Vulkan renderer if Vulkan doesn't support any dmabuf formats. --- gsk/gskrenderer.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c index 0cf30ff780..b42cf4f820 100644 --- a/gsk/gskrenderer.c +++ b/gsk/gskrenderer.c @@ -679,9 +679,16 @@ vulkan_supported_platform (GdkSurface *surface, if (props.deviceType == VK_PHYSICAL_DEVICE_TYPE_CPU) { if (!as_fallback) - GSK_DEBUG (RENDERER, - "Not using '%s': device is CPU", - g_type_name (renderer_type)); + GSK_DEBUG (RENDERER, "Not using '%s': device is CPU", g_type_name (renderer_type)); + return FALSE; + } + + gdk_display_init_dmabuf (display); + if (!display->vk_dmabuf_formats || + gdk_dmabuf_formats_get_n_formats (display->vk_dmabuf_formats) == 0) + { + if (!as_fallback) + GSK_DEBUG (RENDERER, "Not using '%s': no dmabuf support", g_type_name (renderer_type)); return FALSE; }