Skip to content

Commit

Permalink
Merge pull request #13270 from OatmealDome/vk-metal-layer
Browse files Browse the repository at this point in the history
Vulkan: Only attempt to create a CAMetalLayer on macOS
  • Loading branch information
OatmealDome authored Jan 15, 2025
2 parents 3ea870e + 2633b84 commit c344514
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/Core/VideoBackends/Vulkan/VKMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit c344514

Please sign in to comment.