vulkan/wsi: avoid wsi_x11_check_for_dri3 for sw device
authorMichel Zou <xantares09@hotmail.com>
Tue, 20 Apr 2021 13:15:58 +0000 (15:15 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 3 May 2021 13:33:08 +0000 (13:33 +0000)
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 <ajax@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10349>

src/vulkan/wsi/wsi_common_x11.c

index 23e18ae..3c2ad38 100644 (file)
@@ -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;