mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-28 21:08:04 +03:00
Merge pull request #13270 from OatmealDome/vk-metal-layer
Vulkan: Only attempt to create a CAMetalLayer on macOS
This commit is contained in:
commit
c344514ba2
1 changed files with 4 additions and 0 deletions
|
@ -259,6 +259,10 @@ void VideoBackend::Shutdown()
|
||||||
void VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
|
void VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
|
||||||
{
|
{
|
||||||
#if defined(VK_USE_PLATFORM_METAL_EXT)
|
#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.
|
// 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);
|
id view = reinterpret_cast<id>(wsi.render_surface);
|
||||||
Class clsCAMetalLayer = objc_getClass("CAMetalLayer");
|
Class clsCAMetalLayer = objc_getClass("CAMetalLayer");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue