Open XieYHccc opened 2 months ago
AFAIK it's because macOS requires interacting with UI only on main thread, and swapchain creation in MoltenVK is UI surface interaction on the Metal/OS level.
AFAIK it's because macOS requires interacting with UI only on main thread, and swapchain creation in MoltenVK is UI surface interaction on the Metal/OS level.
Yes. In the Apple APIs, access to the main UI components, such as screens or views, which MoltenVK may need to do during swapchain creation, must be done on the main thread.
If swapchain creation is done from a secondary thread, MoltenVK dispatches any necessary UI calls to the main thread, and waits for them to complete. If the app is also waiting on the main thread for the swapchain to be created, this can cause a deadlock.
@XieYHccc
Are you able to generate a call stack trace of the hang, so we can see where it is hanging?
If you're running the app from Xcode, you can pause the app and screenshot the call stacks.
Hi everyone,
I'm using a Job system to split the initialization of my engine into different jobs. The problem is that calling vkCreateSwapchainKHR on a non-main thread mysteriously hangs with no validation errors(The same code works on Windows, see below). However, when I move the initialization of Vulkan to main thread, it works.
So, Is there any thing I missed? or should we must call vkCreateSwapchainKHR on main thread on Macos?