From 6b502bcb60f033eda07290bbaf1d8e4b4e91ae27 Mon Sep 17 00:00:00 2001 From: Bill Hollings Date: Mon, 14 Jun 2021 16:24:32 -0400 Subject: [PATCH] Upgrade projects to Xcode 13 SDK APIs. Add MVK_XCODE_13 code macro. Support MTLLanguageVersion2_4 enum value. MoltenVKPackaging project add DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING build setting to suppress build warnings about using manual build orders. --- Common/MVKCommonEnvironment.h | 6 +++++- Docs/Whats_New.md | 1 + MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm | 5 +++++ MoltenVKPackaging.xcodeproj/project.pbxproj | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Common/MVKCommonEnvironment.h b/Common/MVKCommonEnvironment.h index 2e61f97c..e219e2df 100644 --- a/Common/MVKCommonEnvironment.h +++ b/Common/MVKCommonEnvironment.h @@ -87,7 +87,11 @@ extern "C" { # define MVK_MACOS_APPLE_SILICON (MVK_MACOS && MVK_APPLE_SILICON) #endif -/** Building with Xcode 12. */ +/** Building with Xcode versions. */ +#ifndef MVK_XCODE_13 +# define MVK_XCODE_13 ((__MAC_OS_X_VERSION_MAX_ALLOWED >= 120000) || \ + (__IPHONE_OS_VERSION_MAX_ALLOWED >= 150000)) // Also covers tvOS +#endif #ifndef MVK_XCODE_12 # define MVK_XCODE_12 ((__MAC_OS_X_VERSION_MAX_ALLOWED >= 101600) || \ (__IPHONE_OS_VERSION_MAX_ALLOWED >= 140000)) // Also covers tvOS diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md index 46d1951d..6ae284d2 100644 --- a/Docs/Whats_New.md +++ b/Docs/Whats_New.md @@ -39,6 +39,7 @@ Released TBD - Protect against crash when retrieving `MTLTexture` when `VkImage` has no `VkDeviceMemory` bound. - Adjust some `VkPhysicalDeviceLimits` values for Vulkan and Metal compliance. - Fix internal reference from `SPIRV_CROSS_NAMESPACE_OVERRIDE` to `SPIRV_CROSS_NAMESPACE`. +- Support _Xcode 13_ SDK APIs and build settings. diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm index 6ca29717..f08893b0 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm @@ -1532,6 +1532,11 @@ void MVKPhysicalDevice::initMetalFeatures() { _metalFeatures.mslVersion = SPIRV_CROSS_NAMESPACE::CompilerMSL::Options::make_msl_version(maj, min); switch (_metalFeatures.mslVersionEnum) { +#if MVK_XCODE_13 + case MTLLanguageVersion2_4: + setMSLVersion(2, 4); + break; +#endif #if MVK_XCODE_12 case MTLLanguageVersion2_3: setMSLVersion(2, 3); diff --git a/MoltenVKPackaging.xcodeproj/project.pbxproj b/MoltenVKPackaging.xcodeproj/project.pbxproj index 83968ba6..4a92ac47 100644 --- a/MoltenVKPackaging.xcodeproj/project.pbxproj +++ b/MoltenVKPackaging.xcodeproj/project.pbxproj @@ -504,12 +504,14 @@ A90B2B211A9B6170008EE819 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING = YES; }; name = Debug; }; A90B2B221A9B6170008EE819 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING = YES; }; name = Release; };