summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/VKMain.cpp
diff options
context:
space:
mode:
authorOatmealDome <OatmealDome@users.noreply.github.com>2025-01-15 15:08:03 -0500
committerGitHub <noreply@github.com>2025-01-15 15:08:03 -0500
commitc344514ba2f40bc0c10b5103d1ab77c6f738d602 (patch)
tree4bbaa538bc168020d94413f6c242f9bda9d8508c /Source/Core/VideoBackends/Vulkan/VKMain.cpp
parent3ea870ef8c5f4d4b86bd3ce0c2e3ddba6f1f25aa (diff)
parent2633b84b981dc7f42f8569da313ccc54586e483e (diff)
Merge pull request #13270 from OatmealDome/vk-metal-layer
Vulkan: Only attempt to create a CAMetalLayer on macOS
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/VKMain.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/VKMain.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/VKMain.cpp b/Source/Core/VideoBackends/Vulkan/VKMain.cpp
index 55ebfdf239..ee49796daf 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<id>(wsi.render_surface);
Class clsCAMetalLayer = objc_getClass("CAMetalLayer");