diff --git a/BUILD.md b/BUILD.md index ab0dd10d..f1ec6f4b 100644 --- a/BUILD.md +++ b/BUILD.md @@ -3,30 +3,57 @@ ## Windows Prerequisites: -- A recent version of Visual Studio 2022 with CMake tools component +- A recent version of Visual Studio 2022 (recommended but not required) with the following additional components: + - C++ CMake tools for Windows + - Windows 10/11 SDK - git Instructions: -1) Run `git clone --recursive https://github.com/cemu-project/Cemu` -2) Launch `Cemu/generate_vs_solution.bat`. If you installed VS to a custom location you may need to manually adjust the path inside the bat file -3) Wait until done, then open `Cemu/build/Cemu.sln` in Visual Studio -4) Right click 'CemuBin' project -> Set as startup project -5) Then build the solution and once finished you can run and debug it +1. Run `git clone --recursive https://github.com/cemu-project/Cemu` +2. Launch `Cemu/generate_vs_solution.bat`. + - If you installed VS to a custom location or use VS 2019, you may need to manually change the path inside the .bat file +3. Wait until it's done, then open `Cemu/build/Cemu.sln` in Visual Studio +4. Then build the solution and once finished you can run and debug it, or build it and check the /bin folder for the final Cemu.exe. -You can also skip steps 3-5 and open the root folder of the cloned repo directly in Visual Studio (as a folder) and use the inbuilt cmake support, but be warned that cmake support in VS can be a bit finicky. +You can also skip steps 3-5 and open the root folder of the cloned repo directly in Visual Studio (as a folder) and use the built-in cmake support but be warned that cmake support in VS can be a bit finicky. ## Linux -To compile Cemu, a recent enough compiler and STL with C++20 support is required! We use clang 12, other compilers may work as well. +To compile Cemu, a recent enough compiler and STL with C++20 support is required! clang-12 or higher is what we recommend. -For ubuntu and most derivatives: +### Installing dependencies -1) `sudo apt install -y libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev freeglut3-dev clang-12 nasm ninja-build` -2) Run `git clone --recursive https://github.com/cemu-project/Cemu` -3) `cd Cemu` -4) `mkdir build && cd build` -5) `cmake .. -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja` -6) `ninja` +#### For Ubuntu and derivatives: +`sudo apt install -y git cmake ninja-build nasm libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev freeglut3-dev libpulse-dev` +Additionally, for ubuntu 20.04 only: + - `sudo apt install -y clang-12` + - At step 3 while building, use + `cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja` -Build instructions for other distributions will be added in the future! +#### For Arch and derivatives: +`sudo pacman -S git cmake clang ninja nasm base-devel linux-headers gtk3 libsecret libgcrypt systemd freeglut zip libpulse` + +#### For Fedora and derivatives: +`sudo dnf install git cmake clang ninja-build nasm kernel-headers gtk3-devel libsecret-devel libgcrypt-devel systemd-devel freeglut-devel perl-core zlib-devel cubeb-devel` + +### Build Cemu using cmake +1. `git clone --recursive https://github.com/cemu-project/Cemu` +2. `cd Cemu` +3. `cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G Ninja` +4. `cmake --build build` +5. You should now have a Cemu executable file in the /bin folder, which you can run using `./bin/Cemu`. + + +#### Troubleshooting steps + - If step 3 gives you an error about not being able to find ninja, try appending `-DCMAKE_MAKE_PROGRAM=/usr/bin/ninja` to the command and running it again. + - If step 3 fails while compiling the boost-build dependency, it means you don't have a working/good standard library installation. Check the integrity of your system headers and making sure that C++ related packages are installed and intact. + - If step 3 gives a random error, read the `[package-name-and-platform]-out.log` and `[package-name-and-platform]-err.log` for the actual reason to see if you might be lacking the headers from a dependency. + - If step 3 is still failing or if you're not able to find the cause, please make an issue on our Github about it! + - If step 4 gives you an error that contains something like `main.cpp.o: in function 'std::__cxx11::basic_string...`, you likely are experiencing a clang-14 issue. This can only be fixed by either lowering the clang version or using GCC, see below. + - If step 4 gives you a different error, you could report it to this repo or try using GCC. Just make sure your standard library and compilers are updated since Cemu uses a lot of modern features! + +#### Using GCC +While we use and test Cemu using clang, using GCC might work better with your distro (they should be fairly similar performance/issues wise and should only be considered if compilation is the issue). +You can use it by replacing the step 3 with the following: +`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -G Ninja` diff --git a/CMakeLists.txt b/CMakeLists.txt index 82599f2a..12daf566 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,7 @@ if (NOT TARGET glslang::SPIRV AND TARGET SPIRV) add_library(glslang::SPIRV ALIAS SPIRV) endif() -if (UNIX) +if (UNIX AND NOT APPLE) find_package(X11 REQUIRED) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 42decb11..4da455f9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,7 +20,11 @@ if(MSVC) # _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING # _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS elseif(UNIX) - if(NOT APPLE) + if(APPLE) + add_definitions(-D_XOPEN_SOURCE) + add_definitions(-DVK_USE_PLATFORM_MACOS_MVK) + add_definitions(-DVK_USE_PLATFORM_METAL_EXT) + else() add_definitions(-DVK_USE_PLATFORM_XLIB_KHR) # legacy. Do we need to support XLIB surfaces? add_definitions(-DVK_USE_PLATFORM_XCB_KHR) endif() diff --git a/src/Cafe/CMakeLists.txt b/src/Cafe/CMakeLists.txt index 634fe0eb..c27708f3 100644 --- a/src/Cafe/CMakeLists.txt +++ b/src/Cafe/CMakeLists.txt @@ -6,7 +6,13 @@ endif() file(GLOB_RECURSE CPP_FILES *.cpp) file(GLOB_RECURSE H_FILES *.h) -add_library(CemuCafe ${CPP_FILES} ${H_FILES}) + +if(APPLE) + file(GLOB_RECURSE MM_FILES *.mm) + add_library(CemuCafe ${CPP_FILES} ${MM_FILES} ${H_FILES}) +else() + add_library(CemuCafe ${CPP_FILES} ${H_FILES}) +endif() set_property(TARGET CemuCafe PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") diff --git a/src/Cafe/GraphicPack/GraphicPack2.cpp b/src/Cafe/GraphicPack/GraphicPack2.cpp index 0f734675..62d47388 100644 --- a/src/Cafe/GraphicPack/GraphicPack2.cpp +++ b/src/Cafe/GraphicPack/GraphicPack2.cpp @@ -182,6 +182,8 @@ GraphicPack2::GraphicPack2(std::wstring filename, IniParser& rules) m_gfx_vendor = GfxVendor::Mesa; else if (boost::iequals(*option_vendorFilter, "nvidia")) m_gfx_vendor = GfxVendor::Nvidia; + else if (boost::iequals(*option_vendorFilter, "apple")) + m_gfx_vendor = GfxVendor::Apple; else cemuLog_force("Unknown value '{}' for vendorFilter", *option_vendorFilter); } diff --git a/src/Cafe/HW/Latte/Core/LatteConst.h b/src/Cafe/HW/Latte/Core/LatteConst.h index 4cd92977..ffbead1c 100644 --- a/src/Cafe/HW/Latte/Core/LatteConst.h +++ b/src/Cafe/HW/Latte/Core/LatteConst.h @@ -79,6 +79,7 @@ #define GLVENDOR_INTEL_LEGACY (3) #define GLVENDOR_INTEL_NOLEGACY (4) #define GLVENDOR_INTEL (5) +#define GLVENDOR_APPLE (6) // decompiler diff --git a/src/Cafe/HW/Latte/Core/LatteThread.cpp b/src/Cafe/HW/Latte/Core/LatteThread.cpp index ce28c759..9b3dfe8a 100644 --- a/src/Cafe/HW/Latte/Core/LatteThread.cpp +++ b/src/Cafe/HW/Latte/Core/LatteThread.cpp @@ -161,6 +161,8 @@ int Latte_ThreadEntry() case GfxVendor::Nvidia: LatteGPUState.glVendor = GLVENDOR_NVIDIA; break; + case GfxVendor::Apple: + LatteGPUState.glVendor = GLVENDOR_APPLE; default: break; } diff --git a/src/Cafe/HW/Latte/Renderer/Renderer.h b/src/Cafe/HW/Latte/Renderer/Renderer.h index bd57cee1..e58a4ae7 100644 --- a/src/Cafe/HW/Latte/Renderer/Renderer.h +++ b/src/Cafe/HW/Latte/Renderer/Renderer.h @@ -21,6 +21,7 @@ enum class GfxVendor IntelNoLegacy, Intel, Nvidia, + Apple, Mesa, MAX diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/CocoaSurface.h b/src/Cafe/HW/Latte/Renderer/Vulkan/CocoaSurface.h new file mode 100644 index 00000000..b2c0db13 --- /dev/null +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/CocoaSurface.h @@ -0,0 +1,9 @@ +#pragma once + +#if BOOST_OS_MACOS + +#include + +VkSurfaceKHR CreateCocoaSurface(VkInstance instance, void* handle); + +#endif diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/CocoaSurface.mm b/src/Cafe/HW/Latte/Renderer/Vulkan/CocoaSurface.mm new file mode 100644 index 00000000..0dc3b3ec --- /dev/null +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/CocoaSurface.mm @@ -0,0 +1,45 @@ +#include "Cafe/HW/Latte/Renderer/Vulkan/CocoaSurface.h" +#include "Cafe/HW/Latte/Renderer/Vulkan/VulkanAPI.h" + +#import +#import + +@interface MetalView : NSView +@end + +@implementation MetalView + +-(BOOL) wantsUpdateLayer { return YES; } + ++(Class) layerClass { return [CAMetalLayer class]; } + +-(CALayer*) makeBackingLayer { return [self.class.layerClass layer]; } + +@end + +VkSurfaceKHR CreateCocoaSurface(VkInstance instance, void* handle) +{ + NSView* view = (NSView*)handle; + + MetalView* childView = [[MetalView alloc] initWithFrame:view.bounds]; + childView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; + childView.wantsLayer = YES; + + [view addSubview:childView]; + + VkMetalSurfaceCreateInfoEXT surface; + surface.sType = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT; + surface.pNext = NULL; + surface.flags = 0; + surface.pLayer = (CAMetalLayer*)childView.layer; + + VkSurfaceKHR result; + VkResult err; + if ((err = vkCreateMetalSurfaceEXT(instance, &surface, nullptr, &result)) != VK_SUCCESS) + { + forceLog_printf("Cannot create a Metal Vulkan surface: %d", (sint32)err); + throw std::runtime_error(fmt::format("Cannot create a Metal Vulkan surface: {}", err)); + } + + return result; +} diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanAPI.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanAPI.cpp index a60720d1..fd5beb2f 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanAPI.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanAPI.cpp @@ -65,10 +65,14 @@ bool InitializeDeviceVulkan(VkDevice device) void* dlopen_vulkan_loader() { - void* vulkan_so = dlopen("libvulkan.so", RTLD_NOW); - if(!vulkan_so) - vulkan_so = dlopen("libvulkan.so.1", RTLD_NOW); - return vulkan_so; +#if BOOST_OS_LINUX + void* vulkan_so = dlopen("libvulkan.so", RTLD_NOW); + if(!vulkan_so) + vulkan_so = dlopen("libvulkan.so.1", RTLD_NOW); +#elif BOOST_OS_MACOS + void* vulkan_so = dlopen("libMoltenVK.dylib", RTLD_NOW); +#endif + return vulkan_so; } bool InitializeGlobalVulkan() diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanAPI.h b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanAPI.h index bf4e58d0..c1f2dee6 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanAPI.h +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanAPI.h @@ -135,6 +135,10 @@ VKFUNC_INSTANCE(vkCreateXcbSurfaceKHR); VKFUNC_INSTANCE(vkCreateWin32SurfaceKHR); #endif +#if BOOST_OS_MACOS +VKFUNC_INSTANCE(vkCreateMetalSurfaceEXT); +#endif + VKFUNC_INSTANCE(vkDestroySurfaceKHR); VKFUNC_DEVICE(vkCreateSwapchainKHR); VKFUNC_DEVICE(vkDestroySwapchainKHR); diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanPipelineStableCache.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanPipelineStableCache.cpp index 4fab241b..50d5a256 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanPipelineStableCache.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanPipelineStableCache.cpp @@ -34,26 +34,29 @@ uint32 VulkanPipelineStableCache::BeginLoading(uint64 cacheTitleId) std::error_code ec; fs::create_directories(ActiveSettings::GetPath("shaderCache/transferable"), ec); const auto pathCacheFile = ActiveSettings::GetPath("shaderCache/transferable/{:016x}_vkpipeline.bin", cacheTitleId); + // init cache loader state g_vkCacheState.pipelineLoadIndex = 0; g_vkCacheState.pipelineMaxFileIndex = 0; g_vkCacheState.pipelinesLoaded = 0; g_vkCacheState.pipelinesQueued = 0; + // start async compilation threads m_compilationCount.store(0); m_compilationQueue.clear(); + + // get core count uint32 cpuCoreCount = GetPhysicalCoreCount(); m_numCompilationThreads = std::clamp(cpuCoreCount, 1u, 8u); - if (g_renderer->GetVendor() == GfxVendor::Nvidia) - { - forceLog_printf("Disable multi-threaded pipeline loading due to an issue with Nvidia drivers"); + if (VulkanRenderer::GetInstance()->GetDisableMultithreadedCompilation()) m_numCompilationThreads = 1; - } + for (uint32 i = 0; i < m_numCompilationThreads; i++) { std::thread compileThread(&VulkanPipelineStableCache::CompilerThread, this); compileThread.detach(); } + // open cache file or create it cemu_assert_debug(s_cache == nullptr); const uint32 cacheFileVersion = 1; diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp index 5e6119fa..0c28950d 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp @@ -3,6 +3,7 @@ #include "Cafe/HW/Latte/Renderer/Vulkan/LatteTextureVk.h" #include "Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.h" #include "Cafe/HW/Latte/Renderer/Vulkan/VulkanTextureReadback.h" +#include "Cafe/HW/Latte/Renderer/Vulkan/CocoaSurface.h" #include "Cafe/HW/Latte/Core/LatteBufferCache.h" #include "Cafe/HW/Latte/Core/LattePerformanceMonitor.h" @@ -12,6 +13,7 @@ #include "Cafe/CafeSystem.h" #include "util/helpers/helpers.h" +#include "util/helpers/StringHelpers.h" #include "config/ActiveSettings.h" #include "config/CemuConfig.h" @@ -106,6 +108,8 @@ std::vector VulkanRenderer::GetDevices() requiredExtensions.emplace_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME); #elif BOOST_OS_LINUX requiredExtensions.emplace_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME); + #elif BOOST_OS_MACOS + requiredExtensions.emplace_back(VK_EXT_METAL_SURFACE_EXTENSION_NAME); #endif VkApplicationInfo app_info{}; @@ -188,16 +192,38 @@ void VulkanRenderer::DetermineVendor() case 0x1002: m_vendor = GfxVendor::AMD; break; + case 0x106B: + m_vendor = GfxVendor::Apple; + break; } if (IsRunningInWine()) m_vendor = GfxVendor::Mesa; forceLog_printf("Using GPU: %s", properties.properties.deviceName); + if (m_featureControl.deviceExtensions.driver_properties) - forceLog_printf("Driver version: %s", driverProperties.driverInfo) + { + forceLog_printf("Driver version: %s", driverProperties.driverInfo); + + if(m_vendor == GfxVendor::Nvidia) + { + // multithreaded pipelines on nvidia (requires 515 or higher) + m_featureControl.disableMultithreadedCompilation = (StringHelpers::ToInt(std::string(driverProperties.driverInfo)) < 515); + } + } + else + { forceLog_printf("Driver version (as stored in device info): %08X", properties.properties.driverVersion); + + if(m_vendor == GfxVendor::Nvidia) + { + // if the driver does not support the extension, + // it is assumed the driver is under version 515 + m_featureControl.disableMultithreadedCompilation = true; + } + } } void VulkanRenderer::GetDeviceFeatures() @@ -382,8 +408,10 @@ VulkanRenderer::VulkanRenderer() deviceFeatures.independentBlend = VK_TRUE; deviceFeatures.samplerAnisotropy = VK_TRUE; deviceFeatures.imageCubeArray = VK_TRUE; +#if !BOOST_OS_MACOS deviceFeatures.geometryShader = VK_TRUE; deviceFeatures.logicOp = VK_TRUE; +#endif deviceFeatures.occlusionQueryPrecise = VK_TRUE; deviceFeatures.depthClamp = VK_TRUE; deviceFeatures.depthBiasClamp = VK_TRUE; @@ -1145,6 +1173,8 @@ std::vector VulkanRenderer::CheckInstanceExtensionSupport(FeatureCo requiredInstanceExtensions.emplace_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME); #elif BOOST_OS_LINUX requiredInstanceExtensions.emplace_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME); + #elif BOOST_OS_MACOS + requiredInstanceExtensions.emplace_back(VK_EXT_METAL_SURFACE_EXTENSION_NAME); #endif if (cafeLog_isLoggingFlagEnabled(LOG_TYPE_VULKAN_VALIDATION)) requiredInstanceExtensions.emplace_back(VK_EXT_DEBUG_REPORT_EXTENSION_NAME); @@ -1322,8 +1352,7 @@ VkSurfaceKHR VulkanRenderer::CreateFramebufferSurface(VkInstance instance, struc #elif BOOST_OS_LINUX return CreateXlibSurface(instance, windowInfo.xlib_display, windowInfo.xlib_window); #elif BOOST_OS_MACOS - cemu_assert_unimplemented(); - return nullptr; + return CreateCocoaSurface(instance, windowInfo.handle); #endif } diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h index b77bfa53..6b6abf7a 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h @@ -547,7 +547,8 @@ private: uint32 nonCoherentAtomSize = 256; }limits; - bool debugMarkersSupported = false; // frame debugger is attached + bool debugMarkersSupported = false; // frame debugger is attached + bool disableMultithreadedCompilation = false; // for old nvidia drivers }m_featureControl{}; static bool CheckDeviceExtensionSupport(const VkPhysicalDevice device, FeatureControl& info); @@ -1012,7 +1013,8 @@ private: public: - bool useTFViaSSBO() { return m_featureControl.mode.useTFEmulationViaSSBO; }; + bool GetDisableMultithreadedCompilation() { return m_featureControl.disableMultithreadedCompilation; } + bool useTFViaSSBO() { return m_featureControl.mode.useTFEmulationViaSSBO; } bool IsDebugUtilsEnabled() const { return m_featureControl.debugMarkersSupported && m_featureControl.instanceExtensions.debug_utils; diff --git a/src/Common/CMakeLists.txt b/src/Common/CMakeLists.txt index dd7b8f21..a1d5b8ab 100644 --- a/src/Common/CMakeLists.txt +++ b/src/Common/CMakeLists.txt @@ -38,7 +38,7 @@ target_link_libraries(CemuCommon PRIVATE glm::glm ) -if (UNIX) +if (UNIX AND NOT APPLE) target_link_libraries(CemuCommon PRIVATE X11::X11 X11::Xrender X11::Xutil) endif() diff --git a/src/gui/components/wxDownloadManagerList.cpp b/src/gui/components/wxDownloadManagerList.cpp index dce063e9..3e71ca8d 100644 --- a/src/gui/components/wxDownloadManagerList.cpp +++ b/src/gui/components/wxDownloadManagerList.cpp @@ -310,7 +310,7 @@ void wxDownloadManagerList::OnItemSelected(wxListEvent& event) enum ContextMenuEntries { - kContextMenuRetry, + kContextMenuRetry = wxID_HIGHEST + 1, kContextMenuDownload, kContextMenuPause, kContextMenuResume, diff --git a/src/gui/components/wxGameList.cpp b/src/gui/components/wxGameList.cpp index 4c9cdc5f..35f7dfd1 100644 --- a/src/gui/components/wxGameList.cpp +++ b/src/gui/components/wxGameList.cpp @@ -435,7 +435,7 @@ void wxGameList::OnKeyDown(wxListEvent& event) enum ContextMenuEntries { - kContextMenuRefreshGames, + kContextMenuRefreshGames = wxID_HIGHEST + 1, kContextMenuStart, kWikiPage, @@ -655,7 +655,7 @@ void wxGameList::OnColumnRightClick(wxListEvent& event) { enum ItemIds { - ResetWidth, + ResetWidth = wxID_HIGHEST + 1, ResetOrder, ShowName, diff --git a/src/gui/components/wxTitleManagerList.cpp b/src/gui/components/wxTitleManagerList.cpp index 2a40b25d..57983509 100644 --- a/src/gui/components/wxTitleManagerList.cpp +++ b/src/gui/components/wxTitleManagerList.cpp @@ -728,7 +728,7 @@ void wxTitleManagerList::OnItemSelected(wxListEvent& event) enum ContextMenuEntries { - kContextMenuOpenDirectory, + kContextMenuOpenDirectory = wxID_HIGHEST + 1, kContextMenuDelete, kContextMenuLaunch, kContextMenuVerifyGameFiles, diff --git a/src/gui/guiWrapper.cpp b/src/gui/guiWrapper.cpp index c53a3bef..17eb3bc6 100644 --- a/src/gui/guiWrapper.cpp +++ b/src/gui/guiWrapper.cpp @@ -90,6 +90,8 @@ void gui_updateWindowTitles(bool isIdle, bool isLoading, double fps) graphicMode = "[Intel GPU]"; else if (LatteGPUState.glVendor == GLVENDOR_NVIDIA) graphicMode = "[NVIDIA GPU]"; + else if (LatteGPUState.glVendor == GLVENDOR_APPLE) + graphicMode = "[Apple GPU]"; const uint64 titleId = CafeSystem::GetForegroundTitleId(); windowText.append(fmt::format(" - FPS: {:.2f} {} {} [TitleId: {:08x}-{:08x}]", (double)fps, renderer, graphicMode, (uint32)(titleId >> 32), (uint32)(titleId & 0xFFFFFFFF))); @@ -197,6 +199,8 @@ void gui_initHandleContextFromWxWidgetsWindow(WindowHandleInfo& handleInfoOut, c { cemuLog_log(LogType::Force, "Unable to get xlib display"); } +#else + handleInfoOut.handle = wxw->GetHandle(); #endif } diff --git a/src/gui/guiWrapper.h b/src/gui/guiWrapper.h index ecea2f6e..a9d3e1b3 100644 --- a/src/gui/guiWrapper.h +++ b/src/gui/guiWrapper.h @@ -20,6 +20,8 @@ struct WindowHandleInfo //xcb_window_t xcb_window{}; // Wayland // todo +#else + void* handle; #endif }; diff --git a/src/gui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp b/src/gui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp index 93eaa596..26390a6c 100644 --- a/src/gui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp +++ b/src/gui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp @@ -10,7 +10,7 @@ enum { // options - REFRESH_ID, + REFRESH_ID = wxID_HIGHEST + 1, AUTO_REFRESH_ID, CLOSE_ID, GPLIST_ID, diff --git a/src/util/Fiber/FiberUnix.cpp b/src/util/Fiber/FiberUnix.cpp index 9614fc4a..c2ced28b 100644 --- a/src/util/Fiber/FiberUnix.cpp +++ b/src/util/Fiber/FiberUnix.cpp @@ -1,6 +1,5 @@ #include "Fiber.h" #if BOOST_OS_LINUX || BOOST_OS_MACOS -#define _XOPEN_SOURCE #include thread_local Fiber* sCurrentFiber{};