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 <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28259>
This commit is contained in:
duncan.hopkins 2023-10-31 12:27:43 +00:00 committed by Marge Bot
parent d644b64ff2
commit 899fcaf237

View file

@ -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