From 899fcaf23744778bb16662185c26b9df982c5365 Mon Sep 17 00:00:00 2001 From: "duncan.hopkins" Date: Tue, 31 Oct 2023 12:27:43 +0000 Subject: [PATCH] zink: Avoid issues when kopper tries using XCB WSI on Apple. On macOS builds the code is tryng to use X11 and XCB code paths for WSI functions and structures, i.e. `VkXcbSurfaceCreateInfoKHR` and `vkCreateXcbSurfaceKHR()`. The MoltenVK implementation only supports `VkMacOSSurfaceCreateInfoMVK` and `vkCreateMacOSSurfaceMVK()`. To get these working correctly Metal diusplay surfaces need to be setup, which xquarts does not expose. Until this situation is resolved correctly the `VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR` code paths has been changed to return `VK_INCOMPLETE`. This allows them to run without asserting and terminating the runtime. This allows for non-display applicaitons, like `glxinfo`, to run without terminating. Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/zink_kopper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/drivers/zink/zink_kopper.c b/src/gallium/drivers/zink/zink_kopper.c index 101e7232d99..c6fee16d4b4 100644 --- a/src/gallium/drivers/zink/zink_kopper.c +++ b/src/gallium/drivers/zink/zink_kopper.c @@ -87,8 +87,12 @@ kopper_CreateSurface(struct zink_screen *screen, struct kopper_displaytarget *cd switch (type) { #ifdef VK_USE_PLATFORM_XCB_KHR case VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR: { +#ifdef GLX_USE_APPLE + error = VK_INCOMPLETE; +#else VkXcbSurfaceCreateInfoKHR *xcb = (VkXcbSurfaceCreateInfoKHR *)&cdt->info.bos; error = VKSCR(CreateXcbSurfaceKHR)(screen->instance, xcb, NULL, &surface); +#endif break; } #endif