From 2633b84b981dc7f42f8569da313ccc54586e483e Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Wed, 8 Jan 2025 13:51:53 -0500 Subject: [PATCH] Vulkan: Only attempt to create a CAMetalLayer on macOS --- Source/Core/VideoBackends/Vulkan/VKMain.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/VideoBackends/Vulkan/VKMain.cpp b/Source/Core/VideoBackends/Vulkan/VKMain.cpp index 55ebfdf23980..ee49796daf42 100644 --- a/Source/Core/VideoBackends/Vulkan/VKMain.cpp +++ b/Source/Core/VideoBackends/Vulkan/VKMain.cpp @@ -259,6 +259,10 @@ void VideoBackend::Shutdown() void VideoBackend::PrepareWindow(WindowSystemInfo& wsi) { #if defined(VK_USE_PLATFORM_METAL_EXT) + // We only need to manually create the CAMetalLayer on macOS. + if (wsi.type != WindowSystemType::MacOS) + return; + // 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");