mac: Allow running without logicOp and update macOS build instructions (#1880)

This commit is contained in:
Emma 2026-04-18 20:57:27 +00:00 committed by GitHub
parent 5ac87ba7f3
commit 02383542b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 2 deletions

View File

@ -153,6 +153,8 @@ you have a recent enough version of Xcode. Xcode 15 is known to work.
### Installing brew
To install the dependencies required to build Cemu, you will need to install Homebrew package manager first. You can do this by running the following command in your terminal:
1. `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
2. Set up the Homebrew shell environment:
- **On an Apple Silicon Mac:** eval `"$(/opt/homebrew/bin/brew shellenv)"`
@ -160,7 +162,24 @@ you have a recent enough version of Xcode. Xcode 15 is known to work.
### Dependencies
`brew install git cmake ninja nasm automake libtool boost molten-vk`
The following dependencies are required. You can install them using Homebrew with the following command:
`brew install git cmake ninja nasm automake libtool boost`
### MoltenVK
Cemu uses the MoltenVK library to provide Vulkan support on macOS. While available on Brew, Cemu requires the "privateapi" version of MoltenVK, which is not available on Brew. To install the required version, follow the instructions below:
1. `curl -L -O https://github.com/KhronosGroup/MoltenVK/releases/download/v1.4.1/MoltenVK-macos-privateapi.tar`
1. `tar xf MoltenVK-macos-privateapi.tar`
1. Create a directory for the MoltenVK dylib if it doesn't already exist:
- **On an Apple Silicon Mac:** `sudo mkdir -p /opt/homebrew/lib`
- **On an Intel Mac:** `sudo mkdir -p /usr/local/lib/`
1. Copy the MoltenVK dylib to your system library directory:
- **On an Apple Silicon Mac:** `sudo cp MoltenVK/lib/libMoltenVK.dylib /opt/homebrew/lib/`
- **On an Intel Mac:** `sudo cp MoltenVK/lib/libMoltenVK.dylib /usr/local/lib/`
Alternatively, you can use the non-privateapi version of MoltenVK, but you may encounter some rendering issues due to the lack of logicOp support. If you want to go this route, simply install MoltenVK from Brew with `brew install molten-vk` and skip the steps above.
### Build Cemu using CMake

View File

@ -614,12 +614,21 @@ VulkanRenderer::VulkanRenderer()
std::set<int> uniqueQueueFamilies = { m_indices.graphicsFamily, m_indices.presentFamily };
std::vector<VkDeviceQueueCreateInfo> queueCreateInfos = CreateQueueCreateInfos(uniqueQueueFamilies);
VkPhysicalDeviceFeatures deviceFeatures = {};
VkPhysicalDeviceFeatures2 deviceFeatures2 = {};
deviceFeatures2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
vkGetPhysicalDeviceFeatures2(m_physicalDevice, &deviceFeatures2);
deviceFeatures.independentBlend = VK_TRUE;
deviceFeatures.samplerAnisotropy = VK_TRUE;
deviceFeatures.imageCubeArray = VK_TRUE;
//moltenVK supports logicOp via private api
deviceFeatures.logicOp = VK_TRUE;
deviceFeatures.logicOp = deviceFeatures2.features.logicOp;
if (!deviceFeatures.logicOp) {
cemuLog_log(LogType::Force, "LogicOp not supported by the driver, some rendering issues might occur");
#if BOOST_OS_MACOS
cemuLog_log(LogType::Force, "Install the privateapi variant of MoltenVK to get logicOp support on macOS");
#endif
}
#if !BOOST_OS_MACOS
deviceFeatures.geometryShader = VK_TRUE;
#endif