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.
This commit is contained in:
Bill Hollings 2021-06-14 16:24:32 -04:00
parent a7a8a88904
commit 6b502bcb60
4 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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.

View File

@ -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);

View File

@ -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;
};