diff options
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/main.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/main.cpp b/Source/Core/VideoBackends/Vulkan/main.cpp index 93b7e9dfe4..4d6b1296ac 100644 --- a/Source/Core/VideoBackends/Vulkan/main.cpp +++ b/Source/Core/VideoBackends/Vulkan/main.cpp @@ -304,7 +304,7 @@ static bool IsRunningOnMojaveOrHigher() } #endif -void VideoBackend::PrepareWindow(const WindowSystemInfo& wsi) +void VideoBackend::PrepareWindow(WindowSystemInfo& wsi) { #if defined(VK_USE_PLATFORM_MACOS_MVK) // This is kinda messy, but it avoids having to write Objective C++ just to create a metal layer. @@ -342,6 +342,10 @@ void VideoBackend::PrepareWindow(const 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. |
