KhronosGroup / KhronosGroup/Vulkan-Docs
vkCreateMacOSSurfaceMVK is main thread only?
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 549
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 2
Description
When calling `vkCreateMacOSSurfaceMVK` from a secondary thread, MoltenVK will correctly point out that `NSView` is main thread only:
> You are not calling this function from the main thread. NSView should only be accessed from the main thread. When using this function outside the main thread, consider passing the CAMetalLayer itself in VkMacOSSurfaceCreateInfoMVK::pView, instead of the NSView.
There appear to be situations where ignoring this warning will lead to crashes later (see [this](https://stackoverflow.com/questions/60466377/qt-5-14-0-vulkan-under-qml-causes-stdsystem-error-mutex-lock-failed?noredirect=1#comment107092265_60466377)), yet the Vulkan specification is silent on issues of thread-safety.
Is this a conscious omission, or should the specification mention that `vkCreateMacOSSurfaceMVK` must be called from the main thread only?
Contributor guide
Assessment
This issue has not been assessed yet.