Support Xcode 14, macOS 13, and iOS/tvOS 16.

- Update minimum Xcode deployment targets to macOS 10.13, iOS 11, and tvOS 11,
  to avoid Xcode build warnings.
- Add support for MTLLanguageVersion3_0 enumeration.
- Build efficiencies:
  - Build scripts create_dylib.sh and gen_moltenvk_rev_hdr.sh
    only run if build dependencies require it.
  - Packaging and copy_to_staging.sh scripts are too complex to define dependencies,
    and are fast, so configured to run every time, to avoid build warning.
- Replace use of deprecated sprintf() with  snprintf().
- Replace use of deprecated kIOMasterPortDefault with  kIOMainPortDefault.
- Support old-style GPU debug capture only if building for earlier minimum
  deployment targets, to avoid deprecation warning.
- Update minimum Xcode deployment targets of Cube demo to macOS 10.14, iOS 12,
  and tvOS 12, to avoid Xcode build warning regarding MTLSharedEvent in .
- Update README.md document regarding minimum Xcode deployment targets.
This commit is contained in:
Bill Hollings 2022-07-06 18:15:10 -04:00
parent 0f722b84fb
commit 26d4a13e34
12 changed files with 144 additions and 51 deletions

View File

@ -353,7 +353,7 @@
MARKETING_VERSION = 1;
PRODUCT_NAME = Cube;
SDKROOT = appletvos;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
};
name = Debug;
};
@ -372,7 +372,7 @@
MARKETING_VERSION = 1;
PRODUCT_NAME = Cube;
SDKROOT = appletvos;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
};
name = Release;
};
@ -387,7 +387,7 @@
MVK_SAMP_CUBE,
);
INFOPLIST_FILE = "$(SRCROOT)/macOS/Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.14;
PRODUCT_NAME = Cube;
SDKROOT = macosx;
};
@ -404,7 +404,7 @@
MVK_SAMP_CUBE,
);
INFOPLIST_FILE = "$(SRCROOT)/macOS/Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.14;
PRODUCT_NAME = Cube;
SDKROOT = macosx;
};
@ -423,7 +423,7 @@
MVK_SAMP_CUBE,
);
INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
MARKETING_VERSION = 1;
PRODUCT_NAME = Cube;
@ -446,7 +446,7 @@
MVK_SAMP_CUBE,
);
INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
MARKETING_VERSION = 1;
PRODUCT_NAME = Cube;

View File

@ -20,8 +20,9 @@ Released TBD
- Add support for extensions:
- `VK_EXT_metal_objects`
- Reducing redundant state changes to improve commend encoding performance.
- Reducing redundant state changes to improve command encoding performance.
- Update minimum Xcode deployment targets to macOS 10.13, iOS 11, and tvOS 11,
to avoid Xcode build warnings in Xcode 14.
MoltenVK 1.1.10

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objectVersion = 54;
objects = {
/* Begin PBXAggregateTarget section */
@ -4095,6 +4095,7 @@
/* Begin PBXShellScriptBuildPhase section */
A9194DE724E8431600FB127B /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -4113,6 +4114,7 @@
};
A9194DEB24E85ABC00FB127B /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -4131,6 +4133,7 @@
};
A9194DEC24E884FC00FB127B /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -4149,6 +4152,7 @@
};
A9194DED24E8851900FB127B /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -4167,6 +4171,7 @@
};
A9194DEE24E8852B00FB127B /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -4185,6 +4190,7 @@
};
A9194DEF24E8853B00FB127B /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -4203,6 +4209,7 @@
};
A9194DF024E8854D00FB127B /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -4221,6 +4228,7 @@
};
A9194DF124E8855F00FB127B /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -4239,6 +4247,7 @@
};
A9194DF224E8856E00FB127B /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -4257,6 +4266,7 @@
};
A9194DF624E8990C00FB127B /* Create XCFramework */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -4275,6 +4285,7 @@
};
A9FC5F8B249DB48D003CB086 /* Package Finish */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -5614,6 +5625,7 @@
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@ -5623,11 +5635,11 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VARIABLE = NO;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.13;
SKIP_INSTALL = YES;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
};
name = Debug;
};
@ -5663,6 +5675,7 @@
GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1";
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@ -5672,11 +5685,11 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VARIABLE = NO;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.13;
SKIP_INSTALL = YES;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
VALIDATE_PRODUCT = YES;
};
name = Release;

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
@ -1148,9 +1148,11 @@
files = (
);
inputPaths = (
"${BUILT_PRODUCTS_DIR}/lib${PRODUCT_NAME}.a",
);
name = "Create Dynamic Library";
outputPaths = (
"${BUILT_PRODUCTS_DIR}/dynamic/lib${PRODUCT_NAME}.dylib",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@ -1162,9 +1164,11 @@
files = (
);
inputPaths = (
"${BUILT_PRODUCTS_DIR}/lib${PRODUCT_NAME}.a",
);
name = "Create Dynamic Library";
outputPaths = (
"${BUILT_PRODUCTS_DIR}/dynamic/lib${PRODUCT_NAME}.dylib",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@ -1175,10 +1179,14 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${BUILT_PRODUCTS_DIR}/lib${PRODUCT_NAME}.a",
);
name = "Create Dynamic Library";
outputPaths = (
"${BUILT_PRODUCTS_DIR}/dynamic/lib${PRODUCT_NAME}.dylib",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@ -1197,6 +1205,7 @@
outputFileListPaths = (
);
outputPaths = (
"$(BUILT_PRODUCTS_DIR)/mvkGitRevDerived.h",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@ -1215,6 +1224,7 @@
outputFileListPaths = (
);
outputPaths = (
"$(BUILT_PRODUCTS_DIR)/mvkGitRevDerived.h",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@ -1233,6 +1243,7 @@
outputFileListPaths = (
);
outputPaths = (
"$(BUILT_PRODUCTS_DIR)/mvkGitRevDerived.h",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@ -1240,6 +1251,7 @@
};
A9CBBFEF24F89F5F006D41EF /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -1258,6 +1270,7 @@
};
A9CBBFF124F89F79006D41EF /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -1276,6 +1289,7 @@
};
A9CBBFF224F89F87006D41EF /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -1592,9 +1606,9 @@
"\"$(SRCROOT)/../External/cereal/include\"",
"\"${BUILT_PRODUCTS_DIR}\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MTL_ENABLE_DEBUG_INFO = YES;
MVK_HIDE_VULKAN_SYMBOLS = 0;
MVK_SKIP_DYLIB = "";
@ -1603,7 +1617,7 @@
PRELINK_LIBS = "${CONFIGURATION_BUILD_DIR}/libMoltenVKShaderConverter.a";
PRODUCT_NAME = MoltenVK;
SKIP_INSTALL = YES;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
WARNING_CFLAGS = "-Wreorder";
};
name = Debug;
@ -1665,9 +1679,9 @@
"\"$(SRCROOT)/../External/cereal/include\"",
"\"${BUILT_PRODUCTS_DIR}\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MTL_ENABLE_DEBUG_INFO = NO;
MVK_HIDE_VULKAN_SYMBOLS = 0;
MVK_SKIP_DYLIB = "";
@ -1676,7 +1690,7 @@
PRELINK_LIBS = "${CONFIGURATION_BUILD_DIR}/libMoltenVKShaderConverter.a";
PRODUCT_NAME = MoltenVK;
SKIP_INSTALL = YES;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
VALIDATE_PRODUCT = YES;
WARNING_CFLAGS = "-Wreorder";
};

View File

@ -1354,6 +1354,11 @@ void MVKPhysicalDevice::initMetalFeatures() {
_metalFeatures.mslVersionEnum = MTLLanguageVersion2_4;
}
#endif
#if MVK_XCODE_14
if ( mvkOSVersionIsAtLeast(16.0) ) {
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_0;
}
#endif
#endif
@ -1463,6 +1468,11 @@ void MVKPhysicalDevice::initMetalFeatures() {
_metalFeatures.mslVersionEnum = MTLLanguageVersion2_4;
}
#endif
#if MVK_XCODE_14
if ( mvkOSVersionIsAtLeast(16.0) ) {
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_0;
}
#endif
#endif
@ -1543,6 +1553,11 @@ void MVKPhysicalDevice::initMetalFeatures() {
_metalFeatures.mslVersionEnum = MTLLanguageVersion2_4;
}
#endif
#if MVK_XCODE_14
if ( mvkOSVersionIsAtLeast(13.0) ) {
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_0;
}
#endif
// This is an Apple GPU--treat it accordingly.
if (supportsMTLGPUFamily(Apple1)) {
@ -1643,6 +1658,11 @@ void MVKPhysicalDevice::initMetalFeatures() {
_metalFeatures.mslVersion = SPIRV_CROSS_NAMESPACE::CompilerMSL::Options::make_msl_version(maj, min);
switch (_metalFeatures.mslVersionEnum) {
#if MVK_XCODE_14
case MTLLanguageVersion3_0:
setMSLVersion(3, 0);
break;
#endif
#if MVK_XCODE_13
case MTLLanguageVersion2_4:
setMSLVersion(2, 4);
@ -1668,7 +1688,7 @@ void MVKPhysicalDevice::initMetalFeatures() {
case MTLLanguageVersion1_1:
setMSLVersion(1, 1);
break;
#if MVK_IOS_OR_TVOS
#if MVK_IOS_OR_TVOS || MVK_XCODE_14
case MTLLanguageVersion1_0:
setMSLVersion(1, 0);
break;
@ -2309,13 +2329,26 @@ void MVKPhysicalDevice::initGPUInfoProperties() {
return;
}
// kIOMasterPortDefault was deprecated and replaced by kIOMainPortDefault in macOS 12,
// and was removed altogether from MacCatalyst in macOS 14 beta.
// Both are documented to resolve to MACH_PORT_NULL.
#if MVK_XCODE_13
# if MVK_MACCAT
const mach_port_t kIOMainPortDefaultMVK = mvkOSVersionIsAtLeast(12.0) ? kIOMainPortDefault : MACH_PORT_NULL;
# else
const mach_port_t kIOMainPortDefaultMVK = mvkOSVersionIsAtLeast(12.0) ? kIOMainPortDefault : kIOMasterPortDefault;
# endif
#else
const mach_port_t kIOMainPortDefaultMVK = kIOMasterPortDefault;
#endif
// If the device has an associated registry ID, we can use that to get the associated IOKit node.
// The match dictionary is consumed by IOServiceGetMatchingServices and does not need to be released.
bool isFound = false;
io_registry_entry_t entry;
uint64_t regID = mvkGetRegistryID(_mtlDevice);
if (regID) {
entry = IOServiceGetMatchingService(kIOMasterPortDefault, IORegistryEntryIDMatching(regID));
entry = IOServiceGetMatchingService(kIOMainPortDefaultMVK, IORegistryEntryIDMatching(regID));
if (entry) {
// That returned the IOGraphicsAccelerator nub. Its parent, then, is the actual PCI device.
io_registry_entry_t parent;
@ -2331,7 +2364,7 @@ void MVKPhysicalDevice::initGPUInfoProperties() {
// Iterate all GPU's, looking for a match.
// The match dictionary is consumed by IOServiceGetMatchingServices and does not need to be released.
io_iterator_t entryIterator;
if (!isFound && IOServiceGetMatchingServices(kIOMasterPortDefault,
if (!isFound && IOServiceGetMatchingServices(kIOMainPortDefaultMVK,
IOServiceMatching("IOPCIDevice"),
&entryIterator) == kIOReturnSuccess) {
while ( !isFound && (entry = IOIteratorNext(entryIterator)) ) {

View File

@ -218,8 +218,9 @@ MVKQueue::MVKQueue(MVKDevice* device, MVKQueueFamily* queueFamily, uint32_t inde
void MVKQueue::initName() {
const char* fmt = "MoltenVKQueue-%d-%d-%.1f";
char name[256];
sprintf(name, fmt, _queueFamily->getIndex(), _index, _priority);
size_t nameLen = 256;
char name[nameLen];
snprintf(name, nameLen, fmt, _queueFamily->getIndex(), _index, _priority);
_name = name;
}

View File

@ -25,18 +25,25 @@
#pragma mark -
#pragma mark MVKGPUCaptureScope
/** Old-style debug capture was deprecated in macOS 10.13 and iOS 11.0, and is not available on Mac Catalyst. */
#if MVK_MACOS
static MVKOSVersion kMinOSVersionMTLCaptureScope = 10.13;
# define MVK_NEED_OLD_DEBUG_CAPTURE (__MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_13) && !MVK_MACCAT
#endif
#if MVK_IOS_OR_TVOS
static MVKOSVersion kMinOSVersionMTLCaptureScope = 11.0;
#if MVK_IOS
# define MVK_NEED_OLD_DEBUG_CAPTURE (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_11_0)
#endif
#if MVK_TVOS
# define MVK_NEED_OLD_DEBUG_CAPTURE (__TV_OS_VERSION_MIN_REQUIRED < __TVOS_11_0)
#endif
void MVKGPUCaptureScope::beginScope() {
if (_mtlCaptureScope) {
[_mtlCaptureScope beginScope];
} else if (_isDefault && _isFirstBoundary) {
#if !MVK_MACCAT
#if MVK_NEED_OLD_DEBUG_CAPTURE
[_mtlQueue insertDebugCaptureBoundary];
#endif
}
@ -47,7 +54,7 @@ void MVKGPUCaptureScope::endScope() {
if (_mtlCaptureScope) {
[_mtlCaptureScope endScope];
} else if (_isDefault) {
#if !MVK_MACCAT
#if MVK_NEED_OLD_DEBUG_CAPTURE
[_mtlQueue insertDebugCaptureBoundary];
#endif
}
@ -62,18 +69,22 @@ void MVKGPUCaptureScope::makeDefault() {
MVKGPUCaptureScope::MVKGPUCaptureScope(MVKQueue* mvkQueue) {
_mtlQueue = [mvkQueue->getMTLCommandQueue() retain]; // retained
if (mvkOSVersionIsAtLeast(kMinOSVersionMTLCaptureScope)) {
if (mvkOSVersionIsAtLeast(10.13, 11.0)) {
_mtlCaptureScope = [[MTLCaptureManager sharedCaptureManager] newCaptureScopeWithCommandQueue: _mtlQueue]; // retained
_mtlCaptureScope.label = @(mvkQueue->getName().c_str());
// Due to a retain bug in Metal when the capture layer is installed, capture scopes
// can have too many references on them. Release the excess references so the scope--
// and the command queue--aren't leaked. This is a horrible kludge that depends on
// Apple not taking internal references to capture scopes, but without it, we could
// get hung up waiting for a new queue, because the old queues are still outstanding.
// Due to an retain bug in Metal when the capture layer is installed, capture scopes
// on older OS versions can have too many references on them. If so, release the excess
// references so the scope, and command queue, aren't leaked. This is a horrible kludge
// that depends on Apple not taking internal references to capture scopes, but without it,
// we could get hung up waiting for a new queue, because the old queues are still outstanding.
// This bug was fixed by Apple in macOS 13 and iOS 16.
if ( !mvkOSVersionIsAtLeast(13.0, 16.0) ) {
while (_mtlCaptureScope.retainCount > 1) {
[_mtlCaptureScope release];
}
}
}
}
MVKGPUCaptureScope::~MVKGPUCaptureScope() {

View File

@ -129,8 +129,9 @@ VkResult MVKBaseObject::reportError(MVKBaseObject* mvkObj, VkResult vkErr, const
// Prepend the error code to the format string
const char* vkRsltName = mvkVkResultName(vkErr);
char fmtStr[strlen(vkRsltName) + strlen(format) + 4];
sprintf(fmtStr, "%s: %s", vkRsltName, format);
size_t rsltLen = strlen(vkRsltName) + strlen(format) + 4;
char fmtStr[rsltLen];
snprintf(fmtStr, rsltLen, "%s: %s", vkRsltName, format);
// Report the error
va_list lclArgs;

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objectVersion = 54;
objects = {
/* Begin PBXAggregateTarget section */
@ -376,6 +376,7 @@
/* Begin PBXShellScriptBuildPhase section */
2FEA0A3424902F5E00EEF3AD /* Package MoltenVK */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -390,6 +391,7 @@
};
A975D5872140585200D4834F /* Package MoltenVK */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -404,6 +406,7 @@
};
A975D59A2140586700D4834F /* Package MoltenVK */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -418,6 +421,7 @@
};
A9AD70122440ED3B00B9E254 /* Package MoltenVK */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -432,6 +436,7 @@
};
A9B1008824F84BE400EADC6E /* Package MoltenVK */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
@ -398,6 +398,7 @@
/* Begin PBXShellScriptBuildPhase section */
A93ED4E724F59E0900FEB018 /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -416,6 +417,7 @@
};
A93ED4E824F59E1100FEB018 /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -434,6 +436,7 @@
};
A93ED4E924F59E1800FEB018 /* Copy to Staging */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -630,12 +633,12 @@
"\"$(SRCROOT)/glslang\"",
"\"$(SRCROOT)/glslang/External/spirv-tools/include\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_NAME = MoltenVKShaderConverter;
SKIP_INSTALL = YES;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
WARNING_CFLAGS = "-Wreorder";
};
name = Debug;
@ -690,12 +693,12 @@
"\"$(SRCROOT)/glslang\"",
"\"$(SRCROOT)/glslang/External/spirv-tools/include\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_NAME = MoltenVKShaderConverter;
SKIP_INSTALL = YES;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
VALIDATE_PRODUCT = YES;
WARNING_CFLAGS = "-Wreorder";
};

View File

@ -71,6 +71,11 @@ bool mvk::compile(const string& mslSourceCode,
#define mslVer(MJ, MN, PT) mslVersionMajor == MJ && mslVersionMinor == MN && mslVersionPoint == PT
MTLLanguageVersion mslVerEnum = (MTLLanguageVersion)0;
#if MVK_XCODE_14
if (mslVer(3, 0, 0)) {
mslVerEnum = MTLLanguageVersion3_0;
} else
#endif
#if MVK_XCODE_13
if (mslVer(2, 4, 0)) {
mslVerEnum = MTLLanguageVersion2_4;

View File

@ -158,6 +158,12 @@ Building **MoltenVK**
During building, **MoltenVK** references the latest *Apple SDK* frameworks. To access these frameworks,
and to avoid build errors, be sure to use the latest publicly available version of *Xcode*.
**MoltenVK** can be built to support at least *macOS 10.11*, *iOS 9*, or *tvOS 9*, but the default
_Xcode_ build settings in the included _Xcode_ projects are set to a minimum deployment target of
*macOS 10.13*, *iOS 11*, and *tvOS 11*, which are the oldest OS versions supported by the current
_Xcode_ version. If you require support for earlier OS versions, modify the `MACOSX_DEPLOYMENT_TARGET`,
`IPHONEOS_DEPLOYMENT_TARGET`, or `TVOS_DEPLOYMENT_TARGET` build settings in _Xcode_ before building **MoltenVK**.
>***Note:*** To support `IOSurfaces` on *iOS* or *tvOS*, **MoltenVK**, and any app that uses
**MoltenVK**, must be built with a minimum **iOS Deployment Target** (aka `IPHONEOS_DEPLOYMENT_TARGET `)
build setting of `iOS 11.0` or greater, or a minimum **tvOS Deployment Target** (aka `TVOS_DEPLOYMENT_TARGET `)