Merge pull request #10714 from OatmealDome/macos-mojave-bump

BuildMacOSUniversalBinary: Bump minimum macOS to 10.14
This commit is contained in:
Mai M 2022-06-02 20:20:52 -04:00 committed by GitHub
commit 84944625df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 63 deletions

View File

@ -64,7 +64,7 @@ DEFAULT_CONFIG = {
# Minimum macOS version for each architecture slice
"arm64_mac_os_deployment_target": "11.0.0",
"x86_64_mac_os_deployment_target": "10.13.0",
"x86_64_mac_os_deployment_target": "10.14.0",
# CMake Generator to use for building
"generator": "Unix Makefiles",

View File

@ -13,13 +13,6 @@ endif()
# Minimum OS X version.
# This is inserted into the Info.plist as well.
# MacOS prior to 10.14 did not support aligned alloc which is used to implement
# std::unique_ptr in the arm64 C++ standard library. x86_64 builds can override
# this to 10.13.0 using -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13.0" without issue.
# This is done in the universal binary building script to build a binary that
# runs on 10.13 on x86_64 computers, while still containing an arm64 slice.
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14.0" CACHE STRING "")
set(CMAKE_USER_MAKE_RULES_OVERRIDE "CMake/FlagsOverride.cmake")

View File

@ -15,7 +15,7 @@ Please read the [FAQ](https://dolphin-emu.org/docs/faq/) before using Dolphin.
* OS
* Windows (10 or higher).
* Linux.
* macOS (10.13 High Sierra or higher).
* macOS (10.14 Mojave or higher).
* Unix-like systems other than Linux are not officially supported but might work.
* Processor
* A CPU with SSE2 support.

View File

@ -41,11 +41,7 @@ void* AllocateExecutableMemory(size_t size)
#else
int map_flags = MAP_ANON | MAP_PRIVATE;
#if defined(__APPLE__)
// This check is in place to prepare for x86_64 MAP_JIT support. While MAP_JIT did exist
// prior to 10.14, it had restrictions on the number of JIT allocations that were removed
// in 10.14.
if (__builtin_available(macOS 10.14, *))
map_flags |= MAP_JIT;
map_flags |= MAP_JIT;
#endif
void* ptr = mmap(nullptr, size, PROT_READ | PROT_WRITE | PROT_EXEC, map_flags, -1, 0);
if (ptr == MAP_FAILED)

View File

@ -280,30 +280,6 @@ void VideoBackend::Shutdown()
UnloadVulkanLibrary();
}
#if defined(VK_USE_PLATFORM_METAL_EXT)
static bool IsRunningOnMojaveOrHigher()
{
// id processInfo = [NSProcessInfo processInfo]
id processInfo = reinterpret_cast<id (*)(Class, SEL)>(objc_msgSend)(
objc_getClass("NSProcessInfo"), sel_getUid("processInfo"));
if (!processInfo)
return false;
struct OSVersion // NSOperatingSystemVersion
{
size_t major_version; // NSInteger majorVersion
size_t minor_version; // NSInteger minorVersion
size_t patch_version; // NSInteger patchVersion
};
// const bool meets_requirement = [processInfo isOperatingSystemAtLeastVersion:required_version];
constexpr OSVersion required_version = {10, 14, 0};
const bool meets_requirement = reinterpret_cast<bool (*)(id, SEL, OSVersion)>(objc_msgSend)(
processInfo, sel_getUid("isOperatingSystemAtLeastVersion:"), required_version);
return meets_requirement;
}
#endif
void VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
{
#if defined(VK_USE_PLATFORM_METAL_EXT)
@ -345,17 +321,6 @@ void VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
// Store the layer pointer, that way MoltenVK doesn't call [NSView layer] outside the main thread.
wsi.render_surface = layer;
// The Metal version included with MacOS 10.13 and below does not support several features we
// require. Furthermore, the drivers seem to choke on our shaders (mainly Intel). So, we warn
// the user that this is an unsupported configuration, but permit them to continue.
if (!IsRunningOnMojaveOrHigher())
{
PanicAlertFmtT(
"You are attempting to use the Vulkan (Metal) backend on an unsupported operating system. "
"For all functionality to be enabled, you must use macOS 10.14 (Mojave) or newer. Please "
"do not report any issues encountered unless they also occur on 10.14+.");
}
#endif
}
} // namespace Vulkan

View File

@ -215,10 +215,7 @@ const std::vector<std::unique_ptr<VideoBackendBase>>& VideoBackendBase::GetAvail
std::vector<std::unique_ptr<VideoBackendBase>> backends;
// OGL > D3D11 > D3D12 > Vulkan > SW > Null
//
// On macOS Mojave and newer, we prefer Vulkan over OGL due to outdated drivers.
// However, on macOS High Sierra and older, we still prefer OGL due to its older Metal version
// missing several features required by the Vulkan backend.
// On macOS, we prefer Vulkan over OpenGL due to OpenGL support being deprecated by Apple.
#ifdef HAS_OPENGL
backends.push_back(std::make_unique<OGL::VideoBackend>());
#endif
@ -228,17 +225,11 @@ const std::vector<std::unique_ptr<VideoBackendBase>>& VideoBackendBase::GetAvail
#endif
#ifdef HAS_VULKAN
#ifdef __APPLE__
// If we can run the Vulkan backend, emplace it at the beginning of the vector so
// it takes precedence over OpenGL.
if (__builtin_available(macOS 10.14, *))
{
backends.emplace(backends.begin(), std::make_unique<Vulkan::VideoBackend>());
}
else
// Emplace the Vulkan backend at the beginning so it takes precedence over OpenGL.
backends.emplace(backends.begin(), std::make_unique<Vulkan::VideoBackend>());
#else
backends.push_back(std::make_unique<Vulkan::VideoBackend>());
#endif
{
backends.push_back(std::make_unique<Vulkan::VideoBackend>());
}
#endif
#ifdef HAS_OPENGL
backends.push_back(std::make_unique<SW::VideoSoftware>());