From 19c2b08ab44a2755bc303412ae97097eb8564c42 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 b65adba582..16f8074f0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ option(SUYU_ENABLE_PORTABLE "Allow suyu to enable portable mode if a user folder CMAKE_DEPENDENT_OPTION(SUYU_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) option(USE_CCACHE "Use CCache for faster building" ON) diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index fba258113d..1166dfb977 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -13,6 +13,7 @@ #include "video_core/renderer_vulkan/renderer_vulkan.h" #include "video_core/video_core.h" + namespace { std::unique_ptr CreateRenderer( @@ -21,9 +22,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(emu_window, device_memory, gpu, std::move(context)); + + + #endif + case Settings::RendererBackend::Vulkan: return std::make_unique(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