Vulkan: Pass CAMetalLayer to MoltenVK instead of NSView

Gets rid of the warning for calling [NSView layer] off the main thread.
This commit is contained in:
Stenzek 2020-03-11 23:11:24 +10:00
parent a545344268
commit fb947296b0
1 changed files with 4 additions and 0 deletions

View File

@ -342,6 +342,10 @@ void VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
// layer.contentsScale = factor
reinterpret_cast<void (*)(id, SEL, double)>(objc_msgSend)(layer, sel_getUid("setContentsScale:"),
factor);
// Store the layer pointer, that way MoltenVK doesn't call [NSView layer] outside the main thread.
wsi.render_surface = layer;
// The Metal version included with MacOS 10.13 and below does not support several features we
// require. Furthermore, the drivers seem to choke on our shaders (mainly Intel). So, we warn
// the user that this is an unsupported configuration, but permit them to continue.