Merge pull request #10714 from OatmealDome/macos-mojave-bump
BuildMacOSUniversalBinary: Bump minimum macOS to 10.14
This commit is contained in:
commit
84944625df
|
@ -64,7 +64,7 @@ DEFAULT_CONFIG = {
|
||||||
|
|
||||||
# Minimum macOS version for each architecture slice
|
# Minimum macOS version for each architecture slice
|
||||||
"arm64_mac_os_deployment_target": "11.0.0",
|
"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
|
# CMake Generator to use for building
|
||||||
"generator": "Unix Makefiles",
|
"generator": "Unix Makefiles",
|
||||||
|
|
|
@ -13,13 +13,6 @@ endif()
|
||||||
|
|
||||||
# Minimum OS X version.
|
# Minimum OS X version.
|
||||||
# This is inserted into the Info.plist as well.
|
# 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_OSX_DEPLOYMENT_TARGET "10.14.0" CACHE STRING "")
|
||||||
|
|
||||||
set(CMAKE_USER_MAKE_RULES_OVERRIDE "CMake/FlagsOverride.cmake")
|
set(CMAKE_USER_MAKE_RULES_OVERRIDE "CMake/FlagsOverride.cmake")
|
||||||
|
|
|
@ -15,7 +15,7 @@ Please read the [FAQ](https://dolphin-emu.org/docs/faq/) before using Dolphin.
|
||||||
* OS
|
* OS
|
||||||
* Windows (10 or higher).
|
* Windows (10 or higher).
|
||||||
* Linux.
|
* 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.
|
* Unix-like systems other than Linux are not officially supported but might work.
|
||||||
* Processor
|
* Processor
|
||||||
* A CPU with SSE2 support.
|
* A CPU with SSE2 support.
|
||||||
|
|
|
@ -41,11 +41,7 @@ void* AllocateExecutableMemory(size_t size)
|
||||||
#else
|
#else
|
||||||
int map_flags = MAP_ANON | MAP_PRIVATE;
|
int map_flags = MAP_ANON | MAP_PRIVATE;
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
// This check is in place to prepare for x86_64 MAP_JIT support. While MAP_JIT did exist
|
map_flags |= MAP_JIT;
|
||||||
// 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;
|
|
||||||
#endif
|
#endif
|
||||||
void* ptr = mmap(nullptr, size, PROT_READ | PROT_WRITE | PROT_EXEC, map_flags, -1, 0);
|
void* ptr = mmap(nullptr, size, PROT_READ | PROT_WRITE | PROT_EXEC, map_flags, -1, 0);
|
||||||
if (ptr == MAP_FAILED)
|
if (ptr == MAP_FAILED)
|
||||||
|
|
|
@ -280,30 +280,6 @@ void VideoBackend::Shutdown()
|
||||||
UnloadVulkanLibrary();
|
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)
|
void VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
|
||||||
{
|
{
|
||||||
#if defined(VK_USE_PLATFORM_METAL_EXT)
|
#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.
|
// Store the layer pointer, that way MoltenVK doesn't call [NSView layer] outside the main thread.
|
||||||
wsi.render_surface = layer;
|
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
|
#endif
|
||||||
}
|
}
|
||||||
} // namespace Vulkan
|
} // namespace Vulkan
|
||||||
|
|
|
@ -215,10 +215,7 @@ const std::vector<std::unique_ptr<VideoBackendBase>>& VideoBackendBase::GetAvail
|
||||||
std::vector<std::unique_ptr<VideoBackendBase>> backends;
|
std::vector<std::unique_ptr<VideoBackendBase>> backends;
|
||||||
|
|
||||||
// OGL > D3D11 > D3D12 > Vulkan > SW > Null
|
// OGL > D3D11 > D3D12 > Vulkan > SW > Null
|
||||||
//
|
// On macOS, we prefer Vulkan over OpenGL due to OpenGL support being deprecated by Apple.
|
||||||
// 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.
|
|
||||||
#ifdef HAS_OPENGL
|
#ifdef HAS_OPENGL
|
||||||
backends.push_back(std::make_unique<OGL::VideoBackend>());
|
backends.push_back(std::make_unique<OGL::VideoBackend>());
|
||||||
#endif
|
#endif
|
||||||
|
@ -228,17 +225,11 @@ const std::vector<std::unique_ptr<VideoBackendBase>>& VideoBackendBase::GetAvail
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_VULKAN
|
#ifdef HAS_VULKAN
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
// If we can run the Vulkan backend, emplace it at the beginning of the vector so
|
// Emplace the Vulkan backend at the beginning so it takes precedence over OpenGL.
|
||||||
// it takes precedence over OpenGL.
|
backends.emplace(backends.begin(), std::make_unique<Vulkan::VideoBackend>());
|
||||||
if (__builtin_available(macOS 10.14, *))
|
#else
|
||||||
{
|
backends.push_back(std::make_unique<Vulkan::VideoBackend>());
|
||||||
backends.emplace(backends.begin(), std::make_unique<Vulkan::VideoBackend>());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
backends.push_back(std::make_unique<Vulkan::VideoBackend>());
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_OPENGL
|
#ifdef HAS_OPENGL
|
||||||
backends.push_back(std::make_unique<SW::VideoSoftware>());
|
backends.push_back(std::make_unique<SW::VideoSoftware>());
|
||||||
|
|
Loading…
Reference in New Issue