diff options
| author | Stenzek <stenzek@gmail.com> | 2020-03-11 23:11:24 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2020-03-11 23:11:26 +1000 |
| commit | fb947296b07bab48ae33ebebb5bb29624a488d71 (patch) | |
| tree | 863ecde0a334d81c9164cc162fb8ac0d54712ac0 /Source/Core/VideoBackends/Vulkan/main.cpp | |
| parent | a545344268fbfd2f3464df1579c8942d30a672d3 (diff) | |
Vulkan: Pass CAMetalLayer to MoltenVK instead of NSView
Gets rid of the warning for calling [NSView layer] off the main thread.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/main.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/main.cpp b/Source/Core/VideoBackends/Vulkan/main.cpp index 80063ff844..4d6b1296ac 100644 --- a/Source/Core/VideoBackends/Vulkan/main.cpp +++ b/Source/Core/VideoBackends/Vulkan/main.cpp @@ -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. |
