Merge pull request #935 from billhollings/master
Support iOS Simulator and tvOS Simulator, plus further tvOS integration
diff --git a/.travis.yml b/.travis.yml
index 3856b71..f8f5274 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,9 +6,9 @@
# Build dependencies with verbose logging to avoid Travis timing out.
install:
- - ./fetchDependencies -v
+ - ./fetchDependencies -v --macos
script:
- - xcodebuild -project MoltenVKPackaging.xcodeproj -scheme "MoltenVK Package"
- - xcodebuild -workspace Demos/Demos.xcworkspace -scheme "Cube-macOS"
+ - xcodebuild build -project MoltenVKPackaging.xcodeproj -scheme "MoltenVK Package (macOS only)"
+ - xcodebuild build -workspace Demos/Demos.xcworkspace -scheme "Cube-macOS"
diff --git a/Common/MVKCommonEnvironment.h b/Common/MVKCommonEnvironment.h
index 4e1d348..502a4c9 100644
--- a/Common/MVKCommonEnvironment.h
+++ b/Common/MVKCommonEnvironment.h
@@ -24,58 +24,62 @@
#endif // __cplusplus
-#include <Availability.h>
+#include <TargetConditionals.h>
/**
- * Compiler build setting that ensures a definite value for whether this build is
- * a debug build or not.
+ * Compiler build setting that ensures a definite value for whether this
+ * build is a debug build or not.
*
* If the standard DEBUG build setting is defined, MVK_DEBUG is set to true,
* otherwise, it is set to false.
*/
#ifndef MVK_DEBUG
# ifdef DEBUG
-# define MVK_DEBUG 1
+# define MVK_DEBUG 1
# else
-# define MVK_DEBUG 0
-# endif // DEBUG
-#endif // MVK_DEBUG
-
-/** Building for tvOS. Use ifdef instead of defined() operator to allow MVK_TVOS to be used in expansions */
-#ifndef MVK_TVOS
-# ifdef __TV_OS_VERSION_MAX_ALLOWED
-# define MVK_TVOS 1
-# else
-# define MVK_TVOS 0
-# endif
+# define MVK_DEBUG 0
+# endif
#endif
-/** Building for iOS or tvOS. Use ifdef instead of defined() operator to allow MVK_IOS_OR_TVOS to be used in expansions */
-#ifndef MVK_IOS_OR_TVOS
-# if __IPHONE_OS_VERSION_MAX_ALLOWED
-# define MVK_IOS_OR_TVOS 1
-# else
-# define MVK_IOS_OR_TVOS 0
-# endif
-#endif
-
-/** Building for iOS. Use ifdef instead of defined() operator to allow MVK_IOS to be used in expansions */
-#ifndef MVK_IOS
-# if MVK_IOS_OR_TVOS && !MVK_TVOS
-# define MVK_IOS 1
-# else
-# define MVK_IOS 0
-# endif
-#endif
-
-/** Building for macOS. Use ifdef instead of defined() operator to allow MVK_MACOS to be used in expansions */
+/** Building for macOS. */
#ifndef MVK_MACOS
-# ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
-# define MVK_MACOS 1
-# else
-# define MVK_MACOS 0
-# endif
+# define MVK_MACOS TARGET_OS_OSX
+#endif
+
+/** Building for iOS. */
+#ifndef MVK_IOS
+# define MVK_IOS TARGET_OS_IOS
+#endif
+
+/** Building for tvOS. */
+#ifndef MVK_TVOS
+# define MVK_TVOS TARGET_OS_TV
+#endif
+
+/** Building for iOS or tvOS. */
+#ifndef MVK_IOS_OR_TVOS
+# define MVK_IOS_OR_TVOS (MVK_IOS || MVK_TVOS)
+#endif
+
+/** Building for macOS or iOS. */
+#ifndef MVK_MACOS_OR_IOS
+# define MVK_MACOS_OR_IOS (MVK_MACOS || MVK_IOS)
+#endif
+
+/** Building for a Simulator. */
+#ifndef MVK_OS_SIMULATOR
+# define MVK_OS_SIMULATOR TARGET_OS_SIMULATOR
+#endif
+
+/** Building for iOS Simulator. */
+#ifndef MVK_IOS_SIMULATOR
+# define MVK_IOS_SIMULATOR (MVK_IOS && MVK_OS_SIMULATOR)
+#endif
+
+/** Building for tvOS Simulator. */
+#ifndef MVK_TVOS_SIMULATOR
+# define MVK_TVOS_SIMULATOR (MVK_TVOS && MVK_OS_SIMULATOR)
#endif
/** Directive to identify public symbols. */
diff --git a/Common/MVKOSExtensions.mm b/Common/MVKOSExtensions.mm
index 5110334..c4d58f8 100644
--- a/Common/MVKOSExtensions.mm
+++ b/Common/MVKOSExtensions.mm
@@ -97,7 +97,7 @@
#pragma mark System memory
uint64_t mvkGetSystemMemorySize() {
-#if MVK_MACOS || MVK_IOS
+#if MVK_MACOS_OR_IOS
mach_msg_type_number_t host_size = HOST_BASIC_INFO_COUNT;
host_basic_info_data_t info;
if (host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)&info, &host_size) == KERN_SUCCESS) {
diff --git a/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/project.pbxproj b/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/project.pbxproj
index 145fcef..00a24ff 100644
--- a/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/project.pbxproj
+++ b/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/project.pbxproj
@@ -641,6 +641,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
+ CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"\"$(SRCROOT)/../../../MoltenVK/iOS/framework\"",
@@ -655,6 +656,7 @@
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+ MARKETING_VERSION = 1;
PRODUCT_BUNDLE_IDENTIFIER = "com.moltenvk.API-Samples";
PRODUCT_NAME = "API-Samples";
SDKROOT = iphoneos;
@@ -666,6 +668,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
+ CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"\"$(SRCROOT)/../../../MoltenVK/iOS/framework\"",
@@ -676,6 +679,7 @@
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+ MARKETING_VERSION = 1;
PRODUCT_BUNDLE_IDENTIFIER = "com.moltenvk.API-Samples";
PRODUCT_NAME = "API-Samples";
SDKROOT = iphoneos;
diff --git a/Demos/LunarG-VulkanSamples/API-Samples/iOS/Info.plist b/Demos/LunarG-VulkanSamples/API-Samples/iOS/Info.plist
index dcbf9e8..8101a17 100644
--- a/Demos/LunarG-VulkanSamples/API-Samples/iOS/Info.plist
+++ b/Demos/LunarG-VulkanSamples/API-Samples/iOS/Info.plist
@@ -16,10 +16,14 @@
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
- <string>1.0</string>
+ <string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>UIMainStoryboardFile</key>
diff --git a/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/project.pbxproj b/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/project.pbxproj
index 2766dab..6176253 100644
--- a/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/project.pbxproj
+++ b/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/project.pbxproj
@@ -7,6 +7,15 @@
objects = {
/* Begin PBXBuildFile section */
+ A93DBF3C24A2A4D500079F64 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = A9B67B761C3AAE9800373FFD /* Icon.png */; };
+ A93DBF3E24A2A4D500079F64 /* Default~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = A9B67B751C3AAE9800373FFD /* Default~ipad.png */; };
+ A93DBF3F24A2A4D500079F64 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9B67B741C3AAE9800373FFD /* Default-568h@2x.png */; };
+ A93DBF4124A2A4D500079F64 /* DemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B6F1C3AAE9800373FFD /* DemoViewController.m */; };
+ A93DBF4224A2A4D500079F64 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B6C1C3AAE9800373FFD /* AppDelegate.m */; };
+ A93DBF4324A2A4D500079F64 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B711C3AAE9800373FFD /* main.m */; };
+ A93DBF4E24A2A6F000079F64 /* libMoltenVK.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A93DBF4D24A2A6F000079F64 /* libMoltenVK.dylib */; };
+ A93DBF4F24A2A6F000079F64 /* libMoltenVK.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = A93DBF4D24A2A6F000079F64 /* libMoltenVK.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
+ A94D4CB724A2C9A3009C9139 /* MainTV.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A94D4CB624A2C9A3009C9139 /* MainTV.storyboard */; };
A9B53B151C3AC0BE00ABC6F6 /* macOS.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A9B67B8B1C3AAEA200373FFD /* macOS.xcassets */; };
A9B53B161C3AC0BE00ABC6F6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A9B67B8A1C3AAEA200373FFD /* Main.storyboard */; };
A9B53B181C3AC0BE00ABC6F6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B831C3AAEA200373FFD /* AppDelegate.m */; };
@@ -36,6 +45,16 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ A93DBF4624A2A4D500079F64 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ A93DBF4F24A2A6F000079F64 /* libMoltenVK.dylib in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
A9B2A5571D7E4FC400F66656 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
@@ -52,6 +71,10 @@
A904B5301C9A08C90008C013 /* cube.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cube.c; sourceTree = "<group>"; };
A904B5311C9A08C90008C013 /* cube.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = cube.frag; sourceTree = "<group>"; };
A904B5331C9A08C90008C013 /* cube.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = cube.vert; sourceTree = "<group>"; };
+ A93DBF4B24A2A4D500079F64 /* Cube.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Cube.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ A93DBF4D24A2A6F000079F64 /* libMoltenVK.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libMoltenVK.dylib; path = ../../../MoltenVK/tvOS/dynamic/libMoltenVK.dylib; sourceTree = "<group>"; };
+ A94D4CB424A2A95E009C9139 /* InfoTV.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = InfoTV.plist; sourceTree = "<group>"; };
+ A94D4CB624A2C9A3009C9139 /* MainTV.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = MainTV.storyboard; sourceTree = "<group>"; };
A9B53B271C3AC0BE00ABC6F6 /* Cube.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Cube.app; sourceTree = BUILT_PRODUCTS_DIR; };
A9B53B431C3AC15200ABC6F6 /* Cube.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Cube.app; sourceTree = BUILT_PRODUCTS_DIR; };
A9B67B6B1C3AAE9800373FFD /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
@@ -79,6 +102,14 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
+ A93DBF4424A2A4D500079F64 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ A93DBF4E24A2A6F000079F64 /* libMoltenVK.dylib in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
A9B53B1B1C3AC0BE00ABC6F6 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -103,6 +134,7 @@
children = (
A9B53B271C3AC0BE00ABC6F6 /* Cube.app */,
A9B53B431C3AC15200ABC6F6 /* Cube.app */,
+ A93DBF4B24A2A4D500079F64 /* Cube.app */,
);
name = Products;
sourceTree = "<group>";
@@ -138,6 +170,7 @@
A9B67B6E1C3AAE9800373FFD /* DemoViewController.h */,
A9B67B6F1C3AAE9800373FFD /* DemoViewController.m */,
A9B67B701C3AAE9800373FFD /* Info.plist */,
+ A94D4CB424A2A95E009C9139 /* InfoTV.plist */,
A9B67B711C3AAE9800373FFD /* main.m */,
A9B67B721C3AAE9800373FFD /* Prefix.pch */,
A9B67B731C3AAE9800373FFD /* Resources */,
@@ -152,6 +185,7 @@
A9B67B751C3AAE9800373FFD /* Default~ipad.png */,
A9B67B761C3AAE9800373FFD /* Icon.png */,
A9B67B771C3AAE9800373FFD /* Main.storyboard */,
+ A94D4CB624A2C9A3009C9139 /* MainTV.storyboard */,
);
path = Resources;
sourceTree = "<group>";
@@ -183,6 +217,7 @@
A9C2ABA82185085B00DDBC03 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ A93DBF4D24A2A6F000079F64 /* libMoltenVK.dylib */,
A9C2ABAB2185086D00DDBC03 /* libMoltenVK.dylib */,
A9C2ABA92185085B00DDBC03 /* libMoltenVK.dylib */,
);
@@ -192,6 +227,24 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
+ A93DBF3A24A2A4D500079F64 /* Cube-tvOS */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = A93DBF4824A2A4D500079F64 /* Build configuration list for PBXNativeTarget "Cube-tvOS" */;
+ buildPhases = (
+ A93DBF3B24A2A4D500079F64 /* Resources */,
+ A93DBF4024A2A4D500079F64 /* Sources */,
+ A93DBF4424A2A4D500079F64 /* Frameworks */,
+ A93DBF4624A2A4D500079F64 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "Cube-tvOS";
+ productName = foo;
+ productReference = A93DBF4B24A2A4D500079F64 /* Cube.app */;
+ productType = "com.apple.product-type.application";
+ };
A9B53B0F1C3AC0BE00ABC6F6 /* Cube-macOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = A9B53B241C3AC0BE00ABC6F6 /* Build configuration list for PBXNativeTarget "Cube-macOS" */;
@@ -252,12 +305,24 @@
projectRoot = "";
targets = (
A9B53B291C3AC15200ABC6F6 /* Cube-iOS */,
+ A93DBF3A24A2A4D500079F64 /* Cube-tvOS */,
A9B53B0F1C3AC0BE00ABC6F6 /* Cube-macOS */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
+ A93DBF3B24A2A4D500079F64 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ A93DBF3C24A2A4D500079F64 /* Icon.png in Resources */,
+ A94D4CB724A2C9A3009C9139 /* MainTV.storyboard in Resources */,
+ A93DBF3E24A2A4D500079F64 /* Default~ipad.png in Resources */,
+ A93DBF3F24A2A4D500079F64 /* Default-568h@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
A9B53B141C3AC0BE00ABC6F6 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -281,6 +346,16 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
+ A93DBF4024A2A4D500079F64 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ A93DBF4124A2A4D500079F64 /* DemoViewController.m in Sources */,
+ A93DBF4224A2A4D500079F64 /* AppDelegate.m in Sources */,
+ A93DBF4324A2A4D500079F64 /* main.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
A9B53B171C3AC0BE00ABC6F6 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -304,6 +379,48 @@
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
+ A93DBF4924A2A4D500079F64 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CURRENT_PROJECT_VERSION = 1;
+ DEVELOPMENT_TEAM = "";
+ GCC_PREFIX_HEADER = "$(SRCROOT)/iOS/Prefix.pch";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(inherited)",
+ MVK_SAMP_CUBE,
+ );
+ INFOPLIST_FILE = "$(SRCROOT)/iOS/InfoTV.plist";
+ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
+ LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/tvOS/dynamic\"";
+ MARKETING_VERSION = 1;
+ PRODUCT_NAME = Cube;
+ SDKROOT = appletvos;
+ TVOS_DEPLOYMENT_TARGET = 9.0;
+ };
+ name = Debug;
+ };
+ A93DBF4A24A2A4D500079F64 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CURRENT_PROJECT_VERSION = 1;
+ DEVELOPMENT_TEAM = "";
+ GCC_PREFIX_HEADER = "$(SRCROOT)/iOS/Prefix.pch";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(inherited)",
+ MVK_SAMP_CUBE,
+ );
+ INFOPLIST_FILE = "$(SRCROOT)/iOS/InfoTV.plist";
+ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
+ LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/tvOS/dynamic\"";
+ MARKETING_VERSION = 1;
+ PRODUCT_NAME = Cube;
+ SDKROOT = appletvos;
+ TVOS_DEPLOYMENT_TARGET = 9.0;
+ };
+ name = Release;
+ };
A9B53B251C3AC0BE00ABC6F6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -346,6 +463,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
+ CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
GCC_PREFIX_HEADER = "$(SRCROOT)/iOS/Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -356,6 +474,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/iOS/dynamic\"";
+ MARKETING_VERSION = 1;
PRODUCT_NAME = Cube;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -366,6 +485,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
+ CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
GCC_PREFIX_HEADER = "$(SRCROOT)/iOS/Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -376,6 +496,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/iOS/dynamic\"";
+ MARKETING_VERSION = 1;
PRODUCT_NAME = Cube;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -440,6 +561,15 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
+ A93DBF4824A2A4D500079F64 /* Build configuration list for PBXNativeTarget "Cube-tvOS" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ A93DBF4924A2A4D500079F64 /* Debug */,
+ A93DBF4A24A2A4D500079F64 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
A9B53B241C3AC0BE00ABC6F6 /* Build configuration list for PBXNativeTarget "Cube-macOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
diff --git a/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/xcshareddata/xcschemes/Cube-tvOS.xcscheme b/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/xcshareddata/xcschemes/Cube-tvOS.xcscheme
new file mode 100644
index 0000000..85fc258
--- /dev/null
+++ b/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/xcshareddata/xcschemes/Cube-tvOS.xcscheme
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "1150"
+ version = "2.0">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "A93DBF3A24A2A4D500079F64"
+ BuildableName = "Cube.app"
+ BlueprintName = "Cube-tvOS"
+ ReferencedContainer = "container:Cube.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "A9B53B291C3AC15200ABC6F6"
+ BuildableName = "Cube.app"
+ BlueprintName = "Cube-iOS"
+ ReferencedContainer = "container:Cube.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <Testables>
+ </Testables>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Release"
+ selectedDebuggerIdentifier = ""
+ selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugXPCServices = "NO"
+ debugServiceExtension = "internal"
+ enableGPUFrameCaptureMode = "3"
+ enableGPUValidationMode = "1"
+ allowLocationSimulation = "NO"
+ viewDebuggingEnabled = "No"
+ queueDebuggingEnabled = "No">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "A93DBF3A24A2A4D500079F64"
+ BuildableName = "Cube.app"
+ BlueprintName = "Cube-tvOS"
+ ReferencedContainer = "container:Cube.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/Demos/LunarG-VulkanSamples/Cube/iOS/DemoViewController.m b/Demos/LunarG-VulkanSamples/Cube/iOS/DemoViewController.m
index 282858d..6d0f749 100644
--- a/Demos/LunarG-VulkanSamples/Cube/iOS/DemoViewController.m
+++ b/Demos/LunarG-VulkanSamples/Cube/iOS/DemoViewController.m
@@ -42,8 +42,14 @@
self.view.contentScaleFactor = UIScreen.mainScreen.nativeScale;
- const char* arg = "cube";
- demo_main(&demo, self.view.layer, 1, &arg);
+#if TARGET_OS_SIMULATOR
+ // Avoid linear host-coherent texture loading on simulator
+ const char* argv[] = { "cube", "--use_staging" };
+#else
+ const char* argv[] = { "cube" };
+#endif
+ int argc = sizeof(argv)/sizeof(char*);
+ demo_main(&demo, self.view.layer, argc, argv);
demo_draw(&demo);
uint32_t fps = 60;
diff --git a/Demos/LunarG-VulkanSamples/Cube/iOS/Info.plist b/Demos/LunarG-VulkanSamples/Cube/iOS/Info.plist
index d04a669..d05fce6 100644
--- a/Demos/LunarG-VulkanSamples/Cube/iOS/Info.plist
+++ b/Demos/LunarG-VulkanSamples/Cube/iOS/Info.plist
@@ -16,10 +16,14 @@
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
- <string>1.0</string>
+ <string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>UIMainStoryboardFile</key>
diff --git a/Demos/LunarG-VulkanSamples/Cube/iOS/InfoTV.plist b/Demos/LunarG-VulkanSamples/Cube/iOS/InfoTV.plist
new file mode 100644
index 0000000..0572c72
--- /dev/null
+++ b/Demos/LunarG-VulkanSamples/Cube/iOS/InfoTV.plist
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string>iOS/Resources/Icon.png</string>
+ <key>CFBundleIcons~ipad</key>
+ <dict/>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>$(MARKETING_VERSION)</string>
+ <key>CFBundleVersion</key>
+ <string>$(CURRENT_PROJECT_VERSION)</string>
+ <key>LSApplicationCategoryType</key>
+ <string></string>
+ <key>UIMainStoryboardFile</key>
+ <string>MainTV</string>
+ <key>UIRequiresFullScreen</key>
+ <true/>
+ <key>UIStatusBarHidden</key>
+ <true/>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ </array>
+ <key>UIViewControllerBasedStatusBarAppearance</key>
+ <false/>
+</dict>
+</plist>
diff --git a/Demos/LunarG-VulkanSamples/Cube/iOS/Resources/Main.storyboard b/Demos/LunarG-VulkanSamples/Cube/iOS/Resources/Main.storyboard
index 6205491..3a135f3 100644
--- a/Demos/LunarG-VulkanSamples/Cube/iOS/Resources/Main.storyboard
+++ b/Demos/LunarG-VulkanSamples/Cube/iOS/Resources/Main.storyboard
@@ -1,7 +1,9 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15A279b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vmV-Wi-8wg">
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vmV-Wi-8wg">
+ <device id="ipad9_7" orientation="portrait" layout="fullscreen" appearance="light"/>
<dependencies>
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Demo View Controller-->
@@ -13,9 +15,8 @@
<viewControllerLayoutGuide type="bottom" id="lMV-Es-kLU"/>
</layoutGuides>
<view key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="xKx-Gc-5Is" customClass="DemoView">
- <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+ <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <animations/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ERB-qy-6pP" userLabel="First Responder" sceneMemberID="firstResponder"/>
diff --git a/Demos/LunarG-VulkanSamples/Cube/iOS/Resources/MainTV.storyboard b/Demos/LunarG-VulkanSamples/Cube/iOS/Resources/MainTV.storyboard
new file mode 100644
index 0000000..8612a88
--- /dev/null
+++ b/Demos/LunarG-VulkanSamples/Cube/iOS/Resources/MainTV.storyboard
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="16097" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="fFL-Fw-4sa">
+ <device id="appleTV" appearance="light"/>
+ <dependencies>
+ <deployment identifier="tvOS"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
+ <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+ </dependencies>
+ <scenes>
+ <!--Demo View Controller-->
+ <scene sceneID="4X5-3H-4Vr">
+ <objects>
+ <viewController id="fFL-Fw-4sa" customClass="DemoViewController" sceneMemberID="viewController">
+ <layoutGuides>
+ <viewControllerLayoutGuide type="top" id="BnD-cI-3CU"/>
+ <viewControllerLayoutGuide type="bottom" id="Hbq-NS-8mc"/>
+ </layoutGuides>
+ <view key="view" contentMode="scaleToFill" id="xhu-n8-sOz" customClass="DemoView">
+ <rect key="frame" x="0.0" y="0.0" width="1920" height="1080"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <viewLayoutGuide key="safeArea" id="t9G-P1-nOE"/>
+ </view>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="kBP-wi-UBI" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="-384" y="-36"/>
+ </scene>
+ </scenes>
+</document>
diff --git a/Demos/LunarG-VulkanSamples/Cube/macOS/DemoViewController.m b/Demos/LunarG-VulkanSamples/Cube/macOS/DemoViewController.m
index e9a559b..b812364 100644
--- a/Demos/LunarG-VulkanSamples/Cube/macOS/DemoViewController.m
+++ b/Demos/LunarG-VulkanSamples/Cube/macOS/DemoViewController.m
@@ -43,8 +43,9 @@
self.view.wantsLayer = YES; // Back the view with a layer created by the makeBackingLayer method.
- const char* arg = "cube";
- demo_main(&demo, self.view.layer, 1, &arg);
+ const char* argv[] = { "cube" };
+ int argc = sizeof(argv)/sizeof(char*);
+ demo_main(&demo, self.view.layer, argc, argv);
CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink);
CVDisplayLinkSetOutputCallback(_displayLink, &DisplayLinkCallback, &demo);
diff --git a/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/project.pbxproj b/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/project.pbxproj
index 3f77a1b..ad3b5b6 100644
--- a/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/project.pbxproj
+++ b/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/project.pbxproj
@@ -353,11 +353,13 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
+ CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
GCC_PREFIX_HEADER = "$(SRCROOT)/iOS/Prefix.pch";
INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/iOS/static\"";
+ MARKETING_VERSION = 1;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
@@ -367,11 +369,13 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
+ CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
GCC_PREFIX_HEADER = "$(SRCROOT)/iOS/Prefix.pch";
INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/iOS/static\"";
+ MARKETING_VERSION = 1;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
diff --git a/Demos/LunarG-VulkanSamples/Hologram/iOS/Info.plist b/Demos/LunarG-VulkanSamples/Hologram/iOS/Info.plist
index dcbf9e8..8101a17 100644
--- a/Demos/LunarG-VulkanSamples/Hologram/iOS/Info.plist
+++ b/Demos/LunarG-VulkanSamples/Hologram/iOS/Info.plist
@@ -16,10 +16,14 @@
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
- <string>1.0</string>
+ <string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>UIMainStoryboardFile</key>
diff --git a/Demos/README.md b/Demos/README.md
index 100497a..aeccf91 100644
--- a/Demos/README.md
+++ b/Demos/README.md
@@ -50,10 +50,11 @@
`LunarG-VulkanSamples/Cube` group in the *Xcode Project Navigator* in the
`Cube.xcworkspace` *Xcode* workspace.
-To run this demo, run either the `Cube-iOS` or `Cube-macOS` *Scheme* from within *Xcode*.
+To run this demo, run the `Cube-iOS`, `Cube-tvOS`, or `Cube-macOS` *Scheme* from within *Xcode*.
+In addition to devices, this demo will also run on the `iOS Simulator` or `tvOS Simulator` destinations.
-This demo includes a sizable window, and represents an example of how to detect, within your
-*Vulkan* code, when a window has been resized, and to modify the *Vulkan* swapchain accordingly.
+The *macOS* version of this demo includes a sizable window, and represents an example of how to detect,
+within your *Vulkan* code, when a window has been resized, and to modify the *Vulkan* swapchain accordingly.
The `Cube` demo is a simple example of installing **MoltenVK** as a *dynamic library*. In this demo,
the **MoltenVK** *dynamic library* is embedded in the application, but it could have been installed
diff --git a/Docs/MoltenVK_Runtime_UserGuide.md b/Docs/MoltenVK_Runtime_UserGuide.md
index b3270cd..3332286 100644
--- a/Docs/MoltenVK_Runtime_UserGuide.md
+++ b/Docs/MoltenVK_Runtime_UserGuide.md
@@ -41,8 +41,8 @@
About This Document
-------------------
-This document describes how to integrate the **MoltenVK** runtime distribution package into a game
-or application, once **MoltenVK** has been built into a framework or library for *iOS* or *macOS*.
+This document describes how to integrate the **MoltenVK** runtime distribution package into a game or
+application, once **MoltenVK** has been built into a framework or library for *macOS*, *iOS*, or *tvOS*.
To learn how to use the **MoltenVK** open-source repository to build a **MoltenVK** runtime
distribution package, see the main [`README.md`](../README.md) document in the `MoltenVK` repository.
@@ -55,9 +55,9 @@
**MoltenVK** is a layered implementation of [*Vulkan 1.0*](https://www.khronos.org/vulkan)
graphics and compute functionality, that is built on Apple's [*Metal*](https://developer.apple.com/metal)
-graphics and compute framework on both *iOS* and *macOS*. **MoltenVK** allows you to use *Vulkan* graphics
-and compute functionality to develop modern, cross-platform, high-performance graphical games and applications,
-and to run them across many platforms, including both *iOS* and *macOS*.
+graphics and compute framework on *macOS*, *iOS*, and *tvOS*. **MoltenVK** allows you to use *Vulkan*
+graphics and compute functionality to develop modern, cross-platform, high-performance graphical games
+and applications, and to run them across many platforms, including *macOS*, *iOS*, and *tvOS*.
*Metal* uses a different shading language, the *Metal Shading Language (MSL)*, than
*Vulkan*, which uses *SPIR-V*. **MoltenVK** automatically converts your *SPIR-V* shaders
@@ -66,10 +66,10 @@
[**MoltenVKShaderConverter**](#shader_converter_tool) tool provided with this **MoltenVK**
distribution package.
-To provide *Vulkan* capability to the *iOS* and *macOS* platforms, **MoltenVK** uses *Apple's*
-publicly available API's, including *Metal*. **MoltenVK** does **_not_** use any private or
-undocumented API calls or features, so your app will be compatible with all standard distribution
-channels, including *Apple's App Store*.
+To provide *Vulkan* capability to the*macOS*, *iOS*, and *tvOS* platforms, **MoltenVK** uses
+*Apple's* publicly available API's, including *Metal*. **MoltenVK** does **_not_** use any
+private or undocumented API calls or features, so your app will be compatible with all
+standard distribution channels, including *Apple's App Store*.
<a name="install"></a>
@@ -82,13 +82,16 @@
**MoltenVK** references the latest *Apple SDK* frameworks. To access these frameworks when building
your app, and to avoid build errors, be sure to use the latest publicly available version of *Xcode*.
->***Note:*** To support `IOSurfaces`, 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.
+>***Note:*** To support `IOSurfaces` on *iOS* or *tvOS*, 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 `)
+build setting of `tvOS 11.0` or greater.
-Once built, your app integrating the **MoltenVK** libraries can be run on *iOS* or *macOS* devices
-that support *Metal*.
+Once built, your app integrating the **MoltenVK** libraries can be run on *macOS*, *iOS* or *tvOS*
+devices that support *Metal*, or on the *Xcode* *iOS Simulator* or *tvOS Simulator*.
-- At runtime, **MoltenVK** requires at least *macOS 10.11* or *iOS 9* (or *iOS 11* if using `IOSurfaces`).
+- At runtime, **MoltenVK** requires at least *macOS 10.11*, *iOS 9*, or *tvOS 9*
+ (or *iOS 11* or *tvOS 11* if using `IOSurfaces`).
- Information on *macOS* devices that are compatible with *Metal* can be found in
[this article](http://www.idownloadblog.com/2015/06/22/how-to-find-mac-el-capitan-metal-compatible).
- Information on *iOS* devices that are compatible with *Metal* can be found in
@@ -106,10 +109,11 @@
about which linking and deployment option you need, follow the steps for installing a
*static framework*, as it is the simplest to install.
->**_Note:_** Distributing an app containing a dynamic library via the *iOS App Store* can require
-specialized bundling. Unless you have specific needs for dynamic libraries, the recommended
-approach on *iOS* is to link **MoltenVK** to your app as a static library.
-
+>**_Note:_** Distributing an app containing a dynamic library via the *iOS App Store* or
+ *tvOS App Store* can require specialized bundling. Unless you have specific needs for
+ dynamic libraries, the recommended approach on *iOS* or *tvOS* is to link **MoltenVK**
+ to your app as a static library or framework.
+
1. Open your application in *Xcode* and select your application's target in the
*Project Navigator* panel.
@@ -122,12 +126,14 @@
setting, add an entry that points to **_one_** of the following folders:
- `MoltenVK/macOS/framework` *(macOS)*
- `MoltenVK/iOS/framework` *(iOS)*
+ - `MoltenVK/tvOS/framework` *(tvOS)*
- If installing **MoltenVK** as a *static library* in your application:
1. In the **Library Search Paths** (aka `LIBRARY_SEARCH_PATHS`) setting,
add an entry that points to **_one_** of the following folders:
- `MoltenVK/macOS/static` *(macOS)*
- `MoltenVK/iOS/static` *(iOS)*
+ - `MoltenVK/tvOS/static` *(tvOS)*
2. In the **Header Search Paths** (aka `HEADER_SEARCH_PATHS`) setting,
add an entry that points to the `MoltenVK/include` folder.
@@ -137,6 +143,7 @@
add an entry that points to **_one_** of the following folders:
- `MoltenVK/macOS/dynamic` *(macOS)*
- `MoltenVK/iOS/dynamic` *(iOS)*
+ - `MoltenVK/tvOS/dynamic` *(tvOS)*
2. In the **Header Search Paths** (aka `HEADER_SEARCH_PATHS`) setting,
add an entry that points to the `MoltenVK/include` folder.
@@ -146,13 +153,15 @@
you would typically set this value to either:
- `@executable_path/../Frameworks` *(macOS)*
- - `@executable_path/Frameworks` *(iOS)*
+ - `@executable_path/Frameworks` *(iOS or tvOS)*
The `libMoltenVK.dylib` library is internally configured to be located at
`@rpath/libMoltenVK.dylib`.
3. With the *Build Settings* tab open, if using `IOSurfaces` on *iOS*, open the **iOS Deployment Target**
- (aka `IPHONEOS_DEPLOYMENT_TARGET`) setting, and ensure it is set to a value of `iOS 11.0` or greater.
+ (aka `IPHONEOS_DEPLOYMENT_TARGET`) setting, and ensure it is set to a value of `iOS 11.0` or greater,
+ or if using `IOSurfaces` on *tvOS*, open the **tvOS Deployment Target** (aka `TVOS_DEPLOYMENT_TARGET`)
+ setting, and ensure it is set to a value of `tvOS 11.0` or greater.
4. On the *Build Phases* tab, open the *Link Binary With Libraries* list.
@@ -166,6 +175,11 @@
- `MoltenVK/iOS/static/libMoltenVK.a` *(static library)*
- `MoltenVK/iOS/dynamic/libMoltenVK.dylib` *(dynamic library)*
+ - For *tvOS*, drag **_one_** of the following files to the *Link Binary With Libraries* list:
+ - `MoltenVK/tvOS/framework/MoltenVK.framework ` *(static framework)*
+ - `MoltenVK/tvOS/static/libMoltenVK.a` *(static library)*
+ - `MoltenVK/tvOS/dynamic/libMoltenVK.dylib` *(dynamic library)*
+
5. While in the *Link Binary With Libraries* list on the *Build Phases* tab, if you do **_not_**
have the **Link Frameworks Automatically** (aka `CLANG_MODULES_AUTOLINK`) and
**Enable Modules (C and Objective-C)** (aka `CLANG_ENABLE_MODULES`) settings enabled, click
@@ -175,8 +189,9 @@
- `Foundation.framework`.
- `QuartzCore.framework`
- `IOKit.framework` (*macOS*)
- - `UIKit.framework` (*iOS*)
- - `IOSurface.framework` (*macOS*, or *iOS* if `IPHONEOS_DEPLOYMENT_TARGET` is at least `iOS 11.0`)
+ - `UIKit.framework` (*iOS* or *tvOS*)
+ - `IOSurface.framework` (*macOS*, or *iOS* if `IPHONEOS_DEPLOYMENT_TARGET` is at least `iOS 11.0`,
+ or *tvOS* if `TVOS_DEPLOYMENT_TARGET` is at least `tvOS 11.0`)
6. If installing **MoltenVK** as a *dynamic library* in your application, arrange to install
the `libMoltenVK.dylib` file in your application environment:
@@ -192,10 +207,12 @@
3. Drag **_one_** of the following files to the *Copy Files* list in this new build phase:
- `MoltenVK/macOS/dynamic/libMoltenVK.dylib` *(macOS)*
- `MoltenVK/iOS/dynamic/libMoltenVK.dylib` *(iOS)*
+ - `MoltenVK/tvOS/dynamic/libMoltenVK.dylib` *(tvOS)*
- - Alternately, you may create your own installation mechanism to install either the
- `MoltenVK/macOS/dynamic/libMoltenVK.dylib` or `MoltenVK/iOS/dynamic/libMoltenVK.dylib`
- file into a standard *macOS* or *iOS* system library folder on the user's device.
+ - Alternately, you may create your own installation mechanism to install one of the
+ `MoltenVK/macOS/dynamic/libMoltenVK.dylib`, `MoltenVK/iOS/dynamic/libMoltenVK.dylib`,
+ or `MoltenVK/tvOS/dynamic/libMoltenVK.dylib` file into a standard *macOS*, *iOS*, or
+ *tvOS* system library folder on the user's device.
7. When a *Metal* app is running from *Xcode*, the default ***Scheme*** settings reduce
performance. To improve performance and gain the benefits of *Metal*, perform the
@@ -287,17 +304,16 @@
- `VK_MVK_moltenvk`
- `VK_AMD_gpu_shader_half_float`
- `VK_AMD_negative_viewport_height`
-- `VK_AMD_shader_image_load_store_lod` *(iOS)*
+- `VK_AMD_shader_image_load_store_lod` *(iOS and tvOS)*
- `VK_AMD_shader_trinary_minmax` *(requires Metal 2.1)*
-- `VK_IMG_format_pvrtc` *(iOS)*
+- `VK_IMG_format_pvrtc` *(iOS and tvOS)*
- `VK_INTEL_shader_integer_functions2`
- `VK_NV_glsl_shader`
-In order to visibly display your content on *iOS* or *macOS*, you must enable the `VK_EXT_metal_surface`
-extension, and use the function defined in that extension to create a *Vulkan* rendering surface.
-You can enable the `VK_EXT_metal_surface` extension by defining the `VK_USE_PLATFORM_METAL_EXT`
-guard macro in your compiler build settings. See the description of the `mvk_vulkan.h` file below for
-a convenient way to enable this extension automatically.
+In order to visibly display your content on *macOS*, *iOS*, or *tvOS*, you must enable the
+`VK_EXT_metal_surface` extension, and use the function defined in that extension to create a
+*Vulkan* rendering surface. You can enable the `VK_EXT_metal_surface` extension by defining the `VK_USE_PLATFORM_METAL_EXT` guard macro in your compiler build settings. See the description of
+the `mvk_vulkan.h` file below for a convenient way to enable this extension automatically.
<a name="moltenvk_extension"></a>
@@ -320,8 +336,8 @@
- `mvk_vulkan.h` - This is a convenience header file that loads the `vulkan.h` header file
with the appropriate **MoltenVK** *Vulkan* platform surface extension automatically
- enabled for *iOS* or *macOS*. Use this header file in place of the `vulkan.h` header file,
- where access to a **MoltenVK** platform surface extension is required.
+ enabled for *macOS*, *iOS*, or *tvOS*. Use this header file in place of the `vulkan.h`
+ header file, where access to a **MoltenVK** platform surface extension is required.
The `mvk_vulkan.h` header file automatically enables the `VK_USE_PLATFORM_METAL_EXT`
build setting and `VK_EXT_metal_surface` *Vulkan* extension.
diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md
index 14e79ac..df08073 100644
--- a/Docs/Whats_New.md
+++ b/Docs/Whats_New.md
@@ -21,6 +21,12 @@
- Add support for extensions:
- VK_KHR_sampler_ycbcr_conversion
- VK_EXT_robustness2
+- Add support for **_tvOS_** platform.
+- Add support for **_iOS Simulator_** and **_tvOS Simulator_** build destinations.
+- Cube demo runs on **_tvOS_**, **_iOS Simulator_**, and **_tvOS Simulator_**.
+- **_MoltenVK_** Xcode schemes support building fat *Platform+Simulator* binaries.
+- `Makefile` supports building fat *Platform+Simulator* binaries, plus *Debug* builds.
+- `fetchDependencies` script supports platform build selection, plus parallel builds.
- Fix issue where mapped host-coherent device memory not updated from image contents on *macOS*.
- Remove use of `@available()` directive as it was causing issues in some build environments.
- Refactor **MoltenVK** *Xcode* build architectures.
diff --git a/ExternalDependencies.xcodeproj/project.pbxproj b/ExternalDependencies.xcodeproj/project.pbxproj
index 022cd7b..e7093c0 100644
--- a/ExternalDependencies.xcodeproj/project.pbxproj
+++ b/ExternalDependencies.xcodeproj/project.pbxproj
@@ -11,6 +11,7 @@
isa = PBXAggregateTarget;
buildConfigurationList = 2FEA0AE52490320500EEF3AD /* Build configuration list for PBXAggregateTarget "ExternalDependencies-tvOS" */;
buildPhases = (
+ A9A5F2C1249D09820016D8B1 /* Create Fat Libraries */,
2FEA0AE42490320500EEF3AD /* Package External Libraries */,
);
dependencies = (
@@ -25,7 +26,7 @@
isa = PBXAggregateTarget;
buildConfigurationList = A972A7E721CEC72F0013AB25 /* Build configuration list for PBXAggregateTarget "ExternalDependencies-macOS" */;
buildPhases = (
- A9679AB021D26C7000856BF7 /* Package External Libraries */,
+ A9679AB021D26C7000856BF7 /* Package Libraries */,
);
dependencies = (
A972A7E921CEC76A0013AB25 /* PBXTargetDependency */,
@@ -39,7 +40,8 @@
isa = PBXAggregateTarget;
buildConfigurationList = A972A7ED21CEC8030013AB25 /* Build configuration list for PBXAggregateTarget "ExternalDependencies-iOS" */;
buildPhases = (
- A9679AAF21D26C1400856BF7 /* Package External Libraries */,
+ A932E9C6249A7B9B00D64150 /* Create Fat Libraries */,
+ A9679AAF21D26C1400856BF7 /* Package Libraries */,
);
dependencies = (
A972A7F121CEC8140013AB25 /* PBXTargetDependency */,
@@ -53,11 +55,12 @@
isa = PBXAggregateTarget;
buildConfigurationList = A972A7F521CEC81B0013AB25 /* Build configuration list for PBXAggregateTarget "ExternalDependencies" */;
buildPhases = (
+ A9FC5F8B249DB48D003CB086 /* Package Finish */,
);
dependencies = (
+ A972A7F921CEC8500013AB25 /* PBXTargetDependency */,
A972A7FB21CEC8540013AB25 /* PBXTargetDependency */,
2FEA0CF82490344F00EEF3AD /* PBXTargetDependency */,
- A972A7F921CEC8500013AB25 /* PBXTargetDependency */,
);
name = ExternalDependencies;
productName = "ExternalLibraries-macOS";
@@ -1652,12 +1655,13 @@
2FEA0B4A2490321700EEF3AD /* libglslang.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libglslang.a; sourceTree = BUILT_PRODUCTS_DIR; };
2FEA0CD82490322100EEF3AD /* libSPIRVTools.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSPIRVTools.a; sourceTree = BUILT_PRODUCTS_DIR; };
2FEA0CEF2490322B00EEF3AD /* libSPIRVCross.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSPIRVCross.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 2FEA0CF6249032CF00EEF3AD /* package_ext_libs_tvos.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = package_ext_libs_tvos.sh; sourceTree = "<group>"; };
450A4F63221C5A95007203D7 /* spirv_reflect.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spirv_reflect.hpp; sourceTree = "<group>"; };
450A4F64221C5A95007203D7 /* spirv_reflect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spirv_reflect.cpp; sourceTree = "<group>"; };
A90FD89F21CC4EAB00B92BB2 /* libSPIRVCross.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSPIRVCross.a; sourceTree = BUILT_PRODUCTS_DIR; };
A90FD9E421CC4EB900B92BB2 /* libSPIRVCross.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSPIRVCross.a; sourceTree = BUILT_PRODUCTS_DIR; };
A91BF011235F9C510039B7DE /* gen_spirv_cross_rev_hdr.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = gen_spirv_cross_rev_hdr.sh; sourceTree = "<group>"; };
+ A932E9C5249A743B00D64150 /* create_fat_lib_func.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_lib_func.sh; sourceTree = "<group>"; };
+ A932E9DF249BC44D00D64150 /* create_fat_ext_libs.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_ext_libs.sh; sourceTree = "<group>"; };
A9415EF624366B0E00566F16 /* packagePregenSpirvToolsHeaders */ = {isa = PBXFileReference; lastKnownFileType = text; path = packagePregenSpirvToolsHeaders; sourceTree = "<group>"; };
A95D90A723A7F1E500CBCC60 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
A95D90AA23A7F1E500CBCC60 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
@@ -1761,8 +1765,6 @@
A95D911923A7F1E500CBCC60 /* Logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logger.h; sourceTree = "<group>"; };
A95D911A23A7F1E500CBCC60 /* doc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = doc.cpp; sourceTree = "<group>"; };
A95D911B23A7F1E500CBCC60 /* disassemble.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = disassemble.cpp; sourceTree = "<group>"; };
- A9679AAC21D269D900856BF7 /* package_ext_libs_macos.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_ext_libs_macos.sh; sourceTree = "<group>"; };
- A9679AAD21D269D900856BF7 /* package_ext_libs_ios.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_ext_libs_ios.sh; sourceTree = "<group>"; };
A9679AAE21D269D900856BF7 /* package_ext_libs.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_ext_libs.sh; sourceTree = "<group>"; };
A972A80F21CECBBF0013AB25 /* libSPIRVTools.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSPIRVTools.a; sourceTree = BUILT_PRODUCTS_DIR; };
A972A82321CECBE90013AB25 /* libSPIRVTools.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSPIRVTools.a; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -2184,6 +2186,7 @@
A9765DF02485758500FDD115 /* decoration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = decoration.h; sourceTree = "<group>"; };
A9C2104521D14FD7006BA2D3 /* fetchDependencies */ = {isa = PBXFileReference; lastKnownFileType = text; path = fetchDependencies; sourceTree = "<group>"; };
A9C2104721D15843006BA2D3 /* ExternalRevisions */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ExternalRevisions; sourceTree = "<group>"; };
+ A9FC5F7F249DA96D003CB086 /* package_ext_libs_finish.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_ext_libs_finish.sh; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
@@ -2387,10 +2390,10 @@
A9679AAB21D2699800856BF7 /* Scripts */ = {
isa = PBXGroup;
children = (
+ A932E9DF249BC44D00D64150 /* create_fat_ext_libs.sh */,
+ A932E9C5249A743B00D64150 /* create_fat_lib_func.sh */,
A91BF011235F9C510039B7DE /* gen_spirv_cross_rev_hdr.sh */,
- A9679AAD21D269D900856BF7 /* package_ext_libs_ios.sh */,
- 2FEA0CF6249032CF00EEF3AD /* package_ext_libs_tvos.sh */,
- A9679AAC21D269D900856BF7 /* package_ext_libs_macos.sh */,
+ A9FC5F7F249DA96D003CB086 /* package_ext_libs_finish.sh */,
A9679AAE21D269D900856BF7 /* package_ext_libs.sh */,
A9415EF624366B0E00566F16 /* packagePregenSpirvToolsHeaders */,
);
@@ -2420,10 +2423,13 @@
isa = PBXGroup;
children = (
A90FD89F21CC4EAB00B92BB2 /* libSPIRVCross.a */,
+ 2FEA0CEF2490322B00EEF3AD /* libSPIRVCross.a */,
A90FD9E421CC4EB900B92BB2 /* libSPIRVCross.a */,
A972A80F21CECBBF0013AB25 /* libSPIRVTools.a */,
+ 2FEA0CD82490322100EEF3AD /* libSPIRVTools.a */,
A972A82321CECBE90013AB25 /* libSPIRVTools.a */,
A972ABDC21CED7BC0013AB25 /* libglslang.a */,
+ 2FEA0B4A2490321700EEF3AD /* libglslang.a */,
A972ABF021CED7CB0013AB25 /* libglslang.a */,
);
name = Products;
@@ -2907,9 +2913,6 @@
A90FD9E921CC519E00B92BB2 /* External */,
A9679AAB21D2699800856BF7 /* Scripts */,
A972AD2421CEE30F0013AB25 /* Products */,
- 2FEA0CD82490322100EEF3AD /* libSPIRVTools.a */,
- 2FEA0B4A2490321700EEF3AD /* libglslang.a */,
- 2FEA0CEF2490322B00EEF3AD /* libSPIRVCross.a */,
);
sourceTree = "<group>";
};
@@ -3941,7 +3944,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Scripts/package_ext_libs_tvos.sh\"\n";
+ shellScript = "export MVK_OS=\"tvOS\"\nexport MVK_BUILT_PROD_PATH=\"${BUILT_PRODUCTS_DIR}-${MVK_OS}\"\n\n. \"${SRCROOT}/Scripts/package_ext_libs.sh\"\n";
};
2FEA0CEB2490322B00EEF3AD /* Generate Revision Header */ = {
isa = PBXShellScriptBuildPhase;
@@ -3997,7 +4000,7 @@
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Scripts/gen_spirv_cross_rev_hdr.sh\"\n";
};
- A9679AAF21D26C1400856BF7 /* Package External Libraries */ = {
+ A932E9C6249A7B9B00D64150 /* Create Fat Libraries */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -4006,16 +4009,16 @@
);
inputPaths = (
);
- name = "Package External Libraries";
+ name = "Create Fat Libraries";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Scripts/package_ext_libs_ios.sh\"\n";
+ shellScript = "export MVK_OS=\"iOS\"\nexport MVK_OS_PROD_EXTN=\"iphoneos\"\nexport MVK_SIM_PROD_EXTN=\"iphonesimulator\"\n\n. \"${SRCROOT}/Scripts/create_fat_ext_libs.sh\"\n";
};
- A9679AB021D26C7000856BF7 /* Package External Libraries */ = {
+ A9679AAF21D26C1400856BF7 /* Package Libraries */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -4024,14 +4027,68 @@
);
inputPaths = (
);
- name = "Package External Libraries";
+ name = "Package Libraries";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Scripts/package_ext_libs_macos.sh\"\n";
+ shellScript = "export MVK_OS=\"iOS\"\nexport MVK_BUILT_PROD_PATH=\"${BUILT_PRODUCTS_DIR}-${MVK_OS}\"\n\n. \"${SRCROOT}/Scripts/package_ext_libs.sh\"\n";
+ };
+ A9679AB021D26C7000856BF7 /* Package Libraries */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ name = "Package Libraries";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "export MVK_OS=\"macOS\"\nexport MVK_BUILT_PROD_PATH=\"${BUILT_PRODUCTS_DIR}\"\n\n. \"${SRCROOT}/Scripts/package_ext_libs.sh\"\n";
+ };
+ A9A5F2C1249D09820016D8B1 /* Create Fat Libraries */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ name = "Create Fat Libraries";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "export MVK_OS=\"tvOS\"\nexport MVK_OS_PROD_EXTN=\"appletvos\"\nexport MVK_SIM_PROD_EXTN=\"appletvsimulator\"\n\n. \"${SRCROOT}/Scripts/create_fat_ext_libs.sh\"\n";
+ };
+ A9FC5F8B249DB48D003CB086 /* Package Finish */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ name = "Package Finish";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = ". \"${SRCROOT}/Scripts/package_ext_libs_finish.sh\"\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -4939,11 +4996,7 @@
2FEA0B482490321700EEF3AD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
- BITCODE_GENERATION_MODE = bitcode;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO;
- CODE_SIGN_IDENTITY = "iPhone Developer";
- "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"AMD_EXTENSIONS=1",
@@ -4959,19 +5012,13 @@
);
PRODUCT_NAME = glslang;
SDKROOT = appletvos;
- TARGETED_DEVICE_FAMILY = 3;
- TVOS_DEPLOYMENT_TARGET = 11.0;
};
name = Debug;
};
2FEA0B492490321700EEF3AD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
- BITCODE_GENERATION_MODE = bitcode;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO;
- CODE_SIGN_IDENTITY = "iPhone Developer";
- "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"AMD_EXTENSIONS=1",
@@ -4987,19 +5034,12 @@
);
PRODUCT_NAME = glslang;
SDKROOT = appletvos;
- TARGETED_DEVICE_FAMILY = 3;
- TVOS_DEPLOYMENT_TARGET = 11.0;
};
name = Release;
};
2FEA0CD62490322100EEF3AD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
- BITCODE_GENERATION_MODE = bitcode;
- CODE_SIGN_IDENTITY = "iPhone Developer";
- "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
- DEPLOYMENT_POSTPROCESSING = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
@@ -5010,19 +5050,12 @@
);
PRODUCT_NAME = SPIRVTools;
SDKROOT = appletvos;
- TARGETED_DEVICE_FAMILY = 3;
- TVOS_DEPLOYMENT_TARGET = 11.0;
};
name = Debug;
};
2FEA0CD72490322100EEF3AD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
- BITCODE_GENERATION_MODE = bitcode;
- CODE_SIGN_IDENTITY = "iPhone Developer";
- "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
- DEPLOYMENT_POSTPROCESSING = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
@@ -5033,44 +5066,30 @@
);
PRODUCT_NAME = SPIRVTools;
SDKROOT = appletvos;
- TARGETED_DEVICE_FAMILY = 3;
- TVOS_DEPLOYMENT_TARGET = 11.0;
};
name = Release;
};
2FEA0CED2490322B00EEF3AD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
- BITCODE_GENERATION_MODE = bitcode;
- CODE_SIGN_IDENTITY = "iPhone Developer";
- "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"SPIRV_CROSS_NAMESPACE_OVERRIDE=MVK_spirv_cross",
);
PRODUCT_NAME = SPIRVCross;
SDKROOT = appletvos;
- TARGETED_DEVICE_FAMILY = 3;
- TVOS_DEPLOYMENT_TARGET = 11.0;
};
name = Debug;
};
2FEA0CEE2490322B00EEF3AD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
- BITCODE_GENERATION_MODE = bitcode;
- CODE_SIGN_IDENTITY = "iPhone Developer";
- "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"SPIRV_CROSS_NAMESPACE_OVERRIDE=MVK_spirv_cross",
);
PRODUCT_NAME = SPIRVCross;
SDKROOT = appletvos;
- TARGETED_DEVICE_FAMILY = 3;
- TVOS_DEPLOYMENT_TARGET = 11.0;
};
name = Release;
};
@@ -5175,7 +5194,6 @@
A972A80D21CECBBF0013AB25 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- DEPLOYMENT_POSTPROCESSING = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
@@ -5192,7 +5210,6 @@
A972A80E21CECBBF0013AB25 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- DEPLOYMENT_POSTPROCESSING = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
@@ -5209,7 +5226,6 @@
A972A82121CECBE90013AB25 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- DEPLOYMENT_POSTPROCESSING = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
@@ -5226,7 +5242,6 @@
A972A82221CECBE90013AB25 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- DEPLOYMENT_POSTPROCESSING = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
@@ -5372,8 +5387,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
ONLY_ACTIVE_ARCH = YES;
SKIP_INSTALL = YES;
- TARGETED_DEVICE_FAMILY = "1,2";
- TVOS_DEPLOYMENT_TARGET = 11.0;
+ TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Debug;
};
@@ -5420,8 +5434,7 @@
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 10.11;
SKIP_INSTALL = YES;
- TARGETED_DEVICE_FAMILY = "1,2";
- TVOS_DEPLOYMENT_TARGET = 11.0;
+ TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
diff --git a/Makefile b/Makefile
index 7f6bcb1..ebfee2c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,28 +1,65 @@
-XCODE_PROJ := MoltenVKPackaging.xcodeproj
-XCODE_SCHEME_BASE := MoltenVK Package
+XC_PROJ := MoltenVKPackaging.xcodeproj
+XC_SCHEME := MoltenVK Package
+# Specify individually (not as dependencies) so the sub-targets don't run in parallel
.PHONY: all
all:
- xcodebuild -quiet -project "$(XCODE_PROJ)" -scheme "$(XCODE_SCHEME_BASE)" build
+ @$(MAKE) macos
+ @$(MAKE) iosfat
+ @$(MAKE) tvosfat
+
+.PHONY: all-debug
+all-debug:
+ @$(MAKE) macos-debug
+ @$(MAKE) iosfat-debug
+ @$(MAKE) tvosfat-debug
.PHONY: macos
macos:
- xcodebuild -quiet -project "$(XCODE_PROJ)" -scheme "$(XCODE_SCHEME_BASE) (macOS only)" build
+ xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (macOS only)"
+
+.PHONY: macos-debug
+macos-debug:
+ xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (macOS only)" -configuration "Debug"
.PHONY: ios
ios:
- xcodebuild -quiet -project "$(XCODE_PROJ)" -scheme "$(XCODE_SCHEME_BASE) (iOS only)" build
+ xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)"
+
+.PHONY: ios-debug
+ios-debug:
+ xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -configuration "Debug"
+
+.PHONY: iosfat
+iosfat: ios
+ xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=iOS Simulator"
+
+.PHONY: iosfat-debug
+iosfat-debug: ios-debug
+ xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=iOS Simulator" -configuration "Debug"
.PHONY: tvos
tvos:
- xcodebuild -quiet -project "$(XCODE_PROJ)" -scheme "$(XCODE_SCHEME_BASE) (tvOS only)" build
+ xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)"
+
+.PHONY: tvos-debug
+tvos-debug:
+ xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -configuration "Debug"
+
+.PHONY: tvosfat
+tvosfat: tvos
+ xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -destination "generic/platform=tvOS Simulator"
+
+.PHONY: tvosfat-debug
+tvosfat-debug: tvos-debug
+ xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -destination "generic/platform=tvOS Simulator" -configuration "Debug"
.PHONY: clean
clean:
- xcodebuild -quiet -project "$(XCODE_PROJ)" -scheme "$(XCODE_SCHEME_BASE)" clean
+ xcodebuild clean -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME)"
rm -rf Package
-#Usually requires 'sudo make install'
+# Usually requires 'sudo make install'
.PHONY: install
install:
rm -rf /Library/Frameworks/MoltenVK.framework
diff --git a/MoltenVK/MoltenVK.xcodeproj/project.pbxproj b/MoltenVK/MoltenVK.xcodeproj/project.pbxproj
index 9575241..971755e 100644
--- a/MoltenVK/MoltenVK.xcodeproj/project.pbxproj
+++ b/MoltenVK/MoltenVK.xcodeproj/project.pbxproj
@@ -1040,6 +1040,7 @@
2FEA0A4024902F9F00EEF3AD /* Headers */,
2FEA0A8224902F9F00EEF3AD /* Sources */,
2FEA0AB524902F9F00EEF3AD /* Create Dynamic Library */,
+ A9FC5F6D249D39F3003CB086 /* Create Fat Libraries */,
2FEA0AB624902F9F00EEF3AD /* Create Framework */,
);
buildRules = (
@@ -1060,6 +1061,7 @@
A9B8EE071A98D796009C5A02 /* Headers */,
A9B8EE051A98D796009C5A02 /* Sources */,
A9731FAD1EDDAE39006B7298 /* Create Dynamic Library */,
+ A9EE084F249BD4AE00E523A2 /* Create Fat Libraries */,
A92EF79721854B3300C8B91B /* Create Framework */,
);
buildRules = (
@@ -1286,6 +1288,42 @@
shellPath = /bin/sh;
shellScript = ". \"${SRCROOT}/../Scripts/create_dylib_ios.sh\"\n";
};
+ A9EE084F249BD4AE00E523A2 /* Create Fat Libraries */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ name = "Create Fat Libraries";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = ". \"${SRCROOT}/../Scripts/create_fat_libs_ios.sh\"\n";
+ };
+ A9FC5F6D249D39F3003CB086 /* Create Fat Libraries */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ name = "Create Fat Libraries";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = ". \"${SRCROOT}/../Scripts/create_fat_libs_tvos.sh\"\n";
+ };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -1499,26 +1537,16 @@
2FEA0AB824902F9F00EEF3AD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
- BITCODE_GENERATION_MODE = bitcode;
- IPHONEOS_DEPLOYMENT_TARGET = 9.0;
- PRODUCT_NAME = MoltenVK;
SDKROOT = appletvos;
- TARGETED_DEVICE_FAMILY = 3;
- TVOS_DEPLOYMENT_TARGET = 11.0;
+ TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Debug;
};
2FEA0AB924902F9F00EEF3AD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
- BITCODE_GENERATION_MODE = bitcode;
- IPHONEOS_DEPLOYMENT_TARGET = 9.0;
- PRODUCT_NAME = MoltenVK;
SDKROOT = appletvos;
- TARGETED_DEVICE_FAMILY = 3;
- TVOS_DEPLOYMENT_TARGET = 11.0;
+ TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Release;
};
@@ -1527,7 +1555,6 @@
buildSettings = {
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
SDKROOT = iphoneos;
- TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
@@ -1536,7 +1563,6 @@
buildSettings = {
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
SDKROOT = iphoneos;
- TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
diff --git a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-tvOS.xcscheme b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-tvOS.xcscheme
index ad9290a..2418c6a 100644
--- a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-tvOS.xcscheme
+++ b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-tvOS.xcscheme
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
- <AdditionalOptions>
- </AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -51,8 +49,6 @@
ReferencedContainer = "container:MoltenVK.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <AdditionalOptions>
- </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
diff --git a/MoltenVK/MoltenVK/Commands/MVKCmdDraw.mm b/MoltenVK/MoltenVK/Commands/MVKCmdDraw.mm
index 14abfc7..b6a7ca8 100644
--- a/MoltenVK/MoltenVK/Commands/MVKCmdDraw.mm
+++ b/MoltenVK/MoltenVK/Commands/MVKCmdDraw.mm
@@ -723,12 +723,17 @@
[cmdEncoder->_mtlRenderEncoder setTessellationFactorBuffer: tcLevelBuff->_mtlBuffer
offset: tcLevelBuff->_offset
instanceStride: 0];
+#if MVK_MACOS_OR_IOS
[cmdEncoder->_mtlRenderEncoder drawPatches: outControlPointCount
patchIndexBuffer: nil
patchIndexBufferOffset: 0
indirectBuffer: tcIndirectBuff->_mtlBuffer
indirectBufferOffset: mtlTCIndBuffOfst];
- mtlTCIndBuffOfst += sizeof(MTLDrawPatchIndirectArguments);
+#endif
+#if MVK_TVOS
+ reportError(VK_ERROR_FEATURE_NOT_PRESENT, "vkCmdDrawIndexedIndirect(): The current device does not support indirect tessellated drawing.");
+#endif
+ mtlTCIndBuffOfst += sizeof(MTLDrawPatchIndirectArguments);
// Mark pipeline, resources, and tess control push constants as dirty
// so I apply them during the next stage.
cmdEncoder->_graphicsPipelineState.beginMetalRenderPass();
@@ -978,12 +983,17 @@
[cmdEncoder->_mtlRenderEncoder setTessellationFactorBuffer: tcLevelBuff->_mtlBuffer
offset: tcLevelBuff->_offset
instanceStride: 0];
+#if MVK_MACOS_OR_IOS
[cmdEncoder->_mtlRenderEncoder drawPatches: outControlPointCount
patchIndexBuffer: nil
patchIndexBufferOffset: 0
indirectBuffer: tcIndirectBuff->_mtlBuffer
indirectBufferOffset: mtlTCIndBuffOfst];
- mtlTCIndBuffOfst += sizeof(MTLDrawPatchIndirectArguments);
+#endif
+#if MVK_TVOS
+ reportError(VK_ERROR_FEATURE_NOT_PRESENT, "vkCmdDrawIndexedIndirect(): The current device does not support indirect tessellated drawing.");
+#endif
+ mtlTCIndBuffOfst += sizeof(MTLDrawPatchIndirectArguments);
// Mark pipeline, resources, and tess control push constants as dirty
// so I apply them during the next stage.
cmdEncoder->_graphicsPipelineState.beginMetalRenderPass();
diff --git a/MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.mm b/MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.mm
index c06b32a..ac055f0 100644
--- a/MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.mm
+++ b/MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.mm
@@ -96,8 +96,10 @@
for (uint32_t vpIdx = 0; vpIdx < vpCnt; vpIdx++) {
mtlViewports[vpIdx] = mvkMTLViewportFromVkViewport(usingViewports[vpIdx]);
}
+#if MVK_MACOS_OR_IOS
[_cmdEncoder->_mtlRenderEncoder setViewports: mtlViewports count: vpCnt];
- } else {
+#endif
+ } else {
[_cmdEncoder->_mtlRenderEncoder setViewport: mvkMTLViewportFromVkViewport(usingViewports[0])];
}
}
@@ -149,7 +151,9 @@
for (uint32_t sIdx = 0; sIdx < sCnt; sIdx++) {
mtlScissors[sIdx] = mvkMTLScissorRectFromVkRect2D(_cmdEncoder->clipToRenderArea(usingScissors[sIdx]));
}
+#if MVK_MACOS_OR_IOS
[_cmdEncoder->_mtlRenderEncoder setScissorRects: mtlScissors count: sCnt];
+#endif
} else {
[_cmdEncoder->_mtlRenderEncoder setScissorRect: mvkMTLScissorRectFromVkRect2D(_cmdEncoder->clipToRenderArea(usingScissors[0]))];
}
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
index 9a31220..7e4ff30 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
@@ -1142,18 +1142,11 @@
case MTLLanguageVersion1_1:
setMSLVersion(1, 1);
break;
-#if MVK_IOS
+#if MVK_IOS_OR_TVOS
case MTLLanguageVersion1_0:
setMSLVersion(1, 0);
break;
#endif
-#if MVK_MACOS
- // Silence compiler warning catch-22 on MTLLanguageVersion1_0.
- // But allow iOS to be explicit so it warns on future enum values
- default:
- setMSLVersion(1, 0);
- break;
-#endif
}
}
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKImage.mm b/MoltenVK/MoltenVK/GPUObjects/MVKImage.mm
index 72451c3..0f3523b 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKImage.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKImage.mm
@@ -885,7 +885,7 @@
bool is2D = (getImageType() == VK_IMAGE_TYPE_2D);
bool isCompressed = pixFmts->getFormatType(pCreateInfo->format) == kMVKFormatCompressed;
-#if MVK_IOS
+#if MVK_IOS_OR_TVOS
if (isCompressed && !is2D) {
setConfigurationResult(reportError(VK_ERROR_FEATURE_NOT_PRESENT, "vkCreateImage() : Under Metal, compressed formats may only be used with 2D images."));
}
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.h b/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.h
index e7b657d..cf49d8d 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.h
@@ -317,6 +317,9 @@
MTLFeatureSet mtlFeatSet,
MTLPixelFormat mtlPixFmt,
MVKMTLFmtCaps mtlFmtCaps);
+ void disableMTLPixelFormatCapabilities(MTLPixelFormat mtlPixFmt,
+ MVKMTLFmtCaps mtlFmtCaps);
+ void disableAllMTLPixelFormatCapabilities(MTLPixelFormat mtlPixFmt);
void addMTLVertexFormatCapabilities(id<MTLDevice> mtlDevice,
MTLFeatureSet mtlFeatSet,
MTLVertexFormat mtlVtxFmt,
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.mm b/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.mm
index 22b9c5d..aaa4147 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.mm
@@ -995,6 +995,13 @@
addMTLPixelFormatDesc( GBGR422, RF, RF );
addMTLPixelFormatDesc( BGRG422, RF, RF );
+ // Extended range and wide color pixel formats
+ addMTLPixelFormatDesc( BGRA10_XR, None, None );
+ addMTLPixelFormatDesc( BGRA10_XR_sRGB, None, None );
+ addMTLPixelFormatDesc( BGR10_XR, None, None );
+ addMTLPixelFormatDesc( BGR10_XR_sRGB, None, None );
+ addMTLPixelFormatDesc( BGR10A2Unorm, None, None );
+
// Depth and stencil pixel formats
addMTLPixelFormatDesc( Depth16Unorm, None, None );
addMTLPixelFormatDesc( Depth32Float, DRM, DRFMR );
@@ -1004,13 +1011,6 @@
addMTLPixelFormatDesc( X24_Stencil8, None, DRM );
addMTLPixelFormatDesc( X32_Stencil8, DRM, DRM );
- // Extended range and wide color pixel formats
- addMTLPixelFormatDesc( BGRA10_XR, None, None );
- addMTLPixelFormatDesc( BGRA10_XR_sRGB, None, None );
- addMTLPixelFormatDesc( BGR10_XR, None, None );
- addMTLPixelFormatDesc( BGR10_XR_sRGB, None, None );
- addMTLPixelFormatDesc( BGR10A2Unorm, None, None );
-
// When adding to this list, be sure to ensure _mtlPixelFormatCount is large enough for the format count
}
@@ -1137,6 +1137,16 @@
}
}
+// Disable capability flags in the Metal pixel format.
+void MVKPixelFormats::disableMTLPixelFormatCapabilities(MTLPixelFormat mtlPixFmt,
+ MVKMTLFmtCaps mtlFmtCaps) {
+ mvkDisableFlags(getMTLPixelFormatDesc(mtlPixFmt).mtlFmtCaps, mtlFmtCaps);
+}
+
+void MVKPixelFormats::disableAllMTLPixelFormatCapabilities(MTLPixelFormat mtlPixFmt) {
+ getMTLPixelFormatDesc(mtlPixFmt).mtlFmtCaps = kMVKMTLFmtCapsNone;
+}
+
// If the device supports the feature set, add additional capabilities to a MTLVertexFormat
void MVKPixelFormats::addMTLVertexFormatCapabilities(id<MTLDevice> mtlDevice,
MTLFeatureSet mtlFeatSet,
@@ -1162,6 +1172,12 @@
#define addMTLPixelFormatCapabilities(FEAT_SET, MTL_FMT, CAPS) \
addMTLPixelFormatCapabilities(mtlDevice, MTLFeatureSet_ ##FEAT_SET, MTLPixelFormat ##MTL_FMT, kMVKMTLFmtCaps ##CAPS)
+#define disableAllMTLPixelFormatCapabilities(MTL_FMT) \
+ disableAllMTLPixelFormatCapabilities(MTLPixelFormat ##MTL_FMT)
+
+#define disableMTLPixelFormatCapabilities(MTL_FMT, CAPS) \
+ disableMTLPixelFormatCapabilities(MTLPixelFormat ##MTL_FMT, kMVKMTLFmtCaps ##CAPS)
+
#define addMTLVertexFormatCapabilities(FEAT_SET, MTL_FMT, CAPS) \
addMTLVertexFormatCapabilities(mtlDevice, MTLFeatureSet_ ##FEAT_SET, MTLVertexFormat ##MTL_FMT, kMVKMTLFmtCaps ##CAPS)
@@ -1192,6 +1208,7 @@
addMTLVertexFormatCapabilities( macOS_GPUFamily1_v3, UChar4Normalized_BGRA, Vertex );
}
#endif
+
#if MVK_TVOS
void MVKPixelFormats::modifyMTLFormatCapabilities(id<MTLDevice> mtlDevice) {
addMTLPixelFormatCapabilities( tvOS_GPUFamily1_v2, R8Unorm_sRGB, All );
@@ -1281,8 +1298,53 @@
addMTLVertexFormatCapabilities( tvOS_GPUFamily1_v3, Short, Vertex );
addMTLVertexFormatCapabilities( tvOS_GPUFamily1_v3, Half, Vertex );
addMTLVertexFormatCapabilities( tvOS_GPUFamily1_v3, UChar4Normalized_BGRA, Vertex );
+
+ // Disable for simulator last.
+#if MVK_TVOS_SIMULATOR
+ disableAllMTLPixelFormatCapabilities(R8Unorm_sRGB);
+ disableAllMTLPixelFormatCapabilities(RG8Unorm_sRGB);
+ disableAllMTLPixelFormatCapabilities(B5G6R5Unorm);
+ disableAllMTLPixelFormatCapabilities(A1BGR5Unorm);
+ disableAllMTLPixelFormatCapabilities(ABGR4Unorm);
+ disableAllMTLPixelFormatCapabilities(BGR5A1Unorm);
+
+ disableAllMTLPixelFormatCapabilities(BGRA10_XR);
+ disableAllMTLPixelFormatCapabilities(BGRA10_XR_sRGB);
+ disableAllMTLPixelFormatCapabilities(BGR10_XR);
+ disableAllMTLPixelFormatCapabilities(BGR10_XR_sRGB);
+
+ disableAllMTLPixelFormatCapabilities(GBGR422);
+ disableAllMTLPixelFormatCapabilities(BGRG422);
+
+ disableMTLPixelFormatCapabilities(RGB9E5Float, ColorAtt);
+
+ disableMTLPixelFormatCapabilities(R8Unorm_sRGB, Write);
+ disableMTLPixelFormatCapabilities(RG8Unorm_sRGB, Write);
+ disableMTLPixelFormatCapabilities(RGBA8Unorm_sRGB, Write);
+ disableMTLPixelFormatCapabilities(BGRA8Unorm_sRGB, Write);
+ disableMTLPixelFormatCapabilities(PVRTC_RGBA_2BPP_sRGB, Write);
+ disableMTLPixelFormatCapabilities(PVRTC_RGBA_4BPP_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ETC2_RGB8_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ETC2_RGB8A1_sRGB, Write);
+ disableMTLPixelFormatCapabilities(EAC_RGBA8_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_4x4_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_5x4_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_5x5_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_6x5_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_6x6_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_8x5_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_8x6_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_8x8_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_10x5_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_10x6_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_10x8_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_10x10_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_12x10_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_12x12_sRGB, Write);
+#endif
}
#endif
+
#if MVK_IOS
void MVKPixelFormats::modifyMTLFormatCapabilities(id<MTLDevice> mtlDevice) {
addMTLPixelFormatCapabilities( iOS_GPUFamily2_v3, R8Unorm_sRGB, All );
@@ -1372,9 +1434,56 @@
addMTLVertexFormatCapabilities( iOS_GPUFamily1_v4, Short, Vertex );
addMTLVertexFormatCapabilities( iOS_GPUFamily1_v4, Half, Vertex );
addMTLVertexFormatCapabilities( iOS_GPUFamily1_v4, UChar4Normalized_BGRA, Vertex );
+
+// Disable for simulator last.
+#if MVK_IOS_SIMULATOR
+ disableAllMTLPixelFormatCapabilities(R8Unorm_sRGB);
+ disableAllMTLPixelFormatCapabilities(RG8Unorm_sRGB);
+ disableAllMTLPixelFormatCapabilities(B5G6R5Unorm);
+ disableAllMTLPixelFormatCapabilities(A1BGR5Unorm);
+ disableAllMTLPixelFormatCapabilities(ABGR4Unorm);
+ disableAllMTLPixelFormatCapabilities(BGR5A1Unorm);
+
+ disableAllMTLPixelFormatCapabilities(BGRA10_XR);
+ disableAllMTLPixelFormatCapabilities(BGRA10_XR_sRGB);
+ disableAllMTLPixelFormatCapabilities(BGR10_XR);
+ disableAllMTLPixelFormatCapabilities(BGR10_XR_sRGB);
+
+ disableAllMTLPixelFormatCapabilities(GBGR422);
+ disableAllMTLPixelFormatCapabilities(BGRG422);
+
+ disableMTLPixelFormatCapabilities(RGB9E5Float, ColorAtt);
+
+ disableMTLPixelFormatCapabilities(R8Unorm_sRGB, Write);
+ disableMTLPixelFormatCapabilities(RG8Unorm_sRGB, Write);
+ disableMTLPixelFormatCapabilities(RGBA8Unorm_sRGB, Write);
+ disableMTLPixelFormatCapabilities(BGRA8Unorm_sRGB, Write);
+ disableMTLPixelFormatCapabilities(PVRTC_RGBA_2BPP_sRGB, Write);
+ disableMTLPixelFormatCapabilities(PVRTC_RGBA_4BPP_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ETC2_RGB8_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ETC2_RGB8A1_sRGB, Write);
+ disableMTLPixelFormatCapabilities(EAC_RGBA8_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_4x4_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_5x4_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_5x5_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_6x5_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_6x6_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_8x5_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_8x6_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_8x8_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_10x5_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_10x6_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_10x8_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_10x10_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_12x10_sRGB, Write);
+ disableMTLPixelFormatCapabilities(ASTC_12x12_sRGB, Write);
+#endif
}
#endif
+
#undef addMTLPixelFormatCapabilities
+#undef disableMTLPixelFormatCapabilities
+#undef disableAllMTLPixelFormatCapabilities
#undef addMTLVertexFormatCapabilities
// Populates the VkFormat lookup maps and connects Vulkan and Metal pixel formats to one-another.
diff --git a/MoltenVKPackaging.xcodeproj/project.pbxproj b/MoltenVKPackaging.xcodeproj/project.pbxproj
index 48ade0b..a7c651a 100644
--- a/MoltenVKPackaging.xcodeproj/project.pbxproj
+++ b/MoltenVKPackaging.xcodeproj/project.pbxproj
@@ -64,8 +64,9 @@
buildPhases = (
);
dependencies = (
- A9AFC2602184EEF60084B396 /* PBXTargetDependency */,
A9AFC2622184EEF60084B396 /* PBXTargetDependency */,
+ A9AFC2602184EEF60084B396 /* PBXTargetDependency */,
+ A9FC5F5F249D277E003CB086 /* PBXTargetDependency */,
);
name = MoltenVK;
productName = Package;
@@ -199,6 +200,20 @@
remoteGlobalIDString = A975D58B2140586700D4834F;
remoteInfo = "MoltenVK-macOS";
};
+ A9FC5F5C249D2547003CB086 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = A92DB40E1CE0F89600FBC835 /* MoltenVKShaderConverter.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 2FEA0D142490381A00EEF3AD;
+ remoteInfo = "MoltenVKSPIRVToMSLConverter-tvOS";
+ };
+ A9FC5F5E249D277E003CB086 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = A90B2B1D1A9B6170008EE819 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 2FEA0A2F24902F5E00EEF3AD;
+ remoteInfo = "MoltenVK-tvOS";
+ };
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
@@ -208,10 +223,8 @@
A92DB3E61CE0F37D00FBC835 /* Whats_New.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = Whats_New.md; path = Docs/Whats_New.md; sourceTree = "<group>"; };
A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MoltenVK.xcodeproj; path = MoltenVK/MoltenVK.xcodeproj; sourceTree = "<group>"; };
A92DB40E1CE0F89600FBC835 /* MoltenVKShaderConverter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MoltenVKShaderConverter.xcodeproj; path = MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj; sourceTree = "<group>"; };
- A92EF7C521856EA200C8B91B /* package_ios.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_ios.sh; sourceTree = "<group>"; };
A92EF7C621856EA200C8B91B /* package_moltenvk.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_moltenvk.sh; sourceTree = "<group>"; };
A92EF7C721856EA200C8B91B /* package_shader_converter_tool.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_shader_converter_tool.sh; sourceTree = "<group>"; };
- A92EF7C821856EA200C8B91B /* package_macos.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_macos.sh; sourceTree = "<group>"; };
A92EF7C921856EA200C8B91B /* package_docs.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_docs.sh; sourceTree = "<group>"; };
A92EF7CA21856EA200C8B91B /* package_update_latest.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_update_latest.sh; sourceTree = "<group>"; };
A92EF7CB21856EA300C8B91B /* package_shader_converter.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_shader_converter.sh; sourceTree = "<group>"; };
@@ -225,6 +238,13 @@
A9C70F45221B04C800FBA31A /* create_dylib_ios.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_dylib_ios.sh; sourceTree = "<group>"; };
A9DA8340218A198C002AA662 /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .travis.yml; sourceTree = "<group>"; };
A9DA8341218A198C002AA662 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitignore; sourceTree = "<group>"; };
+ A9EE084A249BD49200E523A2 /* create_fat_lib_func.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_lib_func.sh; sourceTree = "<group>"; };
+ A9EE084E249BD49200E523A2 /* create_fat_libs.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_libs.sh; sourceTree = "<group>"; };
+ A9EE0851249BD71C00E523A2 /* create_fat_libs_ios.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_libs_ios.sh; sourceTree = "<group>"; };
+ A9FC5F60249D2ED3003CB086 /* package_all.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_all.sh; sourceTree = "<group>"; };
+ A9FC5F64249D3778003CB086 /* create_dylib_tvos.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_dylib_tvos.sh; sourceTree = "<group>"; };
+ A9FC5F69249D3843003CB086 /* create_framework_tvos.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_framework_tvos.sh; sourceTree = "<group>"; };
+ A9FC5F6A249D38DF003CB086 /* create_fat_libs_tvos.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_libs_tvos.sh; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
@@ -254,7 +274,7 @@
isa = PBXGroup;
children = (
A92DB3F51CE0F72500FBC835 /* libMoltenVK.a */,
- 2FEA0ABE2490302F00EEF3AD /* libMoltenVK-tvOS.a */,
+ 2FEA0ABE2490302F00EEF3AD /* libMoltenVK.a */,
A92DB3F71CE0F72500FBC835 /* libMoltenVK.a */,
);
name = Products;
@@ -265,13 +285,18 @@
children = (
A9C70F45221B04C800FBA31A /* create_dylib_ios.sh */,
A9C70F41221B04C800FBA31A /* create_dylib_macos.sh */,
+ A9FC5F64249D3778003CB086 /* create_dylib_tvos.sh */,
A975D55C213F25D700D4834F /* create_dylib.sh */,
+ A9EE084A249BD49200E523A2 /* create_fat_lib_func.sh */,
+ A9EE0851249BD71C00E523A2 /* create_fat_libs_ios.sh */,
+ A9FC5F6A249D38DF003CB086 /* create_fat_libs_tvos.sh */,
+ A9EE084E249BD49200E523A2 /* create_fat_libs.sh */,
A941E2B1221AEBD000890C56 /* create_framework_ios.sh */,
A941E2B2221AEBD000890C56 /* create_framework_macos.sh */,
+ A9FC5F69249D3843003CB086 /* create_framework_tvos.sh */,
A99A760321852584000A8E2A /* create_framework.sh */,
+ A9FC5F60249D2ED3003CB086 /* package_all.sh */,
A92EF7C921856EA200C8B91B /* package_docs.sh */,
- A92EF7C521856EA200C8B91B /* package_ios.sh */,
- A92EF7C821856EA200C8B91B /* package_macos.sh */,
A92EF7C621856EA200C8B91B /* package_moltenvk.sh */,
A9149F7A221A528900DD7C6C /* package_shader_converter_lib.sh */,
A92EF7C721856EA200C8B91B /* package_shader_converter_tool.sh */,
@@ -287,9 +312,10 @@
children = (
A981498B1FB6B566005F00B4 /* MoltenVKShaderConverter */,
A981498D1FB6B566005F00B4 /* libMoltenVKGLSLToSPIRVConverter.a */,
- 2FEA0ADC2490308E00EEF3AD /* libMoltenVKGLSLToSPIRVConverter-tvOS.a */,
+ 2FEA0ADC2490308E00EEF3AD /* libMoltenVKGLSLToSPIRVConverter.a */,
A981498F1FB6B566005F00B4 /* libMoltenVKGLSLToSPIRVConverter.a */,
A98149911FB6B566005F00B4 /* libMoltenVKSPIRVToMSLConverter.a */,
+ A9FC5F5D249D2547003CB086 /* libMoltenVKSPIRVToMSLConverter.a */,
A98149931FB6B566005F00B4 /* libMoltenVKSPIRVToMSLConverter.a */,
);
name = Products;
@@ -349,17 +375,17 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
- 2FEA0ABE2490302F00EEF3AD /* libMoltenVK-tvOS.a */ = {
+ 2FEA0ABE2490302F00EEF3AD /* libMoltenVK.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
- path = "libMoltenVK-tvOS.a";
+ path = libMoltenVK.a;
remoteRef = 2FEA0ABD2490302F00EEF3AD /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
- 2FEA0ADC2490308E00EEF3AD /* libMoltenVKGLSLToSPIRVConverter-tvOS.a */ = {
+ 2FEA0ADC2490308E00EEF3AD /* libMoltenVKGLSLToSPIRVConverter.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
- path = "libMoltenVKGLSLToSPIRVConverter-tvOS.a";
+ path = libMoltenVKGLSLToSPIRVConverter.a;
remoteRef = 2FEA0ADB2490308E00EEF3AD /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
@@ -412,6 +438,13 @@
remoteRef = A98149921FB6B566005F00B4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
+ A9FC5F5D249D2547003CB086 /* libMoltenVKSPIRVToMSLConverter.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libMoltenVKSPIRVToMSLConverter.a;
+ remoteRef = A9FC5F5C249D2547003CB086 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
/* End PBXReferenceProxy section */
/* Begin PBXShellScriptBuildPhase section */
@@ -427,7 +460,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Scripts/package_tvos.sh\"\n";
+ shellScript = "export MVK_OS=\"tvOS\"\nexport MVK_BUILT_PROD_DIR=\"${BUILT_PRODUCTS_DIR}-${MVK_OS}\"\n\n. \"${SRCROOT}/Scripts/package_all.sh\"\n";
};
A975D5872140585200D4834F /* Package MoltenVK */ = {
isa = PBXShellScriptBuildPhase;
@@ -441,7 +474,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Scripts/package_ios.sh\"\n";
+ shellScript = "export MVK_OS=\"iOS\"\nexport MVK_BUILT_PROD_DIR=\"${BUILT_PRODUCTS_DIR}-${MVK_OS}\"\n\n. \"${SRCROOT}/Scripts/package_all.sh\"\n";
};
A975D59A2140586700D4834F /* Package MoltenVK */ = {
isa = PBXShellScriptBuildPhase;
@@ -455,7 +488,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Scripts/package_macos.sh\"\n";
+ shellScript = "export MVK_OS=\"macOS\"\nexport MVK_BUILT_PROD_DIR=\"${BUILT_PRODUCTS_DIR}\"\n\n. \"${SRCROOT}/Scripts/package_all.sh\"\n. \"${SRCROOT}/Scripts/package_shader_converter_tool.sh\"\n";
};
A9AD70122440ED3B00B9E254 /* Package MoltenVK */ = {
isa = PBXShellScriptBuildPhase;
@@ -469,7 +502,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "export MVK_BUILT_PROD_PATH=\"${BUILT_PRODUCTS_DIR}\"\n\"${SRCROOT}/Scripts/package_shader_converter_tool.sh\"\n\"${SRCROOT}/Scripts/package_update_latest.sh\"\n";
+ shellScript = "export MVK_BUILT_PROD_PATH=\"${BUILT_PRODUCTS_DIR}\"\n. \"${SRCROOT}/Scripts/package_shader_converter_tool.sh\"\n. \"${SRCROOT}/Scripts/package_update_latest.sh\"\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -519,6 +552,11 @@
target = A975D58B2140586700D4834F /* MoltenVK-macOS */;
targetProxy = A9AFC2612184EEF60084B396 /* PBXContainerItemProxy */;
};
+ A9FC5F5F249D277E003CB086 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 2FEA0A2F24902F5E00EEF3AD /* MoltenVK-tvOS */;
+ targetProxy = A9FC5F5E249D277E003CB086 /* PBXContainerItemProxy */;
+ };
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
diff --git "a/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050tvOS only\051.xcscheme" "b/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050tvOS only\051.xcscheme"
new file mode 100644
index 0000000..3c8229a
--- /dev/null
+++ "b/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050tvOS only\051.xcscheme"
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "1150"
+ version = "2.0">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "2FEA0A2F24902F5E00EEF3AD"
+ BuildableName = "MoltenVK-tvOS"
+ BlueprintName = "MoltenVK-tvOS"
+ ReferencedContainer = "container:MoltenVKPackaging.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ </Testables>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Release"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ disableMainThreadChecker = "YES"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "NO"
+ debugXPCServices = "NO"
+ debugServiceExtension = "internal"
+ enableGPUFrameCaptureMode = "3"
+ enableGPUValidationMode = "1"
+ allowLocationSimulation = "NO"
+ queueDebuggingEnabled = "No">
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj
index 63605d4..e34f10b 100644
--- a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj
+++ b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj
@@ -394,6 +394,7 @@
2FEA0ACB2490305800EEF3AD /* Sources */,
2FEA0ACF2490305800EEF3AD /* Frameworks */,
2FEA0AD22490305800EEF3AD /* Create Dynamic Library */,
+ A9FC5F6B249D3959003CB086 /* Create Fat Libraries */,
2FEA0AD32490305800EEF3AD /* Create Framework */,
);
buildRules = (
@@ -413,6 +414,7 @@
2FEA0D072490381A00EEF3AD /* Sources */,
2FEA0D0C2490381A00EEF3AD /* Frameworks */,
2FEA0D0F2490381A00EEF3AD /* Create Dynamic Library */,
+ A9FC5F6C249D3987003CB086 /* Create Fat Libraries */,
2FEA0D102490381A00EEF3AD /* Create Framework */,
);
buildRules = (
@@ -450,6 +452,7 @@
A93747271A9A8B2900F29B34 /* Sources */,
A972AD2821CEE6310013AB25 /* Frameworks */,
A9C70F49221B075700FBA31A /* Create Dynamic Library */,
+ A9303625249BDF6B00DE139C /* Create Fat Libraries */,
A941E2A7221AC9C300890C56 /* Create Framework */,
);
buildRules = (
@@ -488,6 +491,7 @@
A93903BA1C57E9D700FE90DC /* Sources */,
A972AD2E21CEE6F50013AB25 /* Frameworks */,
A9C70F4B221B077C00FBA31A /* Create Dynamic Library */,
+ A9303626249BDFA000DE139C /* Create Fat Libraries */,
A941E2A8221AC9E800890C56 /* Create Framework */,
);
buildRules = (
@@ -644,6 +648,42 @@
shellPath = /bin/sh;
shellScript = ". \"${SRCROOT}/../Scripts/create_framework_tvos.sh\"\n";
};
+ A9303625249BDF6B00DE139C /* Create Fat Libraries */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ name = "Create Fat Libraries";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = ". \"${SRCROOT}/../Scripts/create_fat_libs_ios.sh\"\n";
+ };
+ A9303626249BDFA000DE139C /* Create Fat Libraries */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ name = "Create Fat Libraries";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = ". \"${SRCROOT}/../Scripts/create_fat_libs_ios.sh\"\n";
+ };
A941E2A7221AC9C300890C56 /* Create Framework */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -788,6 +828,42 @@
shellPath = /bin/sh;
shellScript = ". \"${SRCROOT}/../Scripts/create_dylib_macos.sh\"\n";
};
+ A9FC5F6B249D3959003CB086 /* Create Fat Libraries */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ name = "Create Fat Libraries";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = ". \"${SRCROOT}/../Scripts/create_fat_libs_tvos.sh\"\n";
+ };
+ A9FC5F6C249D3987003CB086 /* Create Fat Libraries */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ name = "Create Fat Libraries";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = ". \"${SRCROOT}/../Scripts/create_fat_libs_tvos.sh\"\n";
+ };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -885,8 +961,6 @@
2FEA0AD52490305800EEF3AD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = arm64;
- BITCODE_GENERATION_MODE = bitcode;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO;
CLANG_WARN_UNREACHABLE_CODE = NO;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO;
@@ -895,17 +969,13 @@
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../External/build/Latest/tvOS\"";
PRODUCT_NAME = MoltenVKGLSLToSPIRVConverter;
SDKROOT = appletvos;
- TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 11.0;
- VALID_ARCHS = arm64;
};
name = Debug;
};
2FEA0AD62490305800EEF3AD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = arm64;
- BITCODE_GENERATION_MODE = bitcode;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO;
CLANG_WARN_UNREACHABLE_CODE = NO;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO;
@@ -914,17 +984,13 @@
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../External/build/Latest/tvOS\"";
PRODUCT_NAME = MoltenVKGLSLToSPIRVConverter;
SDKROOT = appletvos;
- TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 11.0;
- VALID_ARCHS = arm64;
};
name = Release;
};
2FEA0D122490381A00EEF3AD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = arm64;
- BITCODE_GENERATION_MODE = bitcode;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"SPIRV_CROSS_NAMESPACE_OVERRIDE=MVK_spirv_cross",
@@ -933,17 +999,13 @@
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../External/build/Latest/tvOS\"";
PRODUCT_NAME = MoltenVKSPIRVToMSLConverter;
SDKROOT = appletvos;
- TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 11.0;
- VALID_ARCHS = arm64;
};
name = Debug;
};
2FEA0D132490381A00EEF3AD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = arm64;
- BITCODE_GENERATION_MODE = bitcode;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"SPIRV_CROSS_NAMESPACE_OVERRIDE=MVK_spirv_cross",
@@ -952,9 +1014,7 @@
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../External/build/Latest/tvOS\"";
PRODUCT_NAME = MoltenVKSPIRVToMSLConverter;
SDKROOT = appletvos;
- TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 11.0;
- VALID_ARCHS = arm64;
};
name = Release;
};
@@ -997,7 +1057,6 @@
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../External/build/Latest/iOS\"";
PRODUCT_NAME = MoltenVKGLSLToSPIRVConverter;
SDKROOT = iphoneos;
- TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
@@ -1012,7 +1071,6 @@
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../External/build/Latest/iOS\"";
PRODUCT_NAME = MoltenVKGLSLToSPIRVConverter;
SDKROOT = iphoneos;
- TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
@@ -1055,7 +1113,6 @@
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../External/build/Latest/iOS\"";
PRODUCT_NAME = MoltenVKSPIRVToMSLConverter;
SDKROOT = iphoneos;
- TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
@@ -1070,7 +1127,6 @@
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../External/build/Latest/iOS\"";
PRODUCT_NAME = MoltenVKSPIRVToMSLConverter;
SDKROOT = iphoneos;
- TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
diff --git a/README.md b/README.md
index a8f4e84..b460cde 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
Table of Contents
-----------------
-- [Developing Vulkan Applications on macOS and iOS](#developing_vulkan)
+- [Developing Vulkan Applications on *macOS, iOS, and tvOS*](#developing_vulkan)
- [Introduction to **MoltenVK**](#intro)
- [Fetching **MoltenVK** Source Code](#install)
- [Building **MoltenVK**](#building)
@@ -30,8 +30,8 @@
<a name="developing_vulkan"></a>
-Developing Vulkan Applications for macOS and iOS
-------------------------------------------------
+Developing Vulkan Applications for *macOS, iOS, and tvOS*
+---------------------------------------------------------
The recommended method for developing a *Vulkan* application for *macOS* is to use the
[*Vulkan SDK*](https://vulkan.lunarg.com/sdk/home).
@@ -43,9 +43,10 @@
If you are developing a *Vulkan* application for *macOS*, it is highly recommended that you use the
[*Vulkan SDK*](https://vulkan.lunarg.com/sdk/home) and the **MoltenVK** library included in it.
-If you are developing a *Vulkan* application for *iOS*, or are developing a *Vulkan* application for
-*macOS* and want to use a different **MoltenVK** runtime library than provided in the *macOS Vulkan SDK*,
-you can use this document to learn how to build a **MoltenVK** runtime library from source code.
+If you are developing a *Vulkan* application for *iOS* or *tvOS*, or are developing a *Vulkan*
+application for *macOS* and want to use a different version of the **MoltenVK** runtime library
+provided in the *macOS Vulkan SDK*, you can use this document to learn how to build a **MoltenVK**
+runtime library from source code.
To learn how to integrate the **MoltenVK** runtime library into a game or application,
see the [`MoltenVK_Runtime_UserGuide.md `](Docs/MoltenVK_Runtime_UserGuide.md)
@@ -59,30 +60,31 @@
**MoltenVK** is a layered implementation of [*Vulkan 1.0*](https://www.khronos.org/vulkan)
graphics and compute functionality, that is built on Apple's [*Metal*](https://developer.apple.com/metal)
-graphics and compute framework on both *iOS* and *macOS*. **MoltenVK** allows you to use *Vulkan* graphics
-and compute functionality to develop modern, cross-platform, high-performance graphical games and applications,
-and to run them across many platforms, including both *iOS* and *macOS*.
+graphics and compute framework on *macOS*, *iOS*, and *tvOS*. **MoltenVK** allows you to use *Vulkan*
+graphics and compute functionality to develop modern, cross-platform, high-performance graphical
+games and applications, and to run them across many platforms, including *macOS*, *iOS*, and *tvOS*.
*Metal* uses a different shading language, the *Metal Shading Language (MSL)*, than
*Vulkan*, which uses *SPIR-V*. **MoltenVK** automatically converts your *SPIR-V* shaders
to their *MSL* equivalents.
-To provide *Vulkan* capability to the *iOS* and *macOS* platforms, **MoltenVK** uses *Apple's*
+To provide *Vulkan* capability to the *macOS*, *iOS*, and *tvOS* platforms, **MoltenVK** uses *Apple's*
publicly available API's, including *Metal*. **MoltenVK** does **_not_** use any private or
undocumented API calls or features, so your app will be compatible with all standard distribution
channels, including *Apple's App Store*.
The **MoltenVK** runtime package contains two products:
-- **MoltenVK** is a driver-level implementation of the [*Vulkan 1.0*](https://www.khronos.org/vulkan)
- graphics and compute API.
+- **MoltenVK** is a implementation of an almost-complete subset of the
+ [*Vulkan 1.0*](https://www.khronos.org/vulkan) graphics and compute API.
- **MoltenVKShaderConverter** converts *SPIR-V* shader code to *Metal Shading Language (MSL)*
shader code, and converts *GLSL* shader source code to *SPIR-V* shader code and/or
- *Metal Shading Language (MSL)* shader code. The *SPIR-V* converter is included in the
- **MoltenVK** runtime to automatically convert *SPIR-V* shaders to their *MSL* equivalents.
- In addition, both the *SPIR-V* and *GLSL* converters can be be packaged into a stand-alone
- command-line *macOS* tool for converting shaders at development time.
+ *Metal Shading Language (MSL)* shader code. The *SPIR-V* portion of the converter is also
+ embedded in the **MoltenVK** runtime to automatically convert *SPIR-V* shaders to their *MSL*
+ equivalents. In addition, both the *SPIR-V* and *GLSL* converters are packaged into a
+ stand-alone command-line `MoltenVKShaderConverter` *macOS* tool for converting shaders
+ at development time from the command line.
@@ -110,7 +112,19 @@
3. Retrieve and build the external libraries:
cd MoltenVK
- ./fetchDependencies
+ ./fetchDependencies [platform...]
+
+When running the `fetchDependencies` script, you must specify one or more platforms
+for which to build the external libraries. The platform choices include:
+
+ --all --macos --ios --iosfat --tvos --tvosfat
+
+You can specify multiple of these selections. The `--iosfat` and `--tvosfat` selection builds one
+binary for each external library, with each binary including code for both *iOS* and *iOS Simulator*
+platforms, or *tvOS* and *tvOS Simulator* platforms, respectively. The `--all` selection is the same
+as selecting `--macos --iosfat --tvosfat` and results in three binaries for each external library:
+a *macOS* binary, a *fat iOS* binary, and a *fat tvOS* binary. The more selections you include,
+the longer the build time.
For more information about the external open-source libraries used by **MoltenVK**,
see the [`ExternalRevisions/README.md`](ExternalRevisions/README.md) document.
@@ -123,13 +137,16 @@
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*.
->***Note:*** To support `IOSurfaces` on *iOS*, **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.
+>***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 `)
+build setting of `tvOS 11.0` or greater.
-Once built, the **MoltenVK** libraries can be run on *iOS* or *macOS* devices that support *Metal*.
+Once built, the **MoltenVK** libraries can be run on *macOS*, *iOS* or *tvOS* devices that support *Metal*,
+or on the *Xcode* *iOS Simulator* or *tvOS Simulator*.
-- At runtime, **MoltenVK** requires at least *macOS 10.11* or *iOS 9* (or *iOS 11* if using `IOSurfaces`).
+- At runtime, **MoltenVK** requires at least *macOS 10.11*, *iOS 9*, or *tvOS 9*
+ (or *iOS 11* or *tvOS 11* if using `IOSurfaces`).
- Information on *macOS* devices that are compatible with *Metal* can be found in
[this article](http://www.idownloadblog.com/2015/06/22/how-to-find-mac-el-capitan-metal-compatible).
- Information on *iOS* devices that are compatible with *Metal* can be found in
@@ -141,13 +158,14 @@
To build a **MoltenVK** runtime distribution package, suitable for testing and integrating into an app,
open `MoltenVKPackaging.xcodeproj` in *Xcode*, and use one of the following *Xcode Schemes*, depending
-on whether you want a **_Release_** or **_Debug_** configuration, and whether you want to build for both
-the *iOS* and *macOS* platforms, or just one platform (in **_Release_** configuration):
+on whether you want a **_Release_** or **_Debug_** configuration, and whether you want to build for all
+platforms, or just one platform (in **_Release_** configuration):
- **MoltenVK Package**
- **MoltenVK Package (Debug)**
-- **MoltenVK Package (iOS only)**
- **MoltenVK Package (macOS only)**
+- **MoltenVK Package (iOS only)**
+- **MoltenVK Package (tvOS only)**
Each of these`MoltenVKPackaging.xcodeproj` *Xcode* project *Schemes* puts the resulting packages in the
`Package` directory, creating it if necessary. This directory contains separate `Release` and `Debug`
@@ -165,32 +183,43 @@
### Building from the Command Line
If you prefer to build **MoltenVK** from the command line, or to include the activity in a larger build script,
-you can do so using the following command within the `MoltenVK` repository folder, and identifying one of the
-*Xcode Schemes* from the list above. For example, the following command will build **MoltenVK** in the
-**_Release_** configuration for both *macOS* and *iOS*:
+you can do so by executing a command similar to the following command within the `MoltenVK` repository folder,
+and identifying one of the *Xcode Schemes* from the list above. For example, the following command will build
+**MoltenVK** in the **_Debug_** configuration for *macOS* only:
- xcodebuild -quiet -project MoltenVKPackaging.xcodeproj -scheme "MoltenVK Package" build
+ xcodebuild build -quiet -project MoltenVKPackaging.xcodeproj -scheme "MoltenVK Package (macOS only)" -configuration "Debug"
Alternately, you can use the basic `Makefile` in the `MoltenVK` repository folder to build **MoltenVK**
-in the **_Release_** configuration from the command line. The following `make` targets are provided:
+from the command line. The following `make` targets are provided:
make
make all
make macos
make ios
+ make iosfat
+ make tvos
+ make tvosfat
+
+ make all-debug
+ make macos-debug
+ make ios-debug
+ make iosfat-debug
+ make tvos-debug
+ make tvosfat-debug
+
make clean
make install
-
-Running `make all` is the same as running both `make macos` and `make ios`. Running `make` with no
-arguments is the same as running `make all`.
-
-The `install` target will copy the most recently built *macOS* `MoltenVK.framework` into
-the `/Library/Frameworks` folder of your computer. Since `/Library/Frameworks` is protected,
-you will generally need to run it as `sudo make install` and enter your password.
-
-The `install` target just installs the built framework, it does not first build the framework.
-So you will first need to at least run `make macos`, or use *Xcode* to build the framework as described above.
+- The `all` target is the default target. Running `make` with no arguments is the same as running `make all`.
+- The `*fat*` targets build fat binaries containing both platform and simulator code.
+- The `*-debug` targets build the binaries using the **_Debug_** configuration.
+- The `all` target executes the `macos`, `iosfat`, and `tvosfat` targets.
+- The `all-debug` target executes the `macos-debug`, `iosfat-debug`, and `tvosfat-debug` targets.
+- The `install` target will copy the most recently built *macOS* `MoltenVK.framework` into
+ the `/Library/Frameworks` folder of your computer. Since `/Library/Frameworks` is protected,
+ you will generally need to run it as `sudo make install` and enter your password.
+ The `install` target just installs the built framework, it does not first build the framework.
+ You will first need to at least run `make macos` first.
The `make` targets all require that *Xcode* is installed on your system.
@@ -198,20 +227,6 @@
building from within *Xcode*.
-### Building Within a Larger External Build Environment
-
-If you build **MoltenVK** as part of a larger build environment, that does not use the scripts or *Xcode*
-projects provided by **MoltenVK**, you may be interested in certain build options designed to allow you to
-customize the use of **MoltenVK** within your custom build environment. These options are not available
-in the default **MoltenVK** build environment described in the previous sections.
-
-- `MoltenVKShaderConverter` uses the `SPIRV-Tools` external library to log SPIR-V code for diagnostics.
- If this is not useful to you, you can define the `MVK_EXCLUDE_SPIRV_TOOLS` when building the
- `MoltenVKShaderConverter` code base, and **MoltenVK** will not attempt to use code from the `SPIRV-Tools`
- repository. In this way, you will not need to retrieve or build the `SPIRV-Tools` repository, or link to
- a `SPIRV-Tools` external library.
-
-
<a name="demos"></a>
Running the **MoltenVK** Demo Applications
@@ -219,7 +234,7 @@
Once you have compiled and built the **MoltenVK** runtime distribution package from this **MoltenVK** repository,
as described in the [Building **MoltenVK**](#building) section, you can explore how **MoltenVK** provides *Vulkan*
-support on *iOS* and *macOS* by investigating and running the demo applications that are included in **MoltenVK**.
+support on *macOS*, *iOS*, and *tvOS* by investigating and running the demo applications that are included in **MoltenVK**.
The **MoltenVK** demo apps are located in the `Demos` folder. Each demo app is available as an *Xcode* project.
To review and run the included demo apps, open the `Demos/Demos.xcworkspace` workspace in *Xcode*.
@@ -250,19 +265,20 @@
**MoltenVK** and *Vulkan* Compliance
------------------------------------
-**MoltenVK** is designed to be a *Vulkan 1.0* driver that runs on *macOS* and *iOS* platforms by mapping *Vulkan*
-capability to native *Metal* capability.
+**MoltenVK** is designed to be an implementation of a *Vulkan 1.0* subset that runs on *macOS*, *iOS*,
+and *tvOS* platforms by mapping *Vulkan* capability to native *Metal* capability.
The fundamental design and development goal of **MoltenVK** is to provide this capability in a way that
is both maximally compliant with the *Vulkan 1.0* specification, and maximally performant.
Such compliance and performance is inherently affected by the capability available through *Metal*, as the
-native driver on *macOS* and *iOS* platforms. *Vulkan* compliance may fall into one of the following categories:
+native graphics driver on *macOS*, *iOS*, and *tvOS* platforms. *Vulkan* compliance may fall into one of
+the following categories:
-- Direct mapping between *Vulkan* capabilities and *Metal* capabilities. Within **MoltenVK**, almost all capability
- is the result of this type of direct mapping.
+- Direct mapping between *Vulkan* capabilities and *Metal* capabilities. Within **MoltenVK**, the vast
+ majority of *Vulkan* capability is the result of this type of direct mapping.
-- Synthesized compliance through alternate implementation. A very small amount of capability is provided using
+- Synthesized compliance through alternate implementation. A small amount of capability is provided using
this mechanism, such as via an extra render or compute shader stage.
- Non-compliance. This appears where the capabilities of *Vulkan* and *Metal* are sufficiently different, that
@@ -276,10 +292,11 @@
of non-compliance, and engage in discussions about how compliance can be improved, and non-compliant features can
be implemented or worked around.
-**MoltenVK** is a key component of the [*Khronos Vulkan Portability Initiative*](https://www.khronos.org/vulkan/portability-initiative),
+**MoltenVK** is a key component of the
+[*Khronos Vulkan Portability Initiative*](https://www.khronos.org/vulkan/portability-initiative),
whose intention is to provide specifications, resources, and tools to allow developers to understand and design
their *Vulkan* apps for maximum cross-platform compatibility and portability, including on platforms, such as
-*macOS* and *iOS*, where a native *Vulkan* driver is not available.
+*macOS*, *iOS*, and *tvOS*, where a native *Vulkan* driver is not available.
diff --git a/Scripts/create_dylib.sh b/Scripts/create_dylib.sh
index 2448259..aa4c6a9 100755
--- a/Scripts/create_dylib.sh
+++ b/Scripts/create_dylib.sh
@@ -2,11 +2,12 @@
set -e
+export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}"
export MVK_DYLIB_NAME="lib${PRODUCT_NAME}.dylib"
export MVK_SYS_FWK_DIR="${SDK_DIR}/System/Library/Frameworks"
export MVK_USR_LIB_DIR="${SDK_DIR}/usr/lib"
-mkdir -p "${BUILT_PRODUCTS_DIR}/dynamic"
+mkdir -p "${MVK_BUILT_PROD_DIR}/dynamic"
if test x"${ENABLE_BITCODE}" = xYES; then
MVK_EMBED_BITCODE="-fembed-bitcode"
@@ -26,7 +27,7 @@
-stdlib=${CLANG_CXX_LIBRARY} \
-dynamiclib \
$(printf -- "-arch %s " ${ARCHS}) \
--m${MVK_OS}-version-min=${MVK_MIN_OS_VERSION} \
+-m${MVK_OS_CLANG}-version-min=${MVK_MIN_OS_VERSION} \
-compatibility_version 1.0.0 -current_version 1.0.0 \
-install_name "@rpath/${MVK_DYLIB_NAME}" \
-Wno-incompatible-sysroot \
@@ -37,11 +38,11 @@
-iframework ${MVK_SYS_FWK_DIR} \
-framework Metal ${MVK_IOSURFACE_FWK} -framework ${MVK_UX_FWK} -framework QuartzCore -framework CoreGraphics ${MVK_IOKIT_FWK} -framework Foundation \
--library-directory ${MVK_USR_LIB_DIR} \
--o "${BUILT_PRODUCTS_DIR}/dynamic/${MVK_DYLIB_NAME}" \
--force_load "${BUILT_PRODUCTS_DIR}/lib${PRODUCT_NAME}.a"
+-o "${MVK_BUILT_PROD_DIR}/dynamic/${MVK_DYLIB_NAME}" \
+-force_load "${MVK_BUILT_PROD_DIR}/lib${PRODUCT_NAME}.a"
if test "$CONFIGURATION" = Debug; then
- mkdir -p "${BUILT_PRODUCTS_DIR}/dynamic"
- dsymutil "${BUILT_PRODUCTS_DIR}/dynamic/${MVK_DYLIB_NAME}" \
- -o "${BUILT_PRODUCTS_DIR}/dynamic/${MVK_DYLIB_NAME}.dSYM"
+ mkdir -p "${MVK_BUILT_PROD_DIR}/dynamic"
+ dsymutil "${MVK_BUILT_PROD_DIR}/dynamic/${MVK_DYLIB_NAME}" \
+ -o "${MVK_BUILT_PROD_DIR}/dynamic/${MVK_DYLIB_NAME}.dSYM"
fi
diff --git a/Scripts/create_dylib_ios.sh b/Scripts/create_dylib_ios.sh
index 0146419..c2ee93c 100755
--- a/Scripts/create_dylib_ios.sh
+++ b/Scripts/create_dylib_ios.sh
@@ -2,7 +2,7 @@
set -e
-export MVK_OS="ios"
+export MVK_OS_CLANG="ios"
export MVK_UX_FWK="UIKit"
export MVK_MIN_OS_VERSION=${IPHONEOS_DEPLOYMENT_TARGET}
export MVK_IOSURFACE_FWK="-framework IOSurface"
@@ -11,7 +11,7 @@
# Do not link to IOSurface if deploying to iOS versions below 11.0, doing so will
# link IOSurface as a private framework, which will trigger App Store rejection.
if [ $(echo "${MVK_MIN_OS_VERSION} < 11.0" | bc) -eq 1 ]; then
-MVK_IOSURFACE_FWK=""
+ MVK_IOSURFACE_FWK=""
fi
. "${SRCROOT}/../Scripts/create_dylib.sh"
diff --git a/Scripts/create_dylib_macos.sh b/Scripts/create_dylib_macos.sh
index 8007fc9..0f3447c 100755
--- a/Scripts/create_dylib_macos.sh
+++ b/Scripts/create_dylib_macos.sh
@@ -2,7 +2,7 @@
set -e
-export MVK_OS="macosx"
+export MVK_OS_CLANG="macosx"
export MVK_UX_FWK="AppKit"
export MVK_MIN_OS_VERSION=${MACOSX_DEPLOYMENT_TARGET}
export MVK_IOSURFACE_FWK="-framework IOSurface"
diff --git a/Scripts/create_dylib_tvos.sh b/Scripts/create_dylib_tvos.sh
index 7617c4d..33cea2e 100755
--- a/Scripts/create_dylib_tvos.sh
+++ b/Scripts/create_dylib_tvos.sh
@@ -2,10 +2,16 @@
set -e
-export MVK_OS="tvos"
+export MVK_OS_CLANG="tvos"
export MVK_UX_FWK="UIKit"
export MVK_MIN_OS_VERSION=${TVOS_DEPLOYMENT_TARGET}
export MVK_IOSURFACE_FWK="-framework IOSurface"
export MVK_IOKIT_FWK=""
+# Do not link to IOSurface if deploying to tvOS versions below 11.0, doing so will
+# link IOSurface as a private framework, which will trigger App Store rejection.
+if [ $(echo "${MVK_MIN_OS_VERSION} < 11.0" | bc) -eq 1 ]; then
+ MVK_IOSURFACE_FWK=""
+fi
+
. "${SRCROOT}/../Scripts/create_dylib.sh"
diff --git a/Scripts/create_fat_ext_libs.sh b/Scripts/create_fat_ext_libs.sh
new file mode 100755
index 0000000..fb0a3ac
--- /dev/null
+++ b/Scripts/create_fat_ext_libs.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# Load functions
+. "${SRCROOT}/Scripts/create_fat_lib_func.sh"
+
+set -e
+
+export MVK_BUILT_OS_PROD_DIR="${BUILT_PRODUCTS_DIR}-${MVK_OS_PROD_EXTN}"
+export MVK_BUILT_SIM_PROD_DIR="${BUILT_PRODUCTS_DIR}-${MVK_SIM_PROD_EXTN}"
+export MVK_BUILT_FAT_PROD_DIR="${BUILT_PRODUCTS_DIR}-${MVK_OS}"
+
+create_fat_lib "libSPIRVCross.a"
+create_fat_lib "libSPIRVTools.a"
+create_fat_lib "libglslang.a"
+
diff --git a/Scripts/create_fat_lib_func.sh b/Scripts/create_fat_lib_func.sh
new file mode 100755
index 0000000..6d48b6f
--- /dev/null
+++ b/Scripts/create_fat_lib_func.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# If both platform and simulator lib files exist, create a fat file
+# from them both, otherwise if only one exists, copy it to the fat file.
+#
+# Takes one parameter:
+# 1 - filename
+#
+# Requires 3 build settings:
+# MVK_BUILT_OS_PROD_DIR - location to find OS input file
+# MVK_BUILT_SIM_PROD_DIR - location to find simulator input file
+# MVK_BUILT_FAT_PROD_DIR - location to put fat output file
+function create_fat_lib() {
+ FILE_NAME=${1}
+ BUILT_OS_PROD_FILE="${MVK_BUILT_OS_PROD_DIR}/${FILE_NAME}"
+ BUILT_SIM_PROD_FILE="${MVK_BUILT_SIM_PROD_DIR}/${FILE_NAME}"
+ BUILT_FAT_PROD_FILE="${MVK_BUILT_FAT_PROD_DIR}/${FILE_NAME}"
+
+ if [ ! -e "${MVK_BUILT_FAT_PROD_DIR}" ]; then
+ mkdir -p "${MVK_BUILT_FAT_PROD_DIR}"
+ fi
+ rm -rf "${BUILT_FAT_PROD_FILE}"
+
+ if test -e "${BUILT_OS_PROD_FILE}"; then
+ if test -e "${BUILT_SIM_PROD_FILE}"; then
+ lipo \
+ -create \
+ -output "${BUILT_FAT_PROD_FILE}" \
+ "${BUILT_OS_PROD_FILE}" \
+ "${BUILT_SIM_PROD_FILE}"
+ else
+ cp -a "${BUILT_OS_PROD_FILE}" "${BUILT_FAT_PROD_FILE}"
+ fi
+ elif test -e "${BUILT_SIM_PROD_FILE}"; then
+ cp -a "${BUILT_SIM_PROD_FILE}" "${BUILT_FAT_PROD_FILE}"
+ fi
+}
diff --git a/Scripts/create_fat_libs.sh b/Scripts/create_fat_libs.sh
new file mode 100755
index 0000000..4a2f922
--- /dev/null
+++ b/Scripts/create_fat_libs.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# Load functions
+. "${SRCROOT}/../Scripts/create_fat_lib_func.sh"
+
+set -e
+
+#Static library
+export MVK_BUILT_OS_PROD_DIR="${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-${MVK_OS_PROD_EXTN}"
+export MVK_BUILT_SIM_PROD_DIR="${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-${MVK_SIM_PROD_EXTN}"
+export MVK_BUILT_FAT_PROD_DIR="${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-${MVK_OS}"
+create_fat_lib "lib${PRODUCT_NAME}.a"
+
+# Dynamic library
+export MVK_BUILT_OS_PROD_DIR="${MVK_BUILT_OS_PROD_DIR}/dynamic"
+export MVK_BUILT_SIM_PROD_DIR="${MVK_BUILT_SIM_PROD_DIR}/dynamic"
+export MVK_BUILT_FAT_PROD_DIR="${MVK_BUILT_FAT_PROD_DIR}/dynamic"
+create_fat_lib "lib${PRODUCT_NAME}.dylib"
+
+# Dynamic library dSYM
+if [ "${CONFIGURATION}" == "Debug" ]; then
+ cp -a "${MVK_BUILT_OS_PROD_DIR}/lib${PRODUCT_NAME}.dylib.dSYM" "${MVK_BUILT_FAT_PROD_DIR}"
+ export MVK_BUILT_OS_PROD_DIR="${MVK_BUILT_OS_PROD_DIR}/lib${PRODUCT_NAME}.dylib.dSYM/Contents/Resources/DWARF"
+ export MVK_BUILT_SIM_PROD_DIR="${MVK_BUILT_SIM_PROD_DIR}/lib${PRODUCT_NAME}.dylib.dSYM/Contents/Resources/DWARF"
+ export MVK_BUILT_FAT_PROD_DIR="${MVK_BUILT_FAT_PROD_DIR}/lib${PRODUCT_NAME}.dylib.dSYM/Contents/Resources/DWARF"
+ create_fat_lib "lib${PRODUCT_NAME}.dylib"
+fi
diff --git a/Scripts/create_fat_libs_ios.sh b/Scripts/create_fat_libs_ios.sh
new file mode 100755
index 0000000..b5d3797
--- /dev/null
+++ b/Scripts/create_fat_libs_ios.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -e
+
+export MVK_OS="iOS"
+export MVK_OS_PROD_EXTN="iphoneos"
+export MVK_SIM_PROD_EXTN="iphonesimulator"
+
+. "${SRCROOT}/../Scripts/create_fat_libs.sh"
+
diff --git a/Scripts/create_fat_libs_tvos.sh b/Scripts/create_fat_libs_tvos.sh
new file mode 100755
index 0000000..9003f0c
--- /dev/null
+++ b/Scripts/create_fat_libs_tvos.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -e
+
+export MVK_OS="tvOS"
+export MVK_OS_PROD_EXTN="appletvos"
+export MVK_SIM_PROD_EXTN="appletvsimulator"
+
+. "${SRCROOT}/../Scripts/create_fat_libs.sh"
+
diff --git a/Scripts/create_framework.sh b/Scripts/create_framework.sh
index c4f1d3f..37aaca4 100755
--- a/Scripts/create_framework.sh
+++ b/Scripts/create_framework.sh
@@ -3,13 +3,13 @@
set -e
export MVK_TMPLT_PATH="${PROJECT_DIR}/../Templates/framework/${MVK_OS}"
-export MVK_BUILT_FRWK_PATH="${BUILT_PRODUCTS_DIR}/framework/${PRODUCT_NAME}.framework"
+export MVK_BUILT_FRWK_PATH="${MVK_BUILT_PROD_DIR}/framework/${PRODUCT_NAME}.framework"
export MVK_BUILT_FRWK_CONTENT_PATH="${MVK_BUILT_FRWK_PATH}/${MVK_FRWK_SUBPATH}"
-mkdir -p "${BUILT_PRODUCTS_DIR}/framework"
+mkdir -p "${MVK_BUILT_PROD_DIR}/framework"
rm -rf "${MVK_BUILT_FRWK_PATH}"
cp -a "${MVK_TMPLT_PATH}/Template.framework" "${MVK_BUILT_FRWK_PATH}"
-cp -a "${BUILT_PRODUCTS_DIR}/lib${PRODUCT_NAME}.a" "${MVK_BUILT_FRWK_CONTENT_PATH}${PRODUCT_NAME}"
+cp -a "${MVK_BUILT_PROD_DIR}/lib${PRODUCT_NAME}.a" "${MVK_BUILT_FRWK_CONTENT_PATH}${PRODUCT_NAME}"
cp -pRL "${PROJECT_DIR}/include/${PRODUCT_NAME}/" "${MVK_BUILT_FRWK_CONTENT_PATH}Headers"
rm -f "${MVK_BUILT_FRWK_CONTENT_PATH}Headers/README" #Remove git empty directory placeholder file
diff --git a/Scripts/create_framework_ios.sh b/Scripts/create_framework_ios.sh
index 0d40200..c75be1f 100755
--- a/Scripts/create_framework_ios.sh
+++ b/Scripts/create_framework_ios.sh
@@ -3,6 +3,7 @@
set -e
export MVK_OS="iOS"
+export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-${MVK_OS}"
export MVK_FRWK_SUBPATH=""
. "${SRCROOT}/../Scripts/create_framework.sh"
diff --git a/Scripts/create_framework_macos.sh b/Scripts/create_framework_macos.sh
index fa493e4..d776044 100755
--- a/Scripts/create_framework_macos.sh
+++ b/Scripts/create_framework_macos.sh
@@ -3,6 +3,7 @@
set -e
export MVK_OS="macOS"
+export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}"
export MVK_FRWK_SUBPATH="Versions/Current/"
. "${SRCROOT}/../Scripts/create_framework.sh"
diff --git a/Scripts/create_framework_tvos.sh b/Scripts/create_framework_tvos.sh
index 2cf83ad..7cfde03 100755
--- a/Scripts/create_framework_tvos.sh
+++ b/Scripts/create_framework_tvos.sh
@@ -3,6 +3,7 @@
set -e
export MVK_OS="tvOS"
+export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-${MVK_OS}"
export MVK_FRWK_SUBPATH=""
. "${SRCROOT}/../Scripts/create_framework.sh"
diff --git a/Scripts/package_ios.sh b/Scripts/package_all.sh
similarity index 70%
rename from Scripts/package_ios.sh
rename to Scripts/package_all.sh
index 6216665..2a6c0ef 100755
--- a/Scripts/package_ios.sh
+++ b/Scripts/package_all.sh
@@ -1,8 +1,5 @@
#!/bin/bash
-export MVK_OS="iOS"
-export MVK_BUILT_PROD_PATH="${BUILT_PRODUCTS_DIR}-iphoneos"
-
. "${SRCROOT}/Scripts/package_moltenvk.sh"
. "${SRCROOT}/Scripts/package_shader_converter.sh"
. "${SRCROOT}/Scripts/package_docs.sh"
diff --git a/Scripts/package_ext_libs.sh b/Scripts/package_ext_libs.sh
index 221e7e1..68516a6 100755
--- a/Scripts/package_ext_libs.sh
+++ b/Scripts/package_ext_libs.sh
@@ -9,10 +9,3 @@
mkdir -p "${MVK_EXT_LIB_DST_OS_PATH}"
cp -a "${MVK_BUILT_PROD_PATH}/"*.a "${MVK_EXT_LIB_DST_OS_PATH}"
-
-# Assign symlink to Latest
-ln -sfn "${CONFIGURATION}" "${MVK_EXT_LIB_DST_PATH}/Latest"
-
-# Clean MoltenVK to ensure the next MoltenVK build will use the latest external library versions.
-make --quiet clean
-
diff --git a/Scripts/package_ext_libs_finish.sh b/Scripts/package_ext_libs_finish.sh
new file mode 100755
index 0000000..d44a2d3
--- /dev/null
+++ b/Scripts/package_ext_libs_finish.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+set -e
+
+export MVK_EXT_LIB_DST_PATH="${PROJECT_DIR}/External/build/"
+
+# Assign symlink to Latest
+ln -sfn "${CONFIGURATION}" "${MVK_EXT_LIB_DST_PATH}/Latest"
+
+# Clean MoltenVK to ensure the next MoltenVK build will use the latest external library versions.
+make --quiet clean
+
diff --git a/Scripts/package_ext_libs_ios.sh b/Scripts/package_ext_libs_ios.sh
deleted file mode 100755
index 4aaced3..0000000
--- a/Scripts/package_ext_libs_ios.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-export MVK_OS="iOS"
-export MVK_BUILT_PROD_PATH="${BUILT_PRODUCTS_DIR}-iphoneos"
-
-"${SRCROOT}/Scripts/package_ext_libs.sh"
-
diff --git a/Scripts/package_ext_libs_macos.sh b/Scripts/package_ext_libs_macos.sh
deleted file mode 100755
index fd44591..0000000
--- a/Scripts/package_ext_libs_macos.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-export MVK_OS="macOS"
-export MVK_BUILT_PROD_PATH="${BUILT_PRODUCTS_DIR}"
-
-"${SRCROOT}/Scripts/package_ext_libs.sh"
-
diff --git a/Scripts/package_ext_libs_tvos.sh b/Scripts/package_ext_libs_tvos.sh
deleted file mode 100755
index 02dae19..0000000
--- a/Scripts/package_ext_libs_tvos.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-export MVK_OS="tvOS"
-export MVK_BUILT_PROD_PATH="${BUILT_PRODUCTS_DIR}-appletvos"
-
-"${SRCROOT}/Scripts/package_ext_libs.sh"
-
diff --git a/Scripts/package_macos.sh b/Scripts/package_macos.sh
deleted file mode 100755
index 9f3038e..0000000
--- a/Scripts/package_macos.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-export MVK_OS="macOS"
-export MVK_BUILT_PROD_PATH="${BUILT_PRODUCTS_DIR}"
-
-. "${SRCROOT}/Scripts/package_moltenvk.sh"
-. "${SRCROOT}/Scripts/package_shader_converter.sh"
-. "${SRCROOT}/Scripts/package_shader_converter_tool.sh"
-. "${SRCROOT}/Scripts/package_docs.sh"
-. "${SRCROOT}/Scripts/package_update_latest.sh"
-
diff --git a/Scripts/package_moltenvk.sh b/Scripts/package_moltenvk.sh
index d5f8dba..766865b 100755
--- a/Scripts/package_moltenvk.sh
+++ b/Scripts/package_moltenvk.sh
@@ -10,17 +10,17 @@
rm -rf "${MVK_PKG_PROD_PATH_OS}"
mkdir -p "${MVK_PKG_PROD_PATH_OS}/static"
-cp -a "${MVK_BUILT_PROD_PATH}/lib${MVK_PROD_NAME}.a" "${MVK_PKG_PROD_PATH_OS}/static"
+cp -a "${MVK_BUILT_PROD_DIR}/lib${MVK_PROD_NAME}.a" "${MVK_PKG_PROD_PATH_OS}/static"
mkdir -p "${MVK_PKG_PROD_PATH_OS}/dynamic"
-cp -a "${MVK_BUILT_PROD_PATH}/dynamic/lib${MVK_PROD_NAME}.dylib" "${MVK_PKG_PROD_PATH_OS}/dynamic"
+cp -a "${MVK_BUILT_PROD_DIR}/dynamic/lib${MVK_PROD_NAME}.dylib" "${MVK_PKG_PROD_PATH_OS}/dynamic"
if test "$CONFIGURATION" = Debug; then
- cp -a "${MVK_BUILT_PROD_PATH}/dynamic/lib${MVK_PROD_NAME}.dylib.dSYM" "${MVK_PKG_PROD_PATH_OS}/dynamic"
+ cp -a "${MVK_BUILT_PROD_DIR}/dynamic/lib${MVK_PROD_NAME}.dylib.dSYM" "${MVK_PKG_PROD_PATH_OS}/dynamic"
fi
cp -a "${MVK_PROD_PROJ_PATH}/icd/${MVK_PROD_NAME}_icd.json" "${MVK_PKG_PROD_PATH_OS}/dynamic"
mkdir -p "${MVK_PKG_PROD_PATH_OS}/framework"
-cp -a "${MVK_BUILT_PROD_PATH}/framework/${MVK_PROD_NAME}.framework" "${MVK_PKG_PROD_PATH_OS}/framework"
+cp -a "${MVK_BUILT_PROD_DIR}/framework/${MVK_PROD_NAME}.framework" "${MVK_PKG_PROD_PATH_OS}/framework"
# Remove the code signature
rm -rf "${MVK_PKG_PROD_PATH_OS}/framework/${MVK_PROD_NAME}.framework/_CodeSignature"
diff --git a/Scripts/package_shader_converter_lib.sh b/Scripts/package_shader_converter_lib.sh
index 9859ae6..14cf732 100755
--- a/Scripts/package_shader_converter_lib.sh
+++ b/Scripts/package_shader_converter_lib.sh
@@ -9,13 +9,13 @@
rm -rf "${MVK_PKG_PROD_PATH_OS}"
mkdir -p "${MVK_PKG_PROD_PATH_OS}/static"
-cp -a "${MVK_BUILT_PROD_PATH}/lib${MVK_PROD_NAME}.a" "${MVK_PKG_PROD_PATH_OS}/static"
+cp -a "${MVK_BUILT_PROD_DIR}/lib${MVK_PROD_NAME}.a" "${MVK_PKG_PROD_PATH_OS}/static"
mkdir -p "${MVK_PKG_PROD_PATH_OS}/dynamic"
-cp -a "${MVK_BUILT_PROD_PATH}/dynamic/lib${MVK_PROD_NAME}.dylib" "${MVK_PKG_PROD_PATH_OS}/dynamic"
+cp -a "${MVK_BUILT_PROD_DIR}/dynamic/lib${MVK_PROD_NAME}.dylib" "${MVK_PKG_PROD_PATH_OS}/dynamic"
if test "$CONFIGURATION" = Debug; then
- cp -a "${MVK_BUILT_PROD_PATH}/dynamic/lib${MVK_PROD_NAME}.dylib.dSYM" "${MVK_PKG_PROD_PATH_OS}/dynamic"
+ cp -a "${MVK_BUILT_PROD_DIR}/dynamic/lib${MVK_PROD_NAME}.dylib.dSYM" "${MVK_PKG_PROD_PATH_OS}/dynamic"
fi
mkdir -p "${MVK_PKG_PROD_PATH_OS}/framework"
-cp -a "${MVK_BUILT_PROD_PATH}/framework/${MVK_PROD_NAME}.framework" "${MVK_PKG_PROD_PATH_OS}/framework"
+cp -a "${MVK_BUILT_PROD_DIR}/framework/${MVK_PROD_NAME}.framework" "${MVK_PKG_PROD_PATH_OS}/framework"
diff --git a/Scripts/package_shader_converter_tool.sh b/Scripts/package_shader_converter_tool.sh
index e893ec6..43330d4 100755
--- a/Scripts/package_shader_converter_tool.sh
+++ b/Scripts/package_shader_converter_tool.sh
@@ -7,4 +7,4 @@
rm -rf "${MVK_PKG_PROD_PATH_OS}"
mkdir -p "${MVK_PKG_PROD_PATH_OS}"
-cp -a "${MVK_BUILT_PROD_PATH}/${MVK_PROD_NAME}" "${MVK_PKG_PROD_PATH_OS}"
+cp -a "${MVK_BUILT_PROD_DIR}/${MVK_PROD_NAME}" "${MVK_PKG_PROD_PATH_OS}"
diff --git a/Scripts/package_tvos.sh b/Scripts/package_tvos.sh
deleted file mode 100755
index 7fbc950..0000000
--- a/Scripts/package_tvos.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-export MVK_OS="tvOS"
-export MVK_BUILT_PROD_PATH="${BUILT_PRODUCTS_DIR}-appletvos"
-
-. "${SRCROOT}/Scripts/package_moltenvk.sh"
-. "${SRCROOT}/Scripts/package_shader_converter.sh"
-. "${SRCROOT}/Scripts/package_docs.sh"
-. "${SRCROOT}/Scripts/package_update_latest.sh"
-
diff --git a/fetchDependencies b/fetchDependencies
index cd4f3a8..2404e7d 100755
--- a/fetchDependencies
+++ b/fetchDependencies
@@ -4,13 +4,41 @@
#
# fetchDependencies - Retrieves the correct versions of all dependencies
#
-# macOS usage: ./fetchDependencies [-v] [--debug] [--build-spirv-tools]
+# macOS usage: ./fetchDependencies [--ios] [--iosfat] [--tvos] [--tvosfat] [--macos] [--all]
+# [-v] [--debug] [--build-spirv-tools]
# [--v-headers-root path] [--spirv-cross-root path] [--glslang-root path]
#
+# --ios
+# Build the external libraries for the iOS platform.
+#
+# --iosfat
+# Build a single binary for each external library, each containing code
+# for both iOS and iOS Simulator platforms.
+#
+# --tvos
+# Build the external libraries for the tvOS platform.
+#
+# --tvosfat
+# Build a single binary for each external library, each containing code
+# for both tvOS and tvOS Simulator platforms.
+#
+# --macos
+# Build the external libraries for the macOS platform.
+#
+# --all
+# Equivalent to specifying [--iosfat --tvosfat --macos]. Results in thee
+# binaries for each external library: one for the iOS and iOS Simulator platforms,
+# one for the tvOS and tvOS Simulator platforms, and one for the macOS platform.
+#
+# Multiple platform options may be specified. At least one platform option must be specified.
+#
# --debug
# Build the external libraries in Debug mode, which may be useful when debugging
# and tracing calls into those libraries.
#
+# --no-parallel-build
+# Build the external libraries serially instead of in parallel using background processes.
+#
# --glslang-root path
# "path" specifies a directory path to a KhronosGroup/glslang repository.
# This repository does need to be built and the build directory must be in the
@@ -41,8 +69,15 @@
# ----------------- Functions -------------------
-XC_SCHEME_SFX=""
+BLD_IOS=""
+BLD_IOS_SIM=""
+BLD_TVOS=""
+BLD_TVOS_SIM=""
+BLD_MACOS=""
+BLD_SPECIFIED=""
+XC_CONFIG="Release"
XC_BUILD_VERBOSITY="-quiet"
+XC_USE_BCKGND="Y"
V_HEADERS_ROOT=""
SPIRV_CROSS_ROOT=""
GLSLANG_ROOT=""
@@ -50,8 +85,48 @@
while (( "$#" )); do
case "$1" in
+ --ios)
+ BLD_IOS="Y"
+ BLD_SPECIFIED="Y"
+ shift 1
+ ;;
+ --iosfat)
+ BLD_IOS="Y"
+ BLD_IOS_SIM="Y"
+ BLD_SPECIFIED="Y"
+ shift 1
+ ;;
+ --tvos)
+ BLD_TVOS="Y"
+ BLD_SPECIFIED="Y"
+ shift 1
+ ;;
+ --tvosfat)
+ BLD_TVOS="Y"
+ BLD_TVOS_SIM="Y"
+ BLD_SPECIFIED="Y"
+ shift 1
+ ;;
+ --macos)
+ BLD_MACOS="Y"
+ BLD_SPECIFIED="Y"
+ shift 1
+ ;;
+ --all)
+ BLD_IOS="Y"
+ BLD_IOS_SIM="Y"
+ BLD_TVOS="Y"
+ BLD_TVOS_SIM="Y"
+ BLD_MACOS="Y"
+ BLD_SPECIFIED="Y"
+ shift 1
+ ;;
--debug)
- XC_SCHEME_SFX=" (Debug)"
+ XC_CONFIG="Debug"
+ shift 1
+ ;;
+ --no-parallel-build)
+ XC_USE_BCKGND=""
shift 1
;;
-v)
@@ -85,6 +160,15 @@
esac
done
+# if no platform was specified, print usage message and exit
+if [ "$BLD_SPECIFIED" = "" ]; then
+ echo "ERROR: You did not specify a platform to build."
+ echo "Include one or more of the following platform options:"
+ echo " --ios --iosfat --tvos --tvosfat --macos --all"
+ echo "See the instructions in the fetchDependencies script for more info."
+ exit 1
+fi
+
# Update a repository. If it exists, fetch it; if not, clone it.
# $1 repo name
# $2 repo url
@@ -281,22 +365,102 @@
cd ..
-# -------------- Build MoltenVK dependencies -----------------
+# -------------- Build MoltenVK external library dependencies -----------------
echo
-echo ========== Building dependency libraries quietly. Please be patient on first build. ==========
-echo
+echo ========== Started building dependency libraries at `date +"%r"` ==========
+echo Please be patient on first build
+
+# Build an Xcode scheme for an OS and platform
+# 1 - OS
+# 2 - platform
+function build_impl() {
+ XC_OS=${1}
+ XC_PLTFM=${2}
+
+ XC_SCHEME="${EXT_DEPS}-${XC_OS}"
+ XC_LCL_DD_PATH="${XC_DD_PATH}/Intermediates/${XC_OS}"
+ XC_DEST="generic/platform=${XC_PLTFM}"
+
+ echo Building external libraries for ${XC_PLTFM}
+
+ xcodebuild \
+ -project "${XC_PROJ}" \
+ -scheme "${XC_SCHEME}" \
+ -destination "${XC_DEST}" \
+ -configuration "${XC_CONFIG}" \
+ -derivedDataPath "${XC_LCL_DD_PATH}" \
+ ${XC_BUILD_VERBOSITY} \
+ build
+
+ echo Completed building external libraries for ${XC_PLTFM}
+}
+
+# Select whether or not to run the build in parallel.
+# 1 - OS
+# 2 - platform
+function build() {
+ if [ "$XC_USE_BCKGND" != "" ]; then
+ build_impl ${1} ${2} &
+ else
+ build_impl ${1} ${2}
+ fi
+}
+
+# Build a fat library for the OS containing code for the OS and its Simulator
+# Builds serially to ensure both are built
+# 1 - OS
+function build_fat_impl() {
+ XC_OS=${1}
+
+ build_impl ${XC_OS} ${XC_OS}
+ build_impl ${XC_OS} "${XC_OS} Simulator"
+}
+
+# Select whether or not to run the build in parallel.
+# 1 - OS
+function build_fat() {
+ if [ "$XC_USE_BCKGND" != "" ]; then
+ build_fat_impl ${1} &
+ else
+ build_fat_impl ${1}
+ fi
+}
EXT_DEPS=ExternalDependencies
XC_PROJ="${EXT_DEPS}.xcodeproj"
-XC_SCHEME="${EXT_DEPS}${XC_SCHEME_SFX}"
XC_DD_PATH="${EXT_DIR}/build"
-xcodebuild \
- -project "${XC_PROJ}" \
- -scheme "${XC_SCHEME}" \
- -derivedDataPath "${XC_DD_PATH}" \
- ${XC_BUILD_VERBOSITY} \
- build
+# Structure build tasks by platform so they can be built in parallel per platform.
+# Content for each platform must be built in series to avoid
+trap "exit" INT TERM ERR
+trap "kill 0" EXIT
-echo ========== Done! ==========
+if [ "$BLD_MACOS" != "" ]; then
+ build "macOS" "macOS"
+fi
+if [ "$BLD_IOS" != "" ]; then
+ if [ "$BLD_IOS_SIM" != "" ]; then
+ build_fat "iOS"
+ else
+ build "iOS" "iOS"
+ fi
+fi
+
+if [ "$BLD_TVOS" != "" ]; then
+ if [ "$BLD_TVOS_SIM" != "" ]; then
+ build_fat "tvOS"
+ else
+ build "tvOS" "tvOS"
+ fi
+fi
+
+# Wait for any background process (if selected) to finish
+wait
+
+# Update latest symlink and clean MoltenVK for rebuild
+PROJECT_DIR="."
+CONFIGURATION=${XC_CONFIG}
+. "./Scripts/package_ext_libs_finish.sh"
+
+echo ========== Finished at `date +"%r"` ==========