diff options
| author | OatmealDome <julian@oatmealdome.me> | 2025-01-08 13:51:53 -0500 |
|---|---|---|
| committer | OatmealDome <julian@oatmealdome.me> | 2025-01-08 13:51:53 -0500 |
| commit | 2633b84b981dc7f42f8569da313ccc54586e483e (patch) | |
| tree | 125fc66c20bc32de944e9d3c74e6ec0bce6c34cd /Source/Core/VideoBackends | |
| parent | 9b3b6bea9d088c52cfaa455bb8f2702d13f6002d (diff) | |
Vulkan: Only attempt to create a CAMetalLayer on macOS
Diffstat (limited to 'Source/Core/VideoBackends')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/VKMain.cpp | 4 |
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"); |
