From a2f4fafe86b8407ecbe1228257ab993fd2c1b815 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 7 Apr 2020 18:49:40 +1000 Subject: Vulkan: Switch from vkCreateMacOSSurfaceMVK() to vkCreateMetalSurfaceEXT() Since we are calling this off the UI thread, we can't use anything which accesses the underlying NSView object. We create and set the Metal layer on the UI thread before the video backend is initialized. This extension is both compatible with MoltenVK and gfx-portability for accepting a layer at surface creation. --- Source/Core/VideoBackends/Vulkan/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoBackends/Vulkan/main.cpp') diff --git a/Source/Core/VideoBackends/Vulkan/main.cpp b/Source/Core/VideoBackends/Vulkan/main.cpp index 4d6b1296ac..5a583de124 100644 --- a/Source/Core/VideoBackends/Vulkan/main.cpp +++ b/Source/Core/VideoBackends/Vulkan/main.cpp @@ -23,7 +23,7 @@ #include "VideoCommon/VideoBackendBase.h" #include "VideoCommon/VideoConfig.h" -#if defined(VK_USE_PLATFORM_MACOS_MVK) +#if defined(VK_USE_PLATFORM_METAL_EXT) #include #endif @@ -280,7 +280,7 @@ void VideoBackend::Shutdown() UnloadVulkanLibrary(); } -#if defined(VK_USE_PLATFORM_MACOS_MVK) +#if defined(VK_USE_PLATFORM_METAL_EXT) static bool IsRunningOnMojaveOrHigher() { // id processInfo = [NSProcessInfo processInfo] @@ -306,7 +306,7 @@ static bool IsRunningOnMojaveOrHigher() void VideoBackend::PrepareWindow(WindowSystemInfo& wsi) { -#if defined(VK_USE_PLATFORM_MACOS_MVK) +#if defined(VK_USE_PLATFORM_METAL_EXT) // This is kinda messy, but it avoids having to write Objective C++ just to create a metal layer. id view = reinterpret_cast(wsi.render_surface); Class clsCAMetalLayer = objc_getClass("CAMetalLayer"); -- cgit v1.2.3