From ff58ea7d91933f17905b0f1a32b1393d9c85809b Mon Sep 17 00:00:00 2001 From: Michel Zou Date: Tue, 20 Apr 2021 15:15:58 +0200 Subject: [PATCH] vulkan/wsi: avoid wsi_x11_check_for_dri3 for sw device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disabling the check allows swapchains to be created on a remote X Server using the xlib backend, which in turn allows Vulkan apps, such as swapchain_images in Vulkan Samples, to run. Closes #4323 Reviewed-by: Adam Jackson Acked-by: Michel Dänzer Part-of: --- src/vulkan/wsi/wsi_common_x11.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 23e18aeb921..3c2ad386807 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -439,8 +439,10 @@ VkBool32 wsi_get_physical_device_xcb_presentation_support( if (!wsi_conn) return false; - if (!wsi_x11_check_for_dri3(wsi_conn)) - return false; + if (!wsi_device->sw) { + if (!wsi_x11_check_for_dri3(wsi_conn)) + return false; + } unsigned visual_depth; if (!connection_get_visualtype(connection, visual_id, &visual_depth)) @@ -484,9 +486,11 @@ x11_surface_get_support(VkIcdSurfaceBase *icd_surface, if (!wsi_conn) return VK_ERROR_OUT_OF_HOST_MEMORY; - if (!wsi_x11_check_for_dri3(wsi_conn)) { - *pSupported = false; - return VK_SUCCESS; + if (!wsi_device->sw) { + if (!wsi_x11_check_for_dri3(wsi_conn)) { + *pSupported = false; + return VK_SUCCESS; + } } unsigned visual_depth;