From 75b68c9170db0b8c5772d9139fa79e9f8a2cfd53 Mon Sep 17 00:00:00 2001 From: Nick Majkic <8842171-majkic65@users.noreply.gitlab.com> Date: Mon, 18 Mar 2024 02:45:38 +0000 Subject: [PATCH] Macos moltenvk headers --- CMakeLists.txt | 2 +- src/video_core/video_core.cpp | 14 +++++++++++++- src/video_core/vulkan_common/vulkan.h | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2667f4514c..b8955e0855 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ option(YUZU_ENABLE_PORTABLE "Allow yuzu to enable portable mode if a user folder CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "NOT WIN32" OFF) -CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead of the bundled one)" OFF "APPLE" OFF) +CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead of the bundled one)" OFF "APPLE" ON) set(DEFAULT_ENABLE_OPENSSL ON) if (ANDROID OR WIN32 OR APPLE) diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index 0efb7b49d5..af6fa09eab 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -14,6 +14,7 @@ #include "video_core/renderer_vulkan/renderer_vulkan.h" #include "video_core/video_core.h" + namespace { std::unique_ptr CreateRenderer( @@ -23,9 +24,20 @@ std::unique_ptr CreateRenderer( auto& device_memory = system.Host1x().MemoryManager(); switch (Settings::values.renderer_backend.GetValue()) { - case Settings::RendererBackend::OpenGL: + #ifdef __APPLE__ + // do nothing for now, include metal in here at later date. + + + #else + + // openGL, not supported on Apple so not bothering to include if macos + case Settings::RendererBackend::OpenGL: return std::make_unique(telemetry_session, emu_window, device_memory, gpu, std::move(context)); + + + #endif + case Settings::RendererBackend::Vulkan: return std::make_unique(telemetry_session, emu_window, device_memory, gpu, std::move(context)); diff --git a/src/video_core/vulkan_common/vulkan.h b/src/video_core/vulkan_common/vulkan.h index 62aa132915..26b9054886 100644 --- a/src/video_core/vulkan_common/vulkan.h +++ b/src/video_core/vulkan_common/vulkan.h @@ -15,7 +15,11 @@ #define VK_USE_PLATFORM_WAYLAND_KHR #endif +#ifdef __APPLE__ +#include +#else #include +#endif // Sanitize macros #undef CreateEvent