summaryrefslogtreecommitdiff
path: root/src/yuzu/qt_common.cpp
diff options
context:
space:
mode:
authorSteveice10 <1269164+Steveice10@users.noreply.github.com>2023-06-30 23:35:07 -0700
committerSteveice10 <1269164+Steveice10@users.noreply.github.com>2023-06-30 23:46:03 -0700
commite146a0034552200cf19740f56fb05153f465a51e (patch)
tree2cf0606fda63cb50463afe8a7c26b958a2edc89d /src/yuzu/qt_common.cpp
parenta10bdaf934431dd0111a4d853df757247d9a7e36 (diff)
vulkan: Use newer VK_EXT_metal_surface to create surface for MoltenVK.
Diffstat (limited to 'src/yuzu/qt_common.cpp')
-rw-r--r--src/yuzu/qt_common.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/yuzu/qt_common.cpp b/src/yuzu/qt_common.cpp
index 5d0fd7674..413402165 100644
--- a/src/yuzu/qt_common.cpp
+++ b/src/yuzu/qt_common.cpp
@@ -10,6 +10,8 @@
#if !defined(WIN32) && !defined(__APPLE__)
#include <qpa/qplatformnativeinterface.h>
+#elif defined(__APPLE__)
+#include <objc/message.h>
#endif
namespace QtCommon {
@@ -37,9 +39,12 @@ Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* window)
Core::Frontend::EmuWindow::WindowSystemInfo wsi;
wsi.type = GetWindowSystemType();
+#if defined(WIN32)
// Our Win32 Qt external doesn't have the private API.
-#if defined(WIN32) || defined(__APPLE__)
- wsi.render_surface = window ? reinterpret_cast<void*>(window->winId()) : nullptr;
+ wsi.render_surface = reinterpret_cast<void*>(window->winId());
+#elif defined(__APPLE__)
+ wsi.render_surface = reinterpret_cast<void* (*)(id, SEL)>(objc_msgSend)(
+ reinterpret_cast<id>(window->winId()), sel_registerName("layer"));
#else
QPlatformNativeInterface* pni = QGuiApplication::platformNativeInterface();
wsi.display_connection = pni->nativeResourceForWindow("display", window);