KhronosGroup / KhronosGroup/Vulkan-Docs

vkCreateMacOSSurfaceMVK is main thread only?

Open
#1,200 6 comments 0 reactions 1 assignee Claimed by @billhollings View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.