diff --git a/Demos/Cube/Cube.xcodeproj/project.pbxproj b/Demos/Cube/Cube.xcodeproj/project.pbxproj index b8e50b41..a56ef1c6 100644 --- a/Demos/Cube/Cube.xcodeproj/project.pbxproj +++ b/Demos/Cube/Cube.xcodeproj/project.pbxproj @@ -7,9 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - A90998A02B4EE8C3002CEF67 /* libMoltenVK.dylib in Copy MoltenVK Library */ = {isa = PBXBuildFile; fileRef = A909989F2B4EE8C3002CEF67 /* libMoltenVK.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - A90998A32B4EFB51002CEF67 /* libMoltenVK.dylib in Copy MoltenVK Library */ = {isa = PBXBuildFile; fileRef = A90998A22B4EFB51002CEF67 /* libMoltenVK.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - A90998A62B4EFBAA002CEF67 /* libMoltenVK.dylib in Copy MoltenVK Library */ = {isa = PBXBuildFile; fileRef = A90998A52B4EFBAA002CEF67 /* libMoltenVK.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 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 */; }; @@ -29,40 +26,46 @@ A9B53B341C3AC15200ABC6F6 /* DemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B6F1C3AAE9800373FFD /* DemoViewController.m */; }; A9B53B351C3AC15200ABC6F6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B6C1C3AAE9800373FFD /* AppDelegate.m */; }; A9B53B361C3AC15200ABC6F6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B711C3AAE9800373FFD /* main.m */; }; + A9F4D8772B8590F2004AD576 /* MoltenVK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D8702B858DDE004AD576 /* MoltenVK.xcframework */; }; + A9F4D8782B8590F2004AD576 /* MoltenVK.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D8702B858DDE004AD576 /* MoltenVK.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + A9F4D87F2B88F7B1004AD576 /* MoltenVK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D8702B858DDE004AD576 /* MoltenVK.xcframework */; }; + A9F4D8802B88F7B1004AD576 /* MoltenVK.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D8702B858DDE004AD576 /* MoltenVK.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + A9F4D88A2B8A9C11004AD576 /* MoltenVK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D8702B858DDE004AD576 /* MoltenVK.xcframework */; }; + A9F4D88B2B8A9C11004AD576 /* MoltenVK.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D8702B858DDE004AD576 /* MoltenVK.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - A909989E2B4EE849002CEF67 /* Copy MoltenVK Library */ = { + A9F4D87A2B8590F2004AD576 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - A90998A02B4EE8C3002CEF67 /* libMoltenVK.dylib in Copy MoltenVK Library */, + A9F4D8782B8590F2004AD576 /* MoltenVK.xcframework in Embed Frameworks */, ); - name = "Copy MoltenVK Library"; + name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; - A90998A12B4EFA78002CEF67 /* Copy MoltenVK Library */ = { + A9F4D8822B88F7B1004AD576 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - A90998A32B4EFB51002CEF67 /* libMoltenVK.dylib in Copy MoltenVK Library */, + A9F4D8802B88F7B1004AD576 /* MoltenVK.xcframework in Embed Frameworks */, ); - name = "Copy MoltenVK Library"; + name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; - A90998A42B4EFB81002CEF67 /* Copy MoltenVK Library */ = { + A9F4D88C2B8A9C11004AD576 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - A90998A62B4EFBAA002CEF67 /* libMoltenVK.dylib in Copy MoltenVK Library */, + A9F4D88B2B8A9C11004AD576 /* MoltenVK.xcframework in Embed Frameworks */, ); - name = "Copy MoltenVK Library"; + name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ @@ -100,27 +103,32 @@ A9B67B8A1C3AAEA200373FFD /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; A9B67B8B1C3AAEA200373FFD /* macOS.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = macOS.xcassets; sourceTree = ""; }; A9B734FE2576E04000455E2A /* Cube.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Cube.entitlements; sourceTree = ""; }; + A9F4D8702B858DDE004AD576 /* MoltenVK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MoltenVK.xcframework; path = ../../Package/Latest/MoltenVK/dynamic/MoltenVK.xcframework; sourceTree = ""; }; + A9F4D8862B8A9BD8004AD576 /* MoltenVK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MoltenVK.xcframework; path = ../../Package/Latest/MoltenVK/dynamic/MoltenVK.xcframework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - A93DBF4424A2A4D500079F64 /* Frameworks */ = { + A9F4D8792B8590F2004AD576 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A9F4D8772B8590F2004AD576 /* MoltenVK.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - A9B53B1B1C3AC0BE00ABC6F6 /* Frameworks */ = { + A9F4D87D2B88F771004AD576 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A9F4D88A2B8A9C11004AD576 /* MoltenVK.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - A9B53B371C3AC15200ABC6F6 /* Frameworks */ = { + A9F4D8812B88F7B1004AD576 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A9F4D87F2B88F7B1004AD576 /* MoltenVK.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -216,6 +224,8 @@ A9C2ABA82185085B00DDBC03 /* Frameworks */ = { isa = PBXGroup; children = ( + A9F4D8702B858DDE004AD576 /* MoltenVK.xcframework */, + A9F4D8862B8A9BD8004AD576 /* MoltenVK.xcframework */, A90998A52B4EFBAA002CEF67 /* libMoltenVK.dylib */, A909989F2B4EE8C3002CEF67 /* libMoltenVK.dylib */, A90998A22B4EFB51002CEF67 /* libMoltenVK.dylib */, @@ -232,8 +242,8 @@ buildPhases = ( A93DBF3B24A2A4D500079F64 /* Resources */, A93DBF4024A2A4D500079F64 /* Sources */, - A90998A42B4EFB81002CEF67 /* Copy MoltenVK Library */, - A93DBF4424A2A4D500079F64 /* Frameworks */, + A9F4D8812B88F7B1004AD576 /* Frameworks */, + A9F4D8822B88F7B1004AD576 /* Embed Frameworks */, ); buildRules = ( ); @@ -250,8 +260,8 @@ buildPhases = ( A9B53B141C3AC0BE00ABC6F6 /* Resources */, A9B53B171C3AC0BE00ABC6F6 /* Sources */, - A909989E2B4EE849002CEF67 /* Copy MoltenVK Library */, - A9B53B1B1C3AC0BE00ABC6F6 /* Frameworks */, + A9F4D8792B8590F2004AD576 /* Frameworks */, + A9F4D87A2B8590F2004AD576 /* Embed Frameworks */, ); buildRules = ( ); @@ -268,9 +278,8 @@ buildPhases = ( A9B53B2E1C3AC15200ABC6F6 /* Resources */, A9B53B331C3AC15200ABC6F6 /* Sources */, - A90998A12B4EFA78002CEF67 /* Copy MoltenVK Library */, - A90998AE2B602480002CEF67 /* Copy MoltenVK Simulator Library */, - A9B53B371C3AC15200ABC6F6 /* Frameworks */, + A9F4D87D2B88F771004AD576 /* Frameworks */, + A9F4D88C2B8A9C11004AD576 /* Embed Frameworks */, ); buildRules = ( ); @@ -353,28 +362,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - A90998AE2B602480002CEF67 /* Copy MoltenVK Simulator Library */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Copy MoltenVK Simulator Library"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "#!/bin/bash\n\n# If running on the simulator, we need to overwrite the \n# iOS build of MoltenVK with the iOS Simulator build.\n# We can't use this script to copy the iOS build itself, \n# because it needs to be signed to run on an actual device.\n# The simulator build does not need to be signed.\nif [[ \"${PLATFORM_NAME}\" == \"iphonesimulator\" ]]; then \n\tmvk_lib_file=\"libMoltenVK.dylib\"\n\tmvk_lib_dir=\"${PROJECT_DIR}/../../MoltenVK/dylib/iOS-simulator\"\n\tapp_fwk_dir=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Frameworks\"\n\tcp -af \"${mvk_lib_dir}/${mvk_lib_file}\" \"${app_fwk_dir}/${mvk_lib_file}\"\nfi\n"; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ A93DBF4024A2A4D500079F64 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -421,7 +408,10 @@ MVK_SAMP_CUBE, ); INFOPLIST_FILE = "$(SRCROOT)/iOS/InfoTV.plist"; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "@executable_path/Frameworks", + "@executable_path/Frameworks/MoltenVK.framework", + ); MARKETING_VERSION = 1; PRODUCT_NAME = Cube; SDKROOT = appletvos; @@ -441,7 +431,10 @@ MVK_SAMP_CUBE, ); INFOPLIST_FILE = "$(SRCROOT)/iOS/InfoTV.plist"; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "@executable_path/Frameworks", + "@executable_path/Frameworks/MoltenVK.framework", + ); MARKETING_VERSION = 1; PRODUCT_NAME = Cube; SDKROOT = appletvos; @@ -458,13 +451,17 @@ CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=macosx*]" = ""; GCC_PREFIX_HEADER = "$(SRCROOT)/macOS/Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", MVK_SAMP_CUBE, ); INFOPLIST_FILE = "$(SRCROOT)/macOS/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "@executable_path/../Frameworks", + "@executable_path/../Frameworks/MoltenVK.framework", + ); MACOSX_DEPLOYMENT_TARGET = 10.14; PRODUCT_NAME = Cube; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -481,13 +478,17 @@ CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=macosx*]" = ""; GCC_PREFIX_HEADER = "$(SRCROOT)/macOS/Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", MVK_SAMP_CUBE, ); INFOPLIST_FILE = "$(SRCROOT)/macOS/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "@executable_path/../Frameworks", + "@executable_path/../Frameworks/MoltenVK.framework", + ); MACOSX_DEPLOYMENT_TARGET = 10.14; PRODUCT_NAME = Cube; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -500,6 +501,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = Cube.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; @@ -511,7 +513,10 @@ INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "@executable_path/Frameworks", + "@executable_path/Frameworks/MoltenVK.framework", + ); MARKETING_VERSION = 1; PRODUCT_NAME = Cube; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -526,6 +531,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = Cube.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; @@ -537,7 +543,10 @@ INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "@executable_path/Frameworks", + "@executable_path/Frameworks/MoltenVK.framework", + ); MARKETING_VERSION = 1; PRODUCT_NAME = Cube; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Docs/MoltenVK_Runtime_UserGuide.md b/Docs/MoltenVK_Runtime_UserGuide.md index 3f188a10..6124dba7 100644 --- a/Docs/MoltenVK_Runtime_UserGuide.md +++ b/Docs/MoltenVK_Runtime_UserGuide.md @@ -21,8 +21,8 @@ Table of Contents - [About **MoltenVK**](#about_moltenvk) - [Installing **MoltenVK** in Your *Vulkan* Application](#install) - [Install *MoltenVK* as a Universal `XCFramework`](#install_xcfwk) - - [Install *MoltenVK* as a Dynamic Library](#install_dylib) - - [Install *MoltenVK* replacing the Vulkan SDK `libMoltenVK.dylib`](#install_vksdk) + - [Install *MoltenVK* as a Dynamic Library on _macOS_](#install_dylib) + - [Optionally Link to Required System Libraries](#system_libs) - [Build and Runtime Requirements](#requirements) - [Interacting with the **MoltenVK** Runtime](#interaction) - [MoltenVK Header Files](#moltenvk_headers) @@ -79,11 +79,7 @@ Installing **MoltenVK** in Your *Vulkan* Application Installation of **MoltenVK** in your application is straightforward and easy! Depending on your build and deployment needs, you can link **MoltenVK** to your application either -as a universal `XCFramework` or as a *dynamic library* (`.dylib`). Distributing an app containing -a dynamic library via the *iOS App Store* or *tvOS App Store* can require specialized bundling. -If you are unsure about which linking and deployment option you need, or on *iOS* or *tvOS*, -unless you have specific needs for dynamic libraries, follow the steps for linking **MoltenVK** -as an `XCFramework`, as it is the simpler option, and encompasses the largest set of supported platforms. +as either a static or dynamic universal `XCFramework`, or on _macOS_, as a *dynamic library* (`.dylib`). @@ -96,54 +92,49 @@ also use *Xcode 14* or later to link it to your app or game. > If you need to use *Xcode 13* or earlier to link `MoltenVK.xcframework` to your app or game, first [build](../README.md#building) **MoltenVK** with *Xcode 13* or earlier. > -> Or, if you want to use *Xcode 14* or later to [build](../README.md#building) **MoltenVK**, in order to be able to use the latest -*Metal* capabilities, but need to use *Xcode 13* or earlier to link `MoltenVK.xcframework` to your -app or game, first add the value `-fno-objc-msgsend-selector-stubs` to the `OTHER_CFLAGS` -*Xcode* build setting in the `MoltenVK.xcodeproj` and `MoltenVKShaderConverter.xcodeproj` *Xcode* -projects, [build](../README.md#building) **MoltenVK** with *Xcode 14* or later, and then link `MoltenVK.xcframework` -to your app or game using *Xcode 13* or earlier. +> Or, if you want to use *Xcode 14* or later to [build](../README.md#building) **MoltenVK**, in order to be able +to use the latest *Metal* capabilities, but need to use *Xcode 13* or earlier to link `MoltenVK.xcframework` +to your app or game, first add the value `-fno-objc-msgsend-selector-stubs` to the `OTHER_CFLAGS` *Xcode* build +setting in the `MoltenVK.xcodeproj` and `MoltenVKShaderConverter.xcodeproj` *Xcode* projects, [build](../README.md#building) +**MoltenVK** with *Xcode 14* or later, and then link `MoltenVK.xcframework`to your app or game using *Xcode 13* or earlier. -To link **MoltenVK** to your application as an `XCFramework`, follow these steps: +To link **MoltenVK** to your application as either a static or dynamic `XCFramework`, follow these steps: -1. Open your application in *Xcode* and select your application's target in the - *Project Navigator* panel. +1. Open your application in *Xcode* and select your application's target in the *Project Navigator* panel. 2. Open the *Build Settings* tab. 1. In the **Header Search Paths** (aka `HEADER_SEARCH_PATHS`) setting, - add an entry that points to the `MoltenVK/include` folder. + add an entry that points to the `MoltenVK/include` folder. - 2. 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, 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. + 2. _(**Note:** This step is not required if linking to the static XCFramework)_ If linking to the _dynamic XCFramework_, + in the **Runpath Search Paths** (aka `LD_RUNPATH_SEARCH_PATHS`) setting, add entries that match where the + framework will be located in your runtime environment. If the dynamic library is to be embedded within your + application, you would typically add one or both of the following entries for a _macOS_ platform target: -3. Open the *Build Phases* tab and open the *Link Binary With Libraries* list. - - 1. Drag `MoltenVK/MoltenVK.xcframework` to the *Link Binary With Libraries* list. + ``` + @executable_path/../Frameworks + @executable_path/../Frameworks/MoltenVK.framework + ``` - 2. If your application does **_not_** use use `C++`, click the **+** button, - and add `libc++.tbd` by selecting it from the list of system frameworks. - This is needed because **MoltenVK** uses `C++` system libraries internally. - - 3. 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 the - **+** button, and add the following items by selecting them from the list of system frameworks: - - `libc++.tbd` *(if not already done in Step 2)* - - `Metal.framework` - - `Foundation.framework`. - - `QuartzCore.framework` - - `IOKit.framework` (*macOS*) - - `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`) + or for a platform target other than _macOS_ add one or both of the following entries: + ``` + @executable_path/Frameworks + @executable_path/Frameworks/MoltenVK.framework + ``` + + `MoltenVK.framework` is internally configured to be located at `@rpath/MoltenVK.framework/MoltenVK`. + +3. Open the *General* tab and drag either `Package/Latest/MoltenVK/static/MoltenVK.xcframework` or + `Package/Latest/MoltenVK/dynamic/MoltenVK.xcframework` to the *Embed Frameworks* (sometimes labeled + *Frameworks, Libraries, and Embedded Content*) list, and ensure the _Embed & Sign_ options is selected. -### Install *MoltenVK* as a Dynamic Library +### Install *MoltenVK* as a Dynamic Library on _macOS_ -To link **MoltenVK** to your application as a dynamic library (`.dylib`), follow these steps: +To link **MoltenVK** to your _macOS_ application as a dynamic library (`.dylib`), follow these steps: 1. Open your application in *Xcode* and select your application's target in the *Project Navigator* panel. @@ -154,106 +145,39 @@ To link **MoltenVK** to your application as a dynamic library (`.dylib`), follow 1. In the **Header Search Paths** (aka `HEADER_SEARCH_PATHS`) setting, add an entry that points to the `MoltenVK/include` folder. - 2. In the **Library Search Paths** (aka `LIBRARY_SEARCH_PATHS`) setting, - add an entry that points to **_one_** of the following folders: - - `MoltenVK/dylib/macOS` *(macOS)* - - `MoltenVK/dylib/iOS` *(iOS)* - - `MoltenVK/dylib/tvOS` *(tvOS)* - - 3. In the **Runpath Search Paths** (aka `LD_RUNPATH_SEARCH_PATHS`) setting, + 2. In the **Runpath Search Paths** (aka `LD_RUNPATH_SEARCH_PATHS`) setting, add an entry that matches where the dynamic library will be located in your runtime environment. If the dynamic library is to be embedded within your application, - you would typically set this to **_one_** of these values: + you would typically set this to `@executable_path/../Frameworks`. - - `@executable_path/../Frameworks` *(macOS)* - - `@executable_path/Frameworks` *(iOS or tvOS)* - - The `libMoltenVK.dylib` library is internally configured to be located at - `@rpath/libMoltenVK.dylib`. + The `libMoltenVK.dylib` library in `MoltenVK.framework` is internally configured + to be located at `@rpath/libMoltenVK.dylib`. - 3. 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, 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. +3. Open the *General* tab and drag `Package/Latest/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib` + to the *Embed Frameworks* (sometimes labeled *Frameworks, Libraries, and Embedded Content*) list, + and ensure the _Embed & Sign_ options is selected. -3. Open the *Build Phases* tab and open the *Link Binary With Libraries* list. - - 1. Drag **_one_** of the following files to the *Link Binary With Libraries* list: - - `MoltenVK/dylib/macOS/libMoltenVK.dylib` *(macOS)* - - `MoltenVK/dylib/iOS/libMoltenVK.dylib` *(iOS)* - - `MoltenVK/dylib/tvOS/libMoltenVK.dylib` *(tvOS)* - 2. If your application does **_not_** use use `C++`, click the **+** button, - and add `libc++.tbd` by selecting it from the list of system frameworks. - This is needed because **MoltenVK** uses `C++` system libraries internally. - - 3. 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 the - **+** button, and add the following items by selecting them from the list of system frameworks: - - `libc++.tbd` *(if not already done in Step 2)* - - `Metal.framework` - - `Foundation.framework`. - - `QuartzCore.framework` - - `IOKit.framework` (*macOS*) - - `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`) + +### Optionally Link to Required System Libraries -4. Arrange to install the `libMoltenVK.dylib` file in your application environment: +Open the *Build Phases* tab and open the *Link Binary With Libraries* list. - - To copy the `libMoltenVK.dylib` file into your application or component library: - - 1. On the *Build Phases* tab, add a new *Copy Files* build phase. - - 2. Set the *Destination* into which you want to place the `libMoltenVK.dylib` file. - Typically this will be *Frameworks* (and it should match the **Runpath Search Paths** - (aka `LD_RUNPATH_SEARCH_PATHS`) build setting you added above). - - 3. Drag **_one_** of the following files to the *Copy Files* list in this new build phase: - - `MoltenVK/dylib/macOS/libMoltenVK.dylib` *(macOS)* - - `MoltenVK/dylib/iOS/libMoltenVK.dylib` *(iOS)* - - `MoltenVK/dylib/tvOS/libMoltenVK.dylib` *(tvOS)* - - - Alternately, you may create your own installation mechanism to install one of the following - files into a standard *macOS*, *iOS*, or *tvOS* system library folder on the user's device: - - `MoltenVK/dylib/macOS/libMoltenVK.dylib` *(macOS)* - - `MoltenVK/dylib/iOS/libMoltenVK.dylib` *(iOS)* - - `MoltenVK/dylib/tvOS/libMoltenVK.dylib` *(tvOS)* - +1. If your application does **_not_** use use `C++`, click the **+** button, + and add `libc++.tbd` by selecting it from the list of system frameworks. + This is needed because **MoltenVK** uses `C++` system libraries internally. + +2. 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 the + **+** button, and add the following items by selecting them from the list of system frameworks: + - `Metal.framework` + - `Foundation.framework`. + - `QuartzCore.framework` + - `IOKit.framework` (*macOS*) + - `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`) - -### Install *MoltenVK* replacing the Vulkan SDK `libMoltenVK.dylib` - -There are a few potential issues when building **MoltenVK** to replace the version installed via -the *[Vulkan SDK](https://vulkan.lunarg.com/sdk/home)* standard install process, which lives in -`/usr/local/lib/libMoltenVK.dylib`. - -1. You must *remove* the existing `.dylib` file before copying the new one, because of the way -that the gatekeeper system works to prevent malicious overwriting of files in standard locations -such as `/usr/local`: - -```bash -$ sudo rm /usr/local/lib/libMoltenVK.dylib -$ sudo cp Package/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib /usr/local/lib -``` - -If you do not do the remove first, your application will terminate immediately with a -singularly unhelpful `Killed: 9` message. Alternatively, moving the existing `.dylib` to a -backup name and making a symbolic link to the Package location above is particularly useful -for repeated building and testing. - -2. Do *not* copy the `MoltenVK_icd.json` file from the newly-built package to -`/usr/local/share/vulkan/icd.d` -- it will not work and will result in errors about not being -able to initialize the instance. The one installed by Vulkan SDK uses a relative path to -specify the location of the `.dylib`, whereas the one in the package specifies it in the same -directory. - -3. The default config for command-line build has verbose logging info turned on -- if you want -it to be like the original, use this command for building: - -```bash -$ make macos MVK_CONFIG_LOG_LEVEL=1 -``` ### Build and Runtime Requirements @@ -490,7 +414,7 @@ where `HEADER_FILE` is one of the following: - `mvk_vulkan.h` - This is a convenience header file that loads the `` header file with platform settings to enable the appropriate _Vulkan_ WSI surface and portability extensions. - + - `mvk_private_api.h` - Contains private structures and functions to query **MoltenVK** about **MoltenVK** version and configuration, runtime performance information, and available _Metal_ capabilities. diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md index ac147553..2d28e054 100644 --- a/Docs/Whats_New.md +++ b/Docs/Whats_New.md @@ -18,6 +18,10 @@ MoltenVK 1.2.8 Released TBD +- Improve support for _iOS App Store_ rules by using dynamic _XCFramework_, instead of naked `dylib`. + - Static _XCFramework_ now available in `Package/Latest/MoltenVK/static/MoltenVK.xcframework`. + - Dynamic _XCFramework_ now available in `Package/Latest/MoltenVK/dynamic/MoltenVK.xcframework`. + - _macOS_ dynamic library now available in `Package/Latest/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib`. - Add `MVK_USE_METAL_PRIVATE_API` build setting to allow **MoltenVK** to be built with access to _Metal_ private API calls. - `VkPhysicalDeviceFeatures::wideLines` enabled when `MVK_USE_METAL_PRIVATE_API` is enabled in a **MoltenVK** build. - `VkPhysicalDeviceFeatures::logicOp` enabled when `MVK_USE_METAL_PRIVATE_API` is enabled in a **MoltenVK** build. @@ -26,8 +30,6 @@ Released TBD - _Metal_ native pipeline sample masks supported when `MVK_USE_METAL_PRIVATE_API` is enabled in a **MoltenVK** build. - Fix potential crash when using multi-planar images. - Ensure buffers available for buffer addresses in push constants. -- Support `libMoltenVK.dylib` for _iOS Simulator_ architecture. -- Restore support for _iOS Simulator_ destination in recent update to _Cube_ demo that uses dynamic-linking. - Don't update `currentExtent` of headless surface when swapchain attached. - `runcts` script also output a file containing a list of the failed CTS tests. diff --git a/ExternalRevisions/Volk_repo_revision b/ExternalRevisions/Volk_repo_revision index 92ff2402..13f22dcc 100644 --- a/ExternalRevisions/Volk_repo_revision +++ b/ExternalRevisions/Volk_repo_revision @@ -1 +1 @@ -f2a16e3e19c2349b873343b2dc38a1d4c25af23a +fdf78c22c3e66a3c7ff62d8dcdcb5fcad023bec7 diff --git a/Makefile b/Makefile index e7a32262..5fe34950 100644 --- a/Makefile +++ b/Makefile @@ -71,11 +71,11 @@ iossim-debug: .PHONY: maccat maccat: - $(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=macOS,variant=Mac Catalyst" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD) + $(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (MacCat only)" -destination "generic/platform=macOS,variant=Mac Catalyst" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD) .PHONY: maccat-debug maccat-debug: - $(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration "Debug" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD) + $(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (MacCat only)" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration "Debug" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD) .PHONY: tvos tvos: @@ -117,27 +117,5 @@ clean: # Usually requires 'sudo make install' .PHONY: install install: - rm -rf /Library/Frameworks/MoltenVK.framework - rm -rf /Library/Frameworks/MoltenVK.xcframework - cp -a Package/Latest/MoltenVK/MoltenVK.xcframework /Library/Frameworks/ - -# Deprecated target names -.PHONY: iosfat -iosfat: - @$(MAKE) ios - @$(MAKE) iossim - -.PHONY: iosfat-debug -iosfat-debug: - @$(MAKE) ios-debug - @$(MAKE) iossim-debug - -.PHONY: tvosfat -tvosfat: - @$(MAKE) tvos - @$(MAKE) tvossim - -.PHONY: tvosfat-debug -tvosfat-debug: - @$(MAKE) tvos-debug - @$(MAKE) tvossim-debug + $ rm -f /usr/local/lib/libMoltenVK.dylib + $ cp -p Package/Latest/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib /usr/local/lib diff --git a/MoltenVK/MoltenVK.xcframework b/MoltenVK/MoltenVK.xcframework deleted file mode 120000 index a3abb4a8..00000000 --- a/MoltenVK/MoltenVK.xcframework +++ /dev/null @@ -1 +0,0 @@ -../Package/Latest/MoltenVK/MoltenVK.xcframework \ No newline at end of file diff --git a/MoltenVK/MoltenVK.xcodeproj/project.pbxproj b/MoltenVK/MoltenVK.xcodeproj/project.pbxproj index e71435e0..93fb42f1 100644 --- a/MoltenVK/MoltenVK.xcodeproj/project.pbxproj +++ b/MoltenVK/MoltenVK.xcodeproj/project.pbxproj @@ -386,6 +386,41 @@ A9F3D9DD24732A4D00745190 /* MVKSmallVectorAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A9F3D9D924732A4C00745190 /* MVKSmallVectorAllocator.h */; }; A9F3D9DE24732A4D00745190 /* MVKSmallVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A9F3D9DB24732A4D00745190 /* MVKSmallVector.h */; }; A9F3D9DF24732A4D00745190 /* MVKSmallVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A9F3D9DB24732A4D00745190 /* MVKSmallVector.h */; }; + A9F4D9752B8E745A004AD576 /* libMoltenVK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9B8EE0A1A98D796009C5A02 /* libMoltenVK.a */; }; + A9F4D9862B8E7CDB004AD576 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9852B8E7CDB004AD576 /* Metal.framework */; }; + A9F4D9882B8E7D10004AD576 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9872B8E7D10004AD576 /* QuartzCore.framework */; }; + A9F4D98A2B8E7D18004AD576 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9892B8E7D18004AD576 /* CoreGraphics.framework */; }; + A9F4D98C2B8E7D3A004AD576 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D98B2B8E7D3A004AD576 /* Foundation.framework */; }; + A9F4D98E2B8E7D5E004AD576 /* IOSurface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D98D2B8E7D5D004AD576 /* IOSurface.framework */; }; + A9F4D9902B8E7D66004AD576 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D98F2B8E7D66004AD576 /* IOKit.framework */; }; + A9F4D9922B8E7D71004AD576 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9912B8E7D71004AD576 /* UIKit.framework */; }; + A9F4D9942B8E7E9C004AD576 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9932B8E7E8A004AD576 /* libc++.tbd */; }; + A9F4D9A42B8EB2FC004AD576 /* IOSurface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D98D2B8E7D5D004AD576 /* IOSurface.framework */; }; + A9F4D9A52B8EB2FC004AD576 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9912B8E7D71004AD576 /* UIKit.framework */; }; + A9F4D9A62B8EB2FC004AD576 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D98B2B8E7D3A004AD576 /* Foundation.framework */; }; + A9F4D9A72B8EB2FC004AD576 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9892B8E7D18004AD576 /* CoreGraphics.framework */; }; + A9F4D9A82B8EB2FC004AD576 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9852B8E7CDB004AD576 /* Metal.framework */; }; + A9F4D9A92B8EB2FC004AD576 /* libMoltenVK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9B8EE0A1A98D796009C5A02 /* libMoltenVK.a */; }; + A9F4D9AA2B8EB2FC004AD576 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9932B8E7E8A004AD576 /* libc++.tbd */; }; + A9F4D9AC2B8EB2FC004AD576 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9872B8E7D10004AD576 /* QuartzCore.framework */; }; + A9F4D9C02B8EB6DC004AD576 /* IOSurface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D98D2B8E7D5D004AD576 /* IOSurface.framework */; }; + A9F4D9C12B8EB6DC004AD576 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9912B8E7D71004AD576 /* UIKit.framework */; }; + A9F4D9C22B8EB6DC004AD576 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D98B2B8E7D3A004AD576 /* Foundation.framework */; }; + A9F4D9C32B8EB6DC004AD576 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9892B8E7D18004AD576 /* CoreGraphics.framework */; }; + A9F4D9C42B8EB6DC004AD576 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9852B8E7CDB004AD576 /* Metal.framework */; }; + A9F4D9C52B8EB6DC004AD576 /* libMoltenVK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9B8EE0A1A98D796009C5A02 /* libMoltenVK.a */; }; + A9F4D9C62B8EB6DC004AD576 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9932B8E7E8A004AD576 /* libc++.tbd */; }; + A9F4D9C72B8EB6DC004AD576 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D98F2B8E7D66004AD576 /* IOKit.framework */; }; + A9F4D9C82B8EB6DC004AD576 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9872B8E7D10004AD576 /* QuartzCore.framework */; }; + A9F4D9DF2B8EC112004AD576 /* IOSurface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D98D2B8E7D5D004AD576 /* IOSurface.framework */; }; + A9F4D9E12B8EC112004AD576 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D98B2B8E7D3A004AD576 /* Foundation.framework */; }; + A9F4D9E22B8EC112004AD576 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9892B8E7D18004AD576 /* CoreGraphics.framework */; }; + A9F4D9E32B8EC112004AD576 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9852B8E7CDB004AD576 /* Metal.framework */; }; + A9F4D9E42B8EC112004AD576 /* libMoltenVK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9B8EE0A1A98D796009C5A02 /* libMoltenVK.a */; }; + A9F4D9E52B8EC112004AD576 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9932B8E7E8A004AD576 /* libc++.tbd */; }; + A9F4D9E62B8EC112004AD576 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D98F2B8E7D66004AD576 /* IOKit.framework */; }; + A9F4D9E72B8EC112004AD576 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9872B8E7D10004AD576 /* QuartzCore.framework */; }; + A9F4D9FD2B8ECB67004AD576 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F4D9FB2B8ECACF004AD576 /* AppKit.framework */; }; DCFD7EE42A45BC6E007BBBF7 /* MVKExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = A909F65A213B190600FCD6BE /* MVKExtensions.h */; }; DCFD7EE52A45BC6E007BBBF7 /* vk_mvk_moltenvk.h in Headers */ = {isa = PBXBuildFile; fileRef = A94FB7691C7DFB4800632CA3 /* vk_mvk_moltenvk.h */; }; DCFD7EE62A45BC6E007BBBF7 /* MVKDeviceFeatureStructs.def in Headers */ = {isa = PBXBuildFile; fileRef = A987B666289AFB2400F933C8 /* MVKDeviceFeatureStructs.def */; }; @@ -523,6 +558,13 @@ remoteGlobalIDString = 2FEA0D142490381A00EEF3AD; remoteInfo = "MoltenVKSPIRVToMSLConverter-tvOS"; }; + A979A9172B924B9700F69E67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A9C86CB61C55B8350096CAF2 /* MoltenVKShaderConverter.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A979A9152B9174EA00F69E67; + remoteInfo = "MoltenVKShaderConverter-xrOS"; + }; A981497B1FB6B566005F00B4 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A9C86CB61C55B8350096CAF2 /* MoltenVKShaderConverter.xcodeproj */; @@ -558,6 +600,34 @@ remoteGlobalIDString = A9092A8C1A81717B00051823; remoteInfo = MoltenVKShaderConverter; }; + A9F4D9722B8E737E004AD576 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A9F55D25198BE6A7004EC31B /* Project object */; + proxyType = 1; + remoteGlobalIDString = A9B8EE091A98D796009C5A02; + remoteInfo = "MoltenVK-iOS"; + }; + A9F4D9B32B8EB515004AD576 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A9F55D25198BE6A7004EC31B /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2FEA0A3B24902F9F00EEF3AD; + remoteInfo = "MoltenVK-tvOS-static"; + }; + A9F4D9CF2B8EB755004AD576 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A9F55D25198BE6A7004EC31B /* Project object */; + proxyType = 1; + remoteGlobalIDString = DCFD7EDF2A45BC6E007BBBF7; + remoteInfo = "MoltenVK-xrOS-static"; + }; + A9F4D9EE2B8EC131004AD576 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A9F55D25198BE6A7004EC31B /* Project object */; + proxyType = 1; + remoteGlobalIDString = A9CBED861B6299D800E45FDC; + remoteInfo = "MoltenVK-macOS-static"; + }; DCA2CEAE2A45DFD400FB75B6 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A9C86CB61C55B8350096CAF2 /* MoltenVKShaderConverter.xcodeproj */; @@ -565,13 +635,6 @@ remoteGlobalIDString = DCFD7F6F2A45BDA0007BBBF7; remoteInfo = "MoltenVKShaderConverter-xrOS"; }; - DCBC41212A45DB1000F49BD1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A9C86CB61C55B8350096CAF2 /* MoltenVKShaderConverter.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = DCFD7F882A45BDA0007BBBF7; - remoteInfo = MoltenVKShaderConverter; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -711,9 +774,88 @@ A9F0429E1FB4CF82009FCCB8 /* MVKLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKLogging.h; sourceTree = ""; }; A9F3D9D924732A4C00745190 /* MVKSmallVectorAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKSmallVectorAllocator.h; sourceTree = ""; }; A9F3D9DB24732A4D00745190 /* MVKSmallVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKSmallVector.h; sourceTree = ""; }; + A9F4D96B2B8E7366004AD576 /* MoltenVK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MoltenVK.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A9F4D9852B8E7CDB004AD576 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; }; + A9F4D9872B8E7D10004AD576 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + A9F4D9892B8E7D18004AD576 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + A9F4D98B2B8E7D3A004AD576 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + A9F4D98D2B8E7D5D004AD576 /* IOSurface.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOSurface.framework; path = System/Library/Frameworks/IOSurface.framework; sourceTree = SDKROOT; }; + A9F4D98F2B8E7D66004AD576 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; + A9F4D9912B8E7D71004AD576 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/iOSSupport/System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + A9F4D9932B8E7E8A004AD576 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; + A9F4D9B22B8EB2FC004AD576 /* MoltenVK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MoltenVK.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A9F4D9CE2B8EB6DC004AD576 /* MoltenVK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MoltenVK.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A9F4D9ED2B8EC112004AD576 /* MoltenVK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MoltenVK.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A9F4D9FB2B8ECACF004AD576 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; DCFD7F622A45BC6E007BBBF7 /* libMoltenVK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMoltenVK.a; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ +/* Begin PBXFrameworksBuildPhase section */ + A9F4D9682B8E7366004AD576 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A9F4D98E2B8E7D5E004AD576 /* IOSurface.framework in Frameworks */, + A9F4D9922B8E7D71004AD576 /* UIKit.framework in Frameworks */, + A9F4D98C2B8E7D3A004AD576 /* Foundation.framework in Frameworks */, + A9F4D98A2B8E7D18004AD576 /* CoreGraphics.framework in Frameworks */, + A9F4D9862B8E7CDB004AD576 /* Metal.framework in Frameworks */, + A9F4D9752B8E745A004AD576 /* libMoltenVK.a in Frameworks */, + A9F4D9942B8E7E9C004AD576 /* libc++.tbd in Frameworks */, + A9F4D9902B8E7D66004AD576 /* IOKit.framework in Frameworks */, + A9F4D9882B8E7D10004AD576 /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F4D9A32B8EB2FC004AD576 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A9F4D9A42B8EB2FC004AD576 /* IOSurface.framework in Frameworks */, + A9F4D9A52B8EB2FC004AD576 /* UIKit.framework in Frameworks */, + A9F4D9A62B8EB2FC004AD576 /* Foundation.framework in Frameworks */, + A9F4D9A72B8EB2FC004AD576 /* CoreGraphics.framework in Frameworks */, + A9F4D9A82B8EB2FC004AD576 /* Metal.framework in Frameworks */, + A9F4D9A92B8EB2FC004AD576 /* libMoltenVK.a in Frameworks */, + A9F4D9AA2B8EB2FC004AD576 /* libc++.tbd in Frameworks */, + A9F4D9AC2B8EB2FC004AD576 /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F4D9BF2B8EB6DC004AD576 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A9F4D9C02B8EB6DC004AD576 /* IOSurface.framework in Frameworks */, + A9F4D9C12B8EB6DC004AD576 /* UIKit.framework in Frameworks */, + A9F4D9C22B8EB6DC004AD576 /* Foundation.framework in Frameworks */, + A9F4D9C32B8EB6DC004AD576 /* CoreGraphics.framework in Frameworks */, + A9F4D9C42B8EB6DC004AD576 /* Metal.framework in Frameworks */, + A9F4D9C52B8EB6DC004AD576 /* libMoltenVK.a in Frameworks */, + A9F4D9C62B8EB6DC004AD576 /* libc++.tbd in Frameworks */, + A9F4D9C72B8EB6DC004AD576 /* IOKit.framework in Frameworks */, + A9F4D9C82B8EB6DC004AD576 /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F4D9DE2B8EC112004AD576 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A9F4D9DF2B8EC112004AD576 /* IOSurface.framework in Frameworks */, + A9F4D9E12B8EC112004AD576 /* Foundation.framework in Frameworks */, + A9F4D9E22B8EC112004AD576 /* CoreGraphics.framework in Frameworks */, + A9F4D9E32B8EC112004AD576 /* Metal.framework in Frameworks */, + A9F4D9E42B8EC112004AD576 /* libMoltenVK.a in Frameworks */, + A9F4D9E52B8EC112004AD576 /* libc++.tbd in Frameworks */, + A9F4D9FD2B8ECB67004AD576 /* AppKit.framework in Frameworks */, + A9F4D9E62B8EC112004AD576 /* IOKit.framework in Frameworks */, + A9F4D9E72B8EC112004AD576 /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + /* Begin PBXGroup section */ A94FB7641C7DFB4800632CA3 /* MoltenVK */ = { isa = PBXGroup; @@ -884,7 +1026,7 @@ A98149821FB6B566005F00B4 /* libMoltenVKShaderConverter.a */, 2FEA0D1C249040CA00EEF3AD /* libMoltenVKShaderConverter.a */, A98149841FB6B566005F00B4 /* libMoltenVKShaderConverter.a */, - DCBC41222A45DB1000F49BD1 /* libMoltenVKShaderConverter.a */, + A979A9182B924B9700F69E67 /* libMoltenVKShaderConverter.a */, ); name = Products; sourceTree = ""; @@ -936,6 +1078,22 @@ path = ../Common; sourceTree = ""; }; + A9F4D9742B8E745A004AD576 /* Frameworks */ = { + isa = PBXGroup; + children = ( + A9F4D9FB2B8ECACF004AD576 /* AppKit.framework */, + A9F4D9932B8E7E8A004AD576 /* libc++.tbd */, + A9F4D9912B8E7D71004AD576 /* UIKit.framework */, + A9F4D98F2B8E7D66004AD576 /* IOKit.framework */, + A9F4D98D2B8E7D5D004AD576 /* IOSurface.framework */, + A9F4D98B2B8E7D3A004AD576 /* Foundation.framework */, + A9F4D9892B8E7D18004AD576 /* CoreGraphics.framework */, + A9F4D9872B8E7D10004AD576 /* QuartzCore.framework */, + A9F4D9852B8E7CDB004AD576 /* Metal.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; A9F55D24198BE6A7004EC31B = { isa = PBXGroup; children = ( @@ -945,6 +1103,7 @@ A9DE1083200598C500F18F80 /* icd */, A9C86CB61C55B8350096CAF2 /* MoltenVKShaderConverter.xcodeproj */, A9F55D2E198BE6A7004EC31B /* Products */, + A9F4D9742B8E745A004AD576 /* Frameworks */, ); sourceTree = ""; }; @@ -955,6 +1114,10 @@ A9CBEE011B6299D800E45FDC /* libMoltenVK.a */, 2FEA0ABA24902F9F00EEF3AD /* libMoltenVK.a */, DCFD7F622A45BC6E007BBBF7 /* libMoltenVK.a */, + A9F4D96B2B8E7366004AD576 /* MoltenVK.framework */, + A9F4D9B22B8EB2FC004AD576 /* MoltenVK.framework */, + A9F4D9CE2B8EB6DC004AD576 /* MoltenVK.framework */, + A9F4D9ED2B8EC112004AD576 /* MoltenVK.framework */, ); name = Products; sourceTree = ""; @@ -1200,6 +1363,34 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A9F4D9662B8E7366004AD576 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F4D9A12B8EB2FC004AD576 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F4D9BD2B8EB6DC004AD576 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F4D9DC2B8EC112004AD576 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; DCFD7EE32A45BC6E007BBBF7 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -1279,82 +1470,158 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 2FEA0A3B24902F9F00EEF3AD /* MoltenVK-tvOS */ = { + 2FEA0A3B24902F9F00EEF3AD /* MoltenVK-tvOS-static */ = { isa = PBXNativeTarget; - buildConfigurationList = 2FEA0AB724902F9F00EEF3AD /* Build configuration list for PBXNativeTarget "MoltenVK-tvOS" */; + buildConfigurationList = 2FEA0AB724902F9F00EEF3AD /* Build configuration list for PBXNativeTarget "MoltenVK-tvOS-static" */; buildPhases = ( A980A25D24C6288D007A8F6F /* Generate Version Header */, 2FEA0A4024902F9F00EEF3AD /* Headers */, 2FEA0A8224902F9F00EEF3AD /* Sources */, A9CBBFF124F89F79006D41EF /* Copy to Staging */, - 2FEA0AB524902F9F00EEF3AD /* Create Dynamic Library */, ); buildRules = ( ); dependencies = ( 2F21D82F24983488009BEA5F /* PBXTargetDependency */, ); - name = "MoltenVK-tvOS"; + name = "MoltenVK-tvOS-static"; productName = MoltenVK; productReference = 2FEA0ABA24902F9F00EEF3AD /* libMoltenVK.a */; productType = "com.apple.product-type.library.static"; }; - A9B8EE091A98D796009C5A02 /* MoltenVK-iOS */ = { + A9B8EE091A98D796009C5A02 /* MoltenVK-iOS-static */ = { isa = PBXNativeTarget; - buildConfigurationList = A9B8EE1D1A98D796009C5A02 /* Build configuration list for PBXNativeTarget "MoltenVK-iOS" */; + buildConfigurationList = A9B8EE1D1A98D796009C5A02 /* Build configuration list for PBXNativeTarget "MoltenVK-iOS-static" */; buildPhases = ( A980A25B24C6283D007A8F6F /* Generate Version Header */, A9B8EE071A98D796009C5A02 /* Headers */, A9B8EE051A98D796009C5A02 /* Sources */, A9CBBFEF24F89F5F006D41EF /* Copy to Staging */, - A9731FAD1EDDAE39006B7298 /* Create Dynamic Library */, ); buildRules = ( ); dependencies = ( A981499B1FB6B9CF005F00B4 /* PBXTargetDependency */, ); - name = "MoltenVK-iOS"; + name = "MoltenVK-iOS-static"; productName = MoltenVK; productReference = A9B8EE0A1A98D796009C5A02 /* libMoltenVK.a */; productType = "com.apple.product-type.library.static"; }; - A9CBED861B6299D800E45FDC /* MoltenVK-macOS */ = { + A9CBED861B6299D800E45FDC /* MoltenVK-macOS-static */ = { isa = PBXNativeTarget; - buildConfigurationList = A9CBEDFE1B6299D800E45FDC /* Build configuration list for PBXNativeTarget "MoltenVK-macOS" */; + buildConfigurationList = A9CBEDFE1B6299D800E45FDC /* Build configuration list for PBXNativeTarget "MoltenVK-macOS-static" */; buildPhases = ( A980A25E24C62895007A8F6F /* Generate Version Header */, A9CBED871B6299D800E45FDC /* Headers */, A9CBEDCE1B6299D800E45FDC /* Sources */, A9CBBFF224F89F87006D41EF /* Copy to Staging */, - A93F47C91D7E389E002AF700 /* Create Dynamic Library */, ); buildRules = ( ); dependencies = ( A9B1C7F5251AA5AF001D12CC /* PBXTargetDependency */, ); - name = "MoltenVK-macOS"; + name = "MoltenVK-macOS-static"; productName = MoltenVK; productReference = A9CBEE011B6299D800E45FDC /* libMoltenVK.a */; productType = "com.apple.product-type.library.static"; }; - DCFD7EDF2A45BC6E007BBBF7 /* MoltenVK-xrOS */ = { + A9F4D96A2B8E7366004AD576 /* MoltenVK-iOS-dynamic */ = { isa = PBXNativeTarget; - buildConfigurationList = DCFD7F5F2A45BC6E007BBBF7 /* Build configuration list for PBXNativeTarget "MoltenVK-xrOS" */; + buildConfigurationList = A9F4D96F2B8E7366004AD576 /* Build configuration list for PBXNativeTarget "MoltenVK-iOS-dynamic" */; + buildPhases = ( + A9F4D9662B8E7366004AD576 /* Headers */, + A9F4D9672B8E7366004AD576 /* Sources */, + A9F4D9682B8E7366004AD576 /* Frameworks */, + A9F4D9692B8E7366004AD576 /* Resources */, + A9F4D9782B8E74B1004AD576 /* Copy to Staging */, + ); + buildRules = ( + ); + dependencies = ( + A9F4D9732B8E737E004AD576 /* PBXTargetDependency */, + ); + name = "MoltenVK-iOS-dynamic"; + productName = "MoltenVK-iOS-dynamic"; + productReference = A9F4D96B2B8E7366004AD576 /* MoltenVK.framework */; + productType = "com.apple.product-type.framework"; + }; + A9F4D99E2B8EB2FC004AD576 /* MoltenVK-tvOS-dynamic */ = { + isa = PBXNativeTarget; + buildConfigurationList = A9F4D9AF2B8EB2FC004AD576 /* Build configuration list for PBXNativeTarget "MoltenVK-tvOS-dynamic" */; + buildPhases = ( + A9F4D9A12B8EB2FC004AD576 /* Headers */, + A9F4D9A22B8EB2FC004AD576 /* Sources */, + A9F4D9A32B8EB2FC004AD576 /* Frameworks */, + A9F4D9AD2B8EB2FC004AD576 /* Resources */, + A9F4D9AE2B8EB2FC004AD576 /* Copy to Staging */, + ); + buildRules = ( + ); + dependencies = ( + A9F4D9B42B8EB515004AD576 /* PBXTargetDependency */, + ); + name = "MoltenVK-tvOS-dynamic"; + productName = "MoltenVK-iOS-dynamic"; + productReference = A9F4D9B22B8EB2FC004AD576 /* MoltenVK.framework */; + productType = "com.apple.product-type.framework"; + }; + A9F4D9BA2B8EB6DC004AD576 /* MoltenVK-xrOS-dynamic */ = { + isa = PBXNativeTarget; + buildConfigurationList = A9F4D9CB2B8EB6DC004AD576 /* Build configuration list for PBXNativeTarget "MoltenVK-xrOS-dynamic" */; + buildPhases = ( + A9F4D9BD2B8EB6DC004AD576 /* Headers */, + A9F4D9BE2B8EB6DC004AD576 /* Sources */, + A9F4D9BF2B8EB6DC004AD576 /* Frameworks */, + A9F4D9C92B8EB6DC004AD576 /* Resources */, + A9F4D9CA2B8EB6DC004AD576 /* Copy to Staging */, + ); + buildRules = ( + ); + dependencies = ( + A9F4D9D02B8EB755004AD576 /* PBXTargetDependency */, + ); + name = "MoltenVK-xrOS-dynamic"; + productName = "MoltenVK-iOS-dynamic"; + productReference = A9F4D9CE2B8EB6DC004AD576 /* MoltenVK.framework */; + productType = "com.apple.product-type.framework"; + }; + A9F4D9D92B8EC112004AD576 /* MoltenVK-macOS-dynamic */ = { + isa = PBXNativeTarget; + buildConfigurationList = A9F4D9EA2B8EC112004AD576 /* Build configuration list for PBXNativeTarget "MoltenVK-macOS-dynamic" */; + buildPhases = ( + A9F4D9DC2B8EC112004AD576 /* Headers */, + A9F4D9DD2B8EC112004AD576 /* Sources */, + A9F4D9DE2B8EC112004AD576 /* Frameworks */, + A9F4D9E82B8EC112004AD576 /* Resources */, + A9F4D9E92B8EC112004AD576 /* Copy to Staging */, + ); + buildRules = ( + ); + dependencies = ( + A9F4D9EF2B8EC131004AD576 /* PBXTargetDependency */, + ); + name = "MoltenVK-macOS-dynamic"; + productName = "MoltenVK-iOS-dynamic"; + productReference = A9F4D9ED2B8EC112004AD576 /* MoltenVK.framework */; + productType = "com.apple.product-type.framework"; + }; + DCFD7EDF2A45BC6E007BBBF7 /* MoltenVK-xrOS-static */ = { + isa = PBXNativeTarget; + buildConfigurationList = DCFD7F5F2A45BC6E007BBBF7 /* Build configuration list for PBXNativeTarget "MoltenVK-xrOS-static" */; buildPhases = ( DCFD7EE22A45BC6E007BBBF7 /* Generate Version Header */, DCFD7EE32A45BC6E007BBBF7 /* Headers */, DCFD7F272A45BC6E007BBBF7 /* Sources */, DCFD7F5D2A45BC6E007BBBF7 /* Copy to Staging */, - DCFD7F5E2A45BC6E007BBBF7 /* Create Dynamic Library */, ); buildRules = ( ); dependencies = ( DCA2CEAF2A45DFD400FB75B6 /* PBXTargetDependency */, ); - name = "MoltenVK-xrOS"; + name = "MoltenVK-xrOS-static"; productName = MoltenVK; productReference = DCFD7F622A45BC6E007BBBF7 /* libMoltenVK.a */; productType = "com.apple.product-type.library.static"; @@ -1375,6 +1642,9 @@ A9CBED861B6299D800E45FDC = { DevelopmentTeam = VU3TCKU48B; }; + A9F4D96A2B8E7366004AD576 = { + CreatedOnToolsVersion = 15.2; + }; }; }; buildConfigurationList = A9F55D28198BE6A7004EC31B /* Build configuration list for PBXProject "MoltenVK" */; @@ -1396,10 +1666,14 @@ ); projectRoot = ""; targets = ( - A9B8EE091A98D796009C5A02 /* MoltenVK-iOS */, - 2FEA0A3B24902F9F00EEF3AD /* MoltenVK-tvOS */, - A9CBED861B6299D800E45FDC /* MoltenVK-macOS */, - DCFD7EDF2A45BC6E007BBBF7 /* MoltenVK-xrOS */, + A9CBED861B6299D800E45FDC /* MoltenVK-macOS-static */, + A9F4D9D92B8EC112004AD576 /* MoltenVK-macOS-dynamic */, + A9B8EE091A98D796009C5A02 /* MoltenVK-iOS-static */, + A9F4D96A2B8E7366004AD576 /* MoltenVK-iOS-dynamic */, + 2FEA0A3B24902F9F00EEF3AD /* MoltenVK-tvOS-static */, + A9F4D99E2B8EB2FC004AD576 /* MoltenVK-tvOS-dynamic */, + DCFD7EDF2A45BC6E007BBBF7 /* MoltenVK-xrOS-static */, + A9F4D9BA2B8EB6DC004AD576 /* MoltenVK-xrOS-dynamic */, ); }; /* End PBXProject section */ @@ -1412,6 +1686,14 @@ remoteRef = 2FEA0D1B249040CA00EEF3AD /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + A979A9182B924B9700F69E67 /* libMoltenVKShaderConverter.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + name = libMoltenVKShaderConverter.a; + path = "/Users/bill/Documents/Dev/iOSProjects/Molten/MoltenVK-bh/MoltenVKShaderConverter/build/Debug-xros/libMoltenVKShaderConverter.a"; + remoteRef = A979A9172B924B9700F69E67 /* PBXContainerItemProxy */; + sourceTree = ""; + }; A981497C1FB6B566005F00B4 /* MoltenVKShaderConverter */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.executable"; @@ -1433,66 +1715,40 @@ remoteRef = A98149831FB6B566005F00B4 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - DCBC41222A45DB1000F49BD1 /* libMoltenVKShaderConverter.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libMoltenVKShaderConverter.a; - remoteRef = DCBC41212A45DB1000F49BD1 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; /* End PBXReferenceProxy section */ +/* Begin PBXResourcesBuildPhase section */ + A9F4D9692B8E7366004AD576 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F4D9AD2B8EB2FC004AD576 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F4D9C92B8EB6DC004AD576 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F4D9E82B8EC112004AD576 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + /* Begin PBXShellScriptBuildPhase section */ - 2FEA0AB524902F9F00EEF3AD /* Create Dynamic Library */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${BUILT_PRODUCTS_DIR}/lib${PRODUCT_NAME}.a", - ); - name = "Create Dynamic Library"; - outputPaths = ( - "${BUILT_PRODUCTS_DIR}/dynamic/lib${PRODUCT_NAME}.dylib", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/create_dylib_tvos.sh\"\n"; - }; - A93F47C91D7E389E002AF700 /* Create Dynamic Library */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${BUILT_PRODUCTS_DIR}/lib${PRODUCT_NAME}.a", - ); - name = "Create Dynamic Library"; - outputPaths = ( - "${BUILT_PRODUCTS_DIR}/dynamic/lib${PRODUCT_NAME}.dylib", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/create_dylib_macos.sh\"\n"; - }; - A9731FAD1EDDAE39006B7298 /* Create Dynamic Library */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${BUILT_PRODUCTS_DIR}/lib${PRODUCT_NAME}.a", - ); - name = "Create Dynamic Library"; - outputPaths = ( - "${BUILT_PRODUCTS_DIR}/dynamic/lib${PRODUCT_NAME}.dylib", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/create_dylib_ios.sh\"\n"; - }; A980A25B24C6283D007A8F6F /* Generate Version Header */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -1564,11 +1820,11 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CopyPhaseDummyOutputFile", + "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CopyToStagingDummyOutputFile", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\" \"lib${PRODUCT_NAME}.a\"\n\n"; }; A9CBBFF124F89F79006D41EF /* Copy to Staging */ = { isa = PBXShellScriptBuildPhase; @@ -1584,11 +1840,11 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CopyPhaseDummyOutputFile", + "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CopyToStagingDummyOutputFile", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\" \"lib${PRODUCT_NAME}.a\"\n"; }; A9CBBFF224F89F87006D41EF /* Copy to Staging */ = { isa = PBXShellScriptBuildPhase; @@ -1604,11 +1860,91 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CopyPhaseDummyOutputFile", + "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CopyToStagingDummyOutputFile", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\" \"lib${PRODUCT_NAME}.a\"\n\n"; + }; + A9F4D9782B8E74B1004AD576 /* Copy to Staging */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework", + ); + name = "Copy to Staging"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CopyToStagingDummyOutputFile", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\" \"${PRODUCT_NAME}.framework\"\n"; + }; + A9F4D9AE2B8EB2FC004AD576 /* Copy to Staging */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework", + ); + name = "Copy to Staging"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CopyToStagingDummyOutputFile", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\" \"${PRODUCT_NAME}.framework\"\n"; + }; + A9F4D9CA2B8EB6DC004AD576 /* Copy to Staging */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework", + ); + name = "Copy to Staging"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CopyToStagingDummyOutputFile", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\" \"${PRODUCT_NAME}.framework\"\n"; + }; + A9F4D9E92B8EC112004AD576 /* Copy to Staging */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework", + ); + name = "Copy to Staging"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CopyToStagingDummyOutputFile", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\" \"${PRODUCT_NAME}.framework\"\n"; }; DCFD7EE22A45BC6E007BBBF7 /* Generate Version Header */ = { isa = PBXShellScriptBuildPhase; @@ -1643,29 +1979,11 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CopyPhaseDummyOutputFile", + "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CopyToStagingDummyOutputFile", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; - }; - DCFD7F5E2A45BC6E007BBBF7 /* Create Dynamic Library */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${BUILT_PRODUCTS_DIR}/lib${PRODUCT_NAME}.a", - ); - name = "Create Dynamic Library"; - outputPaths = ( - "${BUILT_PRODUCTS_DIR}/dynamic/lib${PRODUCT_NAME}.dylib", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/create_dylib_xros.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\" \"lib${PRODUCT_NAME}.a\"\n\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -1851,6 +2169,34 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A9F4D9672B8E7366004AD576 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F4D9A22B8EB2FC004AD576 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F4D9BE2B8EB6DC004AD576 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F4D9DD2B8EC112004AD576 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; DCFD7F272A45BC6E007BBBF7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1929,6 +2275,26 @@ name = MoltenVKShaderConverter; targetProxy = A9B1C7F4251AA5AF001D12CC /* PBXContainerItemProxy */; }; + A9F4D9732B8E737E004AD576 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A9B8EE091A98D796009C5A02 /* MoltenVK-iOS-static */; + targetProxy = A9F4D9722B8E737E004AD576 /* PBXContainerItemProxy */; + }; + A9F4D9B42B8EB515004AD576 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2FEA0A3B24902F9F00EEF3AD /* MoltenVK-tvOS-static */; + targetProxy = A9F4D9B32B8EB515004AD576 /* PBXContainerItemProxy */; + }; + A9F4D9D02B8EB755004AD576 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = DCFD7EDF2A45BC6E007BBBF7 /* MoltenVK-xrOS-static */; + targetProxy = A9F4D9CF2B8EB755004AD576 /* PBXContainerItemProxy */; + }; + A9F4D9EF2B8EC131004AD576 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A9CBED861B6299D800E45FDC /* MoltenVK-macOS-static */; + targetProxy = A9F4D9EE2B8EC131004AD576 /* PBXContainerItemProxy */; + }; DCA2CEAF2A45DFD400FB75B6 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "MoltenVKShaderConverter-xrOS"; @@ -1979,6 +2345,102 @@ }; name = Release; }; + A9F4D9702B8E7366004AD576 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GENERATE_INFOPLIST_FILE = YES; + OTHER_LDFLAGS = ( + "-all_load", + "-w", + ); + SDKROOT = iphoneos; + }; + name = Debug; + }; + A9F4D9712B8E7366004AD576 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GENERATE_INFOPLIST_FILE = YES; + OTHER_LDFLAGS = ( + "-all_load", + "-w", + ); + SDKROOT = iphoneos; + }; + name = Release; + }; + A9F4D9B02B8EB2FC004AD576 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GENERATE_INFOPLIST_FILE = YES; + OTHER_LDFLAGS = ( + "-all_load", + "-w", + ); + SDKROOT = appletvos; + }; + name = Debug; + }; + A9F4D9B12B8EB2FC004AD576 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GENERATE_INFOPLIST_FILE = YES; + OTHER_LDFLAGS = ( + "-all_load", + "-w", + ); + SDKROOT = appletvos; + }; + name = Release; + }; + A9F4D9CC2B8EB6DC004AD576 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GENERATE_INFOPLIST_FILE = YES; + OTHER_LDFLAGS = ( + "-all_load", + "-w", + ); + SDKROOT = xros; + }; + name = Debug; + }; + A9F4D9CD2B8EB6DC004AD576 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GENERATE_INFOPLIST_FILE = YES; + OTHER_LDFLAGS = ( + "-all_load", + "-w", + ); + SDKROOT = xros; + }; + name = Release; + }; + A9F4D9EB2B8EC112004AD576 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GENERATE_INFOPLIST_FILE = YES; + OTHER_LDFLAGS = ( + "-all_load", + "-w", + ); + SDKROOT = macosx; + }; + name = Debug; + }; + A9F4D9EC2B8EC112004AD576 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GENERATE_INFOPLIST_FILE = YES; + OTHER_LDFLAGS = ( + "-all_load", + "-w", + ); + SDKROOT = macosx; + }; + name = Release; + }; A9F55D3F198BE6A8004EC31B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2004,14 +2466,18 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - DEVELOPMENT_TEAM = ""; + CURRENT_PROJECT_VERSION = 1.2.8; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_DYNAMIC_NO_PIC = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "SPIRV_CROSS_NAMESPACE_OVERRIDE=MVK_spirv_cross", + "MVK_FRAMEWORK_VERSION=${CURRENT_PROJECT_VERSION}", ); GCC_SYMBOLS_PRIVATE_EXTERN = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -2034,12 +2500,14 @@ "\"${BUILT_PRODUCTS_DIR}\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MACH_O_TYPE = staticlib; + LD_DYLIB_INSTALL_NAME = "@rpath/${PRODUCT_NAME}.framework/${PRODUCT_NAME}"; MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = "${CURRENT_PROJECT_VERSION}"; MTL_ENABLE_DEBUG_INFO = YES; MVK_SKIP_DYLIB = ""; "MVK_SKIP_DYLIB[sdk=appletvsimulator*]" = YES; PRELINK_LIBS = "${CONFIGURATION_BUILD_DIR}/libMoltenVKShaderConverter.a"; + PRODUCT_BUNDLE_IDENTIFIER = com.moltenvk.framework; PRODUCT_NAME = MoltenVK; SKIP_INSTALL = YES; TVOS_DEPLOYMENT_TARGET = 12.0; @@ -2072,9 +2540,12 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; - DEVELOPMENT_TEAM = ""; + CURRENT_PROJECT_VERSION = 1.2.8; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_DYNAMIC_NO_PIC = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; GCC_NO_COMMON_BLOCKS = YES; @@ -2082,6 +2553,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "NDEBUG=1", "SPIRV_CROSS_NAMESPACE_OVERRIDE=MVK_spirv_cross", + "MVK_FRAMEWORK_VERSION=${CURRENT_PROJECT_VERSION}", ); GCC_SYMBOLS_PRIVATE_EXTERN = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -2104,12 +2576,14 @@ "\"${BUILT_PRODUCTS_DIR}\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MACH_O_TYPE = staticlib; + LD_DYLIB_INSTALL_NAME = "@rpath/${PRODUCT_NAME}.framework/${PRODUCT_NAME}"; MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = "${CURRENT_PROJECT_VERSION}"; MTL_ENABLE_DEBUG_INFO = NO; MVK_SKIP_DYLIB = ""; "MVK_SKIP_DYLIB[sdk=appletvsimulator*]" = YES; PRELINK_LIBS = "${CONFIGURATION_BUILD_DIR}/libMoltenVKShaderConverter.a"; + PRODUCT_BUNDLE_IDENTIFIER = com.moltenvk.framework; PRODUCT_NAME = MoltenVK; SKIP_INSTALL = YES; TVOS_DEPLOYMENT_TARGET = 12.0; @@ -2135,7 +2609,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 2FEA0AB724902F9F00EEF3AD /* Build configuration list for PBXNativeTarget "MoltenVK-tvOS" */ = { + 2FEA0AB724902F9F00EEF3AD /* Build configuration list for PBXNativeTarget "MoltenVK-tvOS-static" */ = { isa = XCConfigurationList; buildConfigurations = ( 2FEA0AB824902F9F00EEF3AD /* Debug */, @@ -2144,7 +2618,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - A9B8EE1D1A98D796009C5A02 /* Build configuration list for PBXNativeTarget "MoltenVK-iOS" */ = { + A9B8EE1D1A98D796009C5A02 /* Build configuration list for PBXNativeTarget "MoltenVK-iOS-static" */ = { isa = XCConfigurationList; buildConfigurations = ( A9B8EE1E1A98D796009C5A02 /* Debug */, @@ -2153,7 +2627,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - A9CBEDFE1B6299D800E45FDC /* Build configuration list for PBXNativeTarget "MoltenVK-macOS" */ = { + A9CBEDFE1B6299D800E45FDC /* Build configuration list for PBXNativeTarget "MoltenVK-macOS-static" */ = { isa = XCConfigurationList; buildConfigurations = ( A9CBEDFF1B6299D800E45FDC /* Debug */, @@ -2162,6 +2636,42 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + A9F4D96F2B8E7366004AD576 /* Build configuration list for PBXNativeTarget "MoltenVK-iOS-dynamic" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A9F4D9702B8E7366004AD576 /* Debug */, + A9F4D9712B8E7366004AD576 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A9F4D9AF2B8EB2FC004AD576 /* Build configuration list for PBXNativeTarget "MoltenVK-tvOS-dynamic" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A9F4D9B02B8EB2FC004AD576 /* Debug */, + A9F4D9B12B8EB2FC004AD576 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A9F4D9CB2B8EB6DC004AD576 /* Build configuration list for PBXNativeTarget "MoltenVK-xrOS-dynamic" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A9F4D9CC2B8EB6DC004AD576 /* Debug */, + A9F4D9CD2B8EB6DC004AD576 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A9F4D9EA2B8EC112004AD576 /* Build configuration list for PBXNativeTarget "MoltenVK-macOS-dynamic" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A9F4D9EB2B8EC112004AD576 /* Debug */, + A9F4D9EC2B8EC112004AD576 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; A9F55D28198BE6A7004EC31B /* Build configuration list for PBXProject "MoltenVK" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -2171,7 +2681,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - DCFD7F5F2A45BC6E007BBBF7 /* Build configuration list for PBXNativeTarget "MoltenVK-xrOS" */ = { + DCFD7F5F2A45BC6E007BBBF7 /* Build configuration list for PBXNativeTarget "MoltenVK-xrOS-static" */ = { isa = XCConfigurationList; buildConfigurations = ( DCFD7F602A45BC6E007BBBF7 /* Debug */, diff --git a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-iOS.xcscheme b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-iOS.xcscheme index cb49ab86..9fcf34ef 100644 --- a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-iOS.xcscheme +++ b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-iOS.xcscheme @@ -14,9 +14,9 @@ buildForAnalyzing = "YES"> @@ -45,15 +45,6 @@ enableGPUValidationMode = "1" allowLocationSimulation = "NO" queueDebuggingEnabled = "No"> - - - - - - - - diff --git a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-macOS.xcscheme b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-macOS.xcscheme index 965c4bde..75bd1f3c 100644 --- a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-macOS.xcscheme +++ b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-macOS.xcscheme @@ -14,9 +14,9 @@ buildForAnalyzing = "YES"> @@ -45,15 +45,6 @@ enableGPUValidationMode = "1" allowLocationSimulation = "NO" queueDebuggingEnabled = "No"> - - - - - - - - diff --git a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-tvOS.xcscheme b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-tvOS.xcscheme index 96211dd8..29ee8f6f 100644 --- a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-tvOS.xcscheme +++ b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-tvOS.xcscheme @@ -14,9 +14,9 @@ buildForAnalyzing = "YES"> @@ -40,15 +40,6 @@ debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> - - - - - - - - diff --git a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-xrOS.xcscheme b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-xrOS.xcscheme index e80fa8c3..51e9c9fa 100644 --- a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-xrOS.xcscheme +++ b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-xrOS.xcscheme @@ -14,9 +14,9 @@ buildForAnalyzing = "YES"> @@ -46,15 +46,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> - - - - diff --git a/MoltenVK/MoltenVK/API/mvk_private_api.h b/MoltenVK/MoltenVK/API/mvk_private_api.h index 4a6ae35e..0d2d9ae9 100644 --- a/MoltenVK/MoltenVK/API/mvk_private_api.h +++ b/MoltenVK/MoltenVK/API/mvk_private_api.h @@ -44,7 +44,7 @@ typedef unsigned long MTLArgumentBuffersTier; */ -#define MVK_PRIVATE_API_VERSION 39 +#define MVK_PRIVATE_API_VERSION 40 #pragma mark - @@ -66,9 +66,12 @@ typedef unsigned long MTLArgumentBuffersTier; #define MVK_VERSION_MINOR 2 #define MVK_VERSION_PATCH 8 -#define MVK_MAKE_VERSION(major, minor, patch) (((major) * 10000) + ((minor) * 100) + (patch)) -#define MVK_VERSION MVK_MAKE_VERSION(MVK_VERSION_MAJOR, MVK_VERSION_MINOR, MVK_VERSION_PATCH) +#define MVK_MAKE_VERSION(major, minor, patch) (((major) * 10000) + ((minor) * 100) + (patch)) +#define MVK_VERSION MVK_MAKE_VERSION(MVK_VERSION_MAJOR, MVK_VERSION_MINOR, MVK_VERSION_PATCH) +#define MVK_STRINGIFY_IMPL(val) #val +#define MVK_STRINGIFY(val) MVK_STRINGIFY_IMPL(val) +#define MVK_VERSION_STRING (MVK_STRINGIFY(MVK_VERSION_MAJOR) "." MVK_STRINGIFY(MVK_VERSION_MINOR) "." MVK_STRINGIFY(MVK_VERSION_PATCH)) #pragma mark - #pragma mark MoltenVK configuration @@ -359,6 +362,7 @@ typedef struct { VkDeviceSize hostMemoryPageSize; /**< The size of a page of host memory on this platform. */ VkBool32 dynamicVertexStride; /**< If true, VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE is supported. */ VkBool32 needsCubeGradWorkaround; /**< If true, sampling from cube textures with explicit gradients is broken and needs a workaround. */ + VkBool32 nativeTextureAtomics; /**< If true, atomic operations on textures are supported natively. */ } MVKPhysicalDeviceMetalFeatures; diff --git a/MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.mm b/MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.mm index bdeda016..405b7833 100644 --- a/MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.mm +++ b/MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.mm @@ -946,10 +946,6 @@ void MVKGraphicsResourcesCommandEncoderState::markDirty() { } } -#if !MVK_XCODE_15 -static const NSUInteger MTLAttributeStrideStatic = NSUIntegerMax; -#endif - void MVKGraphicsResourcesCommandEncoderState::encodeImpl(uint32_t stage) { auto* pipeline = _cmdEncoder->getGraphicsPipeline(); diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKBuffer.mm b/MoltenVK/MoltenVK/GPUObjects/MVKBuffer.mm index 17aa7350..4d04f505 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKBuffer.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKBuffer.mm @@ -289,7 +289,11 @@ id MVKBufferView::getMTLTexture() { MTLTextureUsage usage = MTLTextureUsageShaderRead; if ( mvkIsAnyFlagEnabled(_buffer->getUsage(), VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) ) { - usage |= MTLTextureUsageShaderWrite; + usage |= MTLTextureUsageShaderWrite; +#if MVK_XCODE_15 + if (getPhysicalDevice()->useNativeTextureAtomics()) + usage |= MTLTextureUsageShaderAtomic; +#endif } id mtlBuff; VkDeviceSize mtlBuffOffset; diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptor.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptor.mm index efc5dbcb..65056a55 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptor.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptor.mm @@ -323,7 +323,7 @@ void MVKDescriptorSetLayoutBinding::push(MVKCommandEncoder* cmdEncoder, if (_applyToStage[i]) { tb.index = mtlIdxs.stages[i].textureIndex + rezIdx + planeIndex; BIND_GRAPHICS_OR_COMPUTE(cmdEncoder, bindTexture, pipelineBindPoint, i, tb); - if (_info.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) { + if (_info.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE && !getPhysicalDevice()->useNativeTextureAtomics()) { bb.index = mtlIdxs.stages[i].bufferIndex + rezIdx; BIND_GRAPHICS_OR_COMPUTE(cmdEncoder, bindBuffer, pipelineBindPoint, i, bb); } @@ -348,7 +348,7 @@ void MVKDescriptorSetLayoutBinding::push(MVKCommandEncoder* cmdEncoder, if (_applyToStage[i]) { tb.index = mtlIdxs.stages[i].textureIndex + rezIdx; BIND_GRAPHICS_OR_COMPUTE(cmdEncoder, bindTexture, pipelineBindPoint, i, tb); - if (_info.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) { + if (_info.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER && !getPhysicalDevice()->useNativeTextureAtomics()) { bb.index = mtlIdxs.stages[i].bufferIndex + rezIdx; BIND_GRAPHICS_OR_COMPUTE(cmdEncoder, bindBuffer, pipelineBindPoint, i, bb); } @@ -440,7 +440,9 @@ void MVKDescriptorSetLayoutBinding::addMTLArgumentDescriptors(NSMutableArrayuseNativeTextureAtomics()) { // Needed for emulated atomic operations + addMTLArgumentDescriptor(args, getMetalResourceIndexOffsets().bufferIndex, MTLDataTypePointer, MTLArgumentAccessReadWrite); + } break; case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: @@ -449,7 +451,9 @@ void MVKDescriptorSetLayoutBinding::addMTLArgumentDescriptors(NSMutableArrayuseNativeTextureAtomics()) { // Needed for emulated atomic operations + addMTLArgumentDescriptor(args, getMetalResourceIndexOffsets().bufferIndex, MTLDataTypePointer, MTLArgumentAccessReadWrite); + } break; case VK_DESCRIPTOR_TYPE_SAMPLER: @@ -664,7 +668,7 @@ void MVKDescriptorSetLayoutBinding::initMetalResourceIndexOffsets(const VkDescri case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: setResourceIndexOffset(textureIndex); - setResourceIndexOffset(bufferIndex); + if (!getPhysicalDevice()->useNativeTextureAtomics()) setResourceIndexOffset(bufferIndex); if (pBinding->descriptorCount > 1 && !_device->_pMetalFeatures->arrayOfTextures) { _layout->setConfigurationResult(reportError(VK_ERROR_FEATURE_NOT_PRESENT, "Device %s does not support arrays of textures.", _device->getName())); @@ -927,7 +931,7 @@ void MVKImageDescriptor::bind(MVKCommandEncoder* cmdEncoder, if (stages[i]) { tb.index = mtlIndexes.stages[i].textureIndex + elementIndex + planeIndex; BIND_GRAPHICS_OR_COMPUTE(cmdEncoder, bindTexture, pipelineBindPoint, i, tb); - if (descType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) { + if (descType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE && !cmdEncoder->getPhysicalDevice()->useNativeTextureAtomics()) { bb.index = mtlIndexes.stages[i].bufferIndex + elementIndex + planeIndex; BIND_GRAPHICS_OR_COMPUTE(cmdEncoder, bindBuffer, pipelineBindPoint, i, bb); } @@ -958,7 +962,7 @@ void MVKImageDescriptor::encodeToMetalArgumentBuffer(MVKResourcesCommandEncoderS if (encodeUsage) { rezEncState->encodeResourceUsage(stage, mtlTexture, getMTLResourceUsage(), mvkDSLBind->getMTLRenderStages()); } - if (descType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) { + if (descType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE && !mvkDSLBind->getPhysicalDevice()->useNativeTextureAtomics()) { id mtlTex = mtlTexture.parentTexture ? mtlTexture.parentTexture : mtlTexture; id mtlBuff = mtlTex.buffer; if (mtlBuff) { @@ -1226,7 +1230,7 @@ void MVKTexelBufferDescriptor::bind(MVKCommandEncoder* cmdEncoder, if (stages[i]) { tb.index = mtlIndexes.stages[i].textureIndex + elementIndex; BIND_GRAPHICS_OR_COMPUTE(cmdEncoder, bindTexture, pipelineBindPoint, i, tb); - if (descType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) { + if (descType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER && !cmdEncoder->getPhysicalDevice()->useNativeTextureAtomics()) { bb.index = mtlIndexes.stages[i].bufferIndex + elementIndex; BIND_GRAPHICS_OR_COMPUTE(cmdEncoder, bindBuffer, pipelineBindPoint, i, bb); } @@ -1251,7 +1255,7 @@ void MVKTexelBufferDescriptor::encodeToMetalArgumentBuffer(MVKResourcesCommandEn rezEncState->encodeResourceUsage(stage, mtlTexture, getMTLResourceUsage(), mvkDSLBind->getMTLRenderStages()); } - if (descType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) { + if (descType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER && !mvkDSLBind->getPhysicalDevice()->useNativeTextureAtomics()) { id mtlBuff = mtlTexture.buffer; if (mtlBuff) { if (encodeToArgBuffer) { diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm index 824de5b0..2b05095b 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm @@ -761,7 +761,8 @@ void MVKDescriptorPool::initMetalArgumentBuffer(const VkDescriptorPoolCreateInfo case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: mtlTexCnt += poolSize.descriptorCount; - mtlBuffCnt += poolSize.descriptorCount; + if (!getPhysicalDevice()->useNativeTextureAtomics()) + mtlBuffCnt += poolSize.descriptorCount; break; case VK_DESCRIPTOR_TYPE_SAMPLER: diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.h b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.h index 6747bfa4..0102fa1a 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.h +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.h @@ -360,6 +360,9 @@ public: return _metalFeatures.argumentBuffers && getMVKConfig().useMetalArgumentBuffers != MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS_NEVER; }; + /** Returns whether native texture atomics are supported and should be used. */ + bool useNativeTextureAtomics() { return _metalFeatures.nativeTextureAtomics; } + #pragma mark Construction diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm index 6fbf6df6..61a441de 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm @@ -539,7 +539,7 @@ void MVKPhysicalDevice::getProperties(VkPhysicalDeviceProperties2* properties) { supportedProps12.pNext = nullptr; supportedProps12.driverID = VK_DRIVER_ID_MOLTENVK; strcpy(supportedProps12.driverName, kMVKMoltenVKDriverLayerName); - strcpy(supportedProps12.driverInfo, mvkGetMoltenVKVersionString(MVK_VERSION).c_str()); + strcpy(supportedProps12.driverInfo, MVK_VERSION_STRING); supportedProps12.conformanceVersion.major = 0; supportedProps12.conformanceVersion.minor = 0; supportedProps12.conformanceVersion.subminor = 0; @@ -1810,6 +1810,8 @@ void MVKPhysicalDevice::initMetalFeatures() { #if MVK_XCODE_15 // Dynamic vertex stride needs to have everything aligned - compiled with support for vertex stride calls, and supported by both runtime OS and GPU. _metalFeatures.dynamicVertexStride = mvkOSVersionIsAtLeast(14.0, 17.0, 1.0) && (supportsMTLGPUFamily(Apple4) || supportsMTLGPUFamily(Mac2)); + + _metalFeatures.nativeTextureAtomics = mvkOSVersionIsAtLeast(14.0, 17.0, 1.0) && (supportsMTLGPUFamily(Metal3) || supportsMTLGPUFamily(Apple6) || supportsMTLGPUFamily(Mac2)); #endif // GPU-specific features @@ -3681,7 +3683,10 @@ void MVKDevice::getDescriptorVariableDescriptorCountLayoutSupport(const VkDescri case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: mtlTexCnt += pBind->descriptorCount; - mtlBuffCnt += pBind->descriptorCount; + + if (getPhysicalDevice()->useNativeTextureAtomics()) + mtlBuffCnt += pBind->descriptorCount; + maxVarDescCount = min(_pMetalFeatures->maxPerStageTextureCount - mtlTexCnt, _pMetalFeatures->maxPerStageBufferCount - mtlBuffCnt); break; diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKImage.h b/MoltenVK/MoltenVK/GPUObjects/MVKImage.h index 9cc6a282..7a032f6b 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKImage.h +++ b/MoltenVK/MoltenVK/GPUObjects/MVKImage.h @@ -372,6 +372,7 @@ protected: bool _isAliasable; bool _hasExtendedUsage; bool _hasMutableFormat; + bool _shouldSupportAtomics; bool _isLinearForAtomics; }; diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKImage.mm b/MoltenVK/MoltenVK/GPUObjects/MVKImage.mm index 05f7eae5..a0241798 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKImage.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKImage.mm @@ -860,7 +860,7 @@ MTLTextureUsage MVKImage::getMTLTextureUsage(MTLPixelFormat mtlPixFmt) { needsReinterpretation = needsReinterpretation || !pixFmts->compatibleAsLinearOrSRGB(mtlPixFmt, viewFmt); } - MTLTextureUsage mtlUsage = pixFmts->getMTLTextureUsage(getCombinedUsage(), mtlPixFmt, _samples, _isLinear || _isLinearForAtomics, needsReinterpretation, _hasExtendedUsage); + MTLTextureUsage mtlUsage = pixFmts->getMTLTextureUsage(getCombinedUsage(), mtlPixFmt, _samples, _isLinear || _isLinearForAtomics, needsReinterpretation, _hasExtendedUsage, _shouldSupportAtomics); // Metal before 3.0 doesn't support 3D compressed textures, so we'll // decompress the texture ourselves, and we need to be able to write to it. @@ -934,10 +934,11 @@ MVKImage::MVKImage(MVKDevice* device, const VkImageCreateInfo* pCreateInfo) : MV // If this is a storage image of format R32_UINT or R32_SINT, or MUTABLE_FORMAT is set // and R32_UINT is in the set of possible view formats, then we must use a texel buffer, // or image atomics won't work. - _isLinearForAtomics = (_arrayLayers == 1 && _mipLevels == 1 && getImageType() == VK_IMAGE_TYPE_2D && mvkIsAnyFlagEnabled(getCombinedUsage(), VK_IMAGE_USAGE_STORAGE_BIT) && - ((_vkFormat == VK_FORMAT_R32_UINT || _vkFormat == VK_FORMAT_R32_SINT) || - (_hasMutableFormat && pixFmts->getViewClass(_vkFormat) == MVKMTLViewClass::Color32 && - (getIsValidViewFormat(VK_FORMAT_R32_UINT) || getIsValidViewFormat(VK_FORMAT_R32_SINT))))); + _shouldSupportAtomics = mvkIsAnyFlagEnabled(getCombinedUsage(), VK_IMAGE_USAGE_STORAGE_BIT) && _mipLevels == 1 && + ((_vkFormat == VK_FORMAT_R32_UINT || _vkFormat == VK_FORMAT_R32_SINT) || + (_hasMutableFormat && pixFmts->getViewClass(_vkFormat) == MVKMTLViewClass::Color32 && (getIsValidViewFormat(VK_FORMAT_R32_UINT) || getIsValidViewFormat(VK_FORMAT_R32_SINT)))); + + _isLinearForAtomics = _shouldSupportAtomics && !getPhysicalDevice()->useNativeTextureAtomics() && _arrayLayers == 1 && getImageType() == VK_IMAGE_TYPE_2D; _is3DCompressed = (getImageType() == VK_IMAGE_TYPE_3D) && (pixFmts->getFormatType(pCreateInfo->format) == kMVKFormatCompressed) && !_device->_pMetalFeatures->native3DCompressedTextures; _isDepthStencilAttachment = (mvkAreAllFlagsEnabled(pCreateInfo->usage, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) || diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm b/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm index 93d1cb0c..7ec63a9f 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm @@ -24,6 +24,8 @@ #include "MVKOSExtensions.h" #include "mvk_deprecated_api.h" +#include + using namespace std; @@ -769,9 +771,11 @@ void MVKInstance::initProcAddrs() { } void MVKInstance::logVersions() { + static_assert(string_view(MVK_STRINGIFY(MVK_FRAMEWORK_VERSION)) == MVK_VERSION_STRING, "Xcode build setting CURRENT_PROJECT_VERSION must be identical to the MoltenVK version (MVK_VERSION_STRING)."); + MVKExtensionList allExtns(this, true); MVKLogInfo("MoltenVK version %s, supporting Vulkan version %s.\n\tThe following %d Vulkan extensions are supported:%s", - mvkGetMoltenVKVersionString(MVK_VERSION).c_str(), + MVK_VERSION_STRING, mvkGetVulkanVersionString(getMVKConfig().apiVersionToAdvertise).c_str(), allExtns.getEnabledCount(), allExtns.enabledNamesString("\n\t\t", true).c_str()); diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.h b/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.h index 9ebe3a36..db9cc9d4 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.h +++ b/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.h @@ -388,7 +388,8 @@ public: VkSampleCountFlagBits samples = VK_SAMPLE_COUNT_1_BIT, bool isLinear = false, bool needsReinterpretation = true, - bool isExtended = false); + bool isExtended = false, + bool supportAtomics = false); /** Enumerates all formats that support the given features, calling a specified function for each one. */ void enumerateSupportedFormats(const VkFormatProperties3& properties, bool any, std::function func); diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.mm b/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.mm index 7421573f..e7a93c4c 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.mm @@ -702,7 +702,8 @@ MTLTextureUsage MVKPixelFormats::getMTLTextureUsage(VkImageUsageFlags vkImageUsa VkSampleCountFlagBits samples, bool isLinear, bool needsReinterpretation, - bool isExtended) { + bool isExtended, + bool supportAtomics) { bool isDepthFmt = isDepthFormat(mtlFormat); bool isStencilFmt = isStencilFormat(mtlFormat); bool isCombinedDepthStencilFmt = isDepthFmt && isStencilFmt; @@ -726,6 +727,13 @@ MTLTextureUsage MVKPixelFormats::getMTLTextureUsage(VkImageUsageFlags vkImageUsa mvkEnableFlags(mtlUsage, MTLTextureUsageShaderWrite); } + +#if MVK_XCODE_15 + if (supportAtomics) { + mvkEnableFlags(mtlUsage, MTLTextureUsageShaderAtomic); + } +#endif + #if MVK_MACOS // Clearing a linear image may use shader writes. if (mvkIsAnyFlagEnabled(vkImageUsageFlags, (VK_IMAGE_USAGE_TRANSFER_DST_BIT)) && diff --git a/MoltenVK/MoltenVK/Utility/MVKFoundation.h b/MoltenVK/MoltenVK/Utility/MVKFoundation.h index 50b886c9..af7bf71c 100644 --- a/MoltenVK/MoltenVK/Utility/MVKFoundation.h +++ b/MoltenVK/MoltenVK/Utility/MVKFoundation.h @@ -127,17 +127,6 @@ static inline std::string mvkGetVulkanVersionString(uint32_t vkVersion) { return verStr; } -/** Returns the MoltenVK API version number as a string. */ -static inline std::string mvkGetMoltenVKVersionString(uint32_t mvkVersion) { - std::string verStr; - verStr += std::to_string(mvkVersion / 10000); - verStr += "."; - verStr += std::to_string((mvkVersion % 10000) / 100); - verStr += "."; - verStr += std::to_string(mvkVersion % 100); - return verStr; -} - #pragma mark - #pragma mark Alignment functions diff --git a/MoltenVK/MoltenVK/Vulkan/mvk_api.mm b/MoltenVK/MoltenVK/Vulkan/mvk_api.mm index e9f39411..cade5025 100644 --- a/MoltenVK/MoltenVK/Vulkan/mvk_api.mm +++ b/MoltenVK/MoltenVK/Vulkan/mvk_api.mm @@ -106,7 +106,7 @@ MVK_PUBLIC_VULKAN_SYMBOL void vkGetVersionStringsMVK( size_t len; - string mvkVer = mvkGetMoltenVKVersionString(MVK_VERSION); + string mvkVer = MVK_VERSION_STRING; len = mvkVer.copy(pMoltenVersionStringBuffer, moltenVersionStringBufferLength - 1); pMoltenVersionStringBuffer[len] = 0; // terminator diff --git a/MoltenVK/dylib b/MoltenVK/dylib deleted file mode 120000 index d7bc57e8..00000000 --- a/MoltenVK/dylib +++ /dev/null @@ -1 +0,0 @@ -../Package/Latest/MoltenVK/dylib \ No newline at end of file diff --git a/MoltenVKPackaging.xcodeproj/project.pbxproj b/MoltenVKPackaging.xcodeproj/project.pbxproj index 4ce271e0..fe2f6788 100644 --- a/MoltenVKPackaging.xcodeproj/project.pbxproj +++ b/MoltenVKPackaging.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 48; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -14,11 +14,23 @@ 2FEA0A3424902F5E00EEF3AD /* Package MoltenVK */, ); dependencies = ( - 2FEA0AC32490303F00EEF3AD /* PBXTargetDependency */, + A9F4D9B62B8EB63E004AD576 /* PBXTargetDependency */, ); name = "MoltenVK-tvOS"; productName = Package; }; + A91170FD2B9110050057AD37 /* MoltenVK-MacCat */ = { + isa = PBXAggregateTarget; + buildConfigurationList = A91171012B9110050057AD37 /* Build configuration list for PBXAggregateTarget "MoltenVK-MacCat" */; + buildPhases = ( + A91171002B9110050057AD37 /* Package MoltenVK */, + ); + dependencies = ( + A911710D2B9110380057AD37 /* PBXTargetDependency */, + ); + name = "MoltenVK-MacCat"; + productName = Package; + }; A975D5782140585200D4834F /* MoltenVK-iOS */ = { isa = PBXAggregateTarget; buildConfigurationList = A975D5882140585200D4834F /* Build configuration list for PBXAggregateTarget "MoltenVK-iOS" */; @@ -26,7 +38,7 @@ A975D5872140585200D4834F /* Package MoltenVK */, ); dependencies = ( - A975D5792140585200D4834F /* PBXTargetDependency */, + A9F4D99B2B8E8E1D004AD576 /* PBXTargetDependency */, ); name = "MoltenVK-iOS"; productName = Package; @@ -38,7 +50,7 @@ A975D59A2140586700D4834F /* Package MoltenVK */, ); dependencies = ( - A975D58E2140586700D4834F /* PBXTargetDependency */, + A9F4D9F12B8EC210004AD576 /* PBXTargetDependency */, ); name = "MoltenVK-macOS"; productName = Package; @@ -62,9 +74,9 @@ A9B1008824F84BE400EADC6E /* Package MoltenVK */, ); dependencies = ( - A9B1008124F84BA700EADC6E /* PBXTargetDependency */, - A9B1008324F84BA700EADC6E /* PBXTargetDependency */, - A9B1008524F84BA700EADC6E /* PBXTargetDependency */, + A9F4D9F82B8EC22E004AD576 /* PBXTargetDependency */, + A9F4D9F62B8EC22E004AD576 /* PBXTargetDependency */, + A9F4D9FA2B8EC22E004AD576 /* PBXTargetDependency */, ); name = MoltenVK; productName = Package; @@ -76,7 +88,7 @@ DCFD7ED82A45BC56007BBBF7 /* Package MoltenVK */, ); dependencies = ( - DCFD7F682A45BC81007BBBF7 /* PBXTargetDependency */, + A9F4D9D52B8EBA14004AD576 /* PBXTargetDependency */, ); name = "MoltenVK-xrOS"; productName = Package; @@ -91,12 +103,12 @@ remoteGlobalIDString = 2FEA0ABA24902F9F00EEF3AD; remoteInfo = "MoltenVK-tvOS"; }; - 2FEA0AC22490303F00EEF3AD /* PBXContainerItemProxy */ = { + A911710C2B9110380057AD37 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; proxyType = 1; - remoteGlobalIDString = 2FEA0A3B24902F9F00EEF3AD; - remoteInfo = "MoltenVK-tvOS"; + remoteGlobalIDString = A9B8EE091A98D796009C5A02; + remoteInfo = "MoltenVK-iOS-static"; }; A92DB3F41CE0F72500FBC835 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -112,20 +124,6 @@ remoteGlobalIDString = A9CBEE011B6299D800E45FDC; remoteInfo = "MoltenVK-macOS"; }; - A975D57A2140585200D4834F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A9B8EE091A98D796009C5A02; - remoteInfo = "MoltenVK-iOS"; - }; - A975D58F2140586700D4834F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A9CBED861B6299D800E45FDC; - remoteInfo = "MoltenVK-macOS"; - }; A97D77552B24FBDF00E36932 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A92DB40E1CE0F89600FBC835 /* MoltenVKShaderConverter.xcodeproj */; @@ -161,26 +159,82 @@ remoteGlobalIDString = A9092A8C1A81717B00051823; remoteInfo = MoltenVKShaderConverter; }; - A9B1008024F84BA700EADC6E /* PBXContainerItemProxy */ = { + A9F4D9982B8E8CE0004AD576 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A9B8EE091A98D796009C5A02; - remoteInfo = "MoltenVK-iOS"; + proxyType = 2; + remoteGlobalIDString = A9F4D96B2B8E7366004AD576; + remoteInfo = "MoltenVK-iOS-dynamic"; }; - A9B1008224F84BA700EADC6E /* PBXContainerItemProxy */ = { + A9F4D99A2B8E8E1D004AD576 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; proxyType = 1; - remoteGlobalIDString = A9CBED861B6299D800E45FDC; - remoteInfo = "MoltenVK-macOS"; + remoteGlobalIDString = A9F4D96A2B8E7366004AD576; + remoteInfo = "MoltenVK-iOS-dynamic"; }; - A9B1008424F84BA700EADC6E /* PBXContainerItemProxy */ = { + A9F4D9B52B8EB63E004AD576 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; proxyType = 1; - remoteGlobalIDString = 2FEA0A3B24902F9F00EEF3AD; - remoteInfo = "MoltenVK-tvOS"; + remoteGlobalIDString = A9F4D99E2B8EB2FC004AD576; + remoteInfo = "MoltenVK-tvOS-dynamic"; + }; + A9F4D9B82B8EB63E004AD576 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A9F4D9B22B8EB2FC004AD576; + remoteInfo = "MoltenVK-tvOS-dynamic"; + }; + A9F4D9D42B8EBA14004AD576 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A9F4D9BA2B8EB6DC004AD576; + remoteInfo = "MoltenVK-xrOS-dynamic"; + }; + A9F4D9D72B8EBA14004AD576 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A9F4D9CE2B8EB6DC004AD576; + remoteInfo = "MoltenVK-xrOS-dynamic"; + }; + A9F4D9F02B8EC210004AD576 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A9F4D9D92B8EC112004AD576; + remoteInfo = "MoltenVK-macOS-dynamic"; + }; + A9F4D9F32B8EC210004AD576 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A9F4D9ED2B8EC112004AD576; + remoteInfo = "MoltenVK-macOS-dynamic"; + }; + A9F4D9F52B8EC22E004AD576 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A9F4D96A2B8E7366004AD576; + remoteInfo = "MoltenVK-iOS-dynamic"; + }; + A9F4D9F72B8EC22E004AD576 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A9F4D9D92B8EC112004AD576; + remoteInfo = "MoltenVK-macOS-dynamic"; + }; + A9F4D9F92B8EC22E004AD576 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A9F4D99E2B8EB2FC004AD576; + remoteInfo = "MoltenVK-tvOS-dynamic"; }; A9FC5F5C249D2547003CB086 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -196,13 +250,6 @@ remoteGlobalIDString = DCFD7F622A45BC6E007BBBF7; remoteInfo = "MoltenVK-xrOS"; }; - DCFD7F672A45BC81007BBBF7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = DCFD7EDF2A45BC6E007BBBF7; - remoteInfo = "MoltenVK-xrOS"; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -219,20 +266,16 @@ A92EF7CB21856EA300C8B91B /* package_shader_converter_xcframework.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_shader_converter_xcframework.sh; sourceTree = ""; }; A92EF7DE2186451700C8B91B /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = ../Makefile; sourceTree = ""; }; A93ED4DE24F59CDB00FEB018 /* copy_lib_to_staging.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = copy_lib_to_staging.sh; sourceTree = ""; }; - A93ED4E324F59CDB00FEB018 /* copy_to_staging.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = copy_to_staging.sh; sourceTree = ""; }; - A975D55C213F25D700D4834F /* create_dylib.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_dylib.sh; sourceTree = ""; }; A97D77502B24FBDF00E36932 /* MoltenVK_Configuration_Parameters.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = MoltenVK_Configuration_Parameters.md; path = Docs/MoltenVK_Configuration_Parameters.md; sourceTree = ""; }; A980A25F24C628F3007A8F6F /* gen_moltenvk_rev_hdr.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = gen_moltenvk_rev_hdr.sh; sourceTree = ""; }; A98149E51FB78829005F00B4 /* MoltenVK_Runtime_UserGuide.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = MoltenVK_Runtime_UserGuide.md; path = Docs/MoltenVK_Runtime_UserGuide.md; sourceTree = ""; }; A9A15AA625D6D884004EEBE9 /* CI.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; name = CI.yml; path = .github/workflows/CI.yml; sourceTree = ""; }; A9B1007A24F837AF00EADC6E /* create_xcframework_func.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_xcframework_func.sh; sourceTree = ""; }; - A9C70F41221B04C800FBA31A /* create_dylib_macos.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_dylib_macos.sh; sourceTree = ""; }; - A9C70F45221B04C800FBA31A /* create_dylib_ios.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_dylib_ios.sh; sourceTree = ""; }; A9CBBFF924F8A1EB006D41EF /* package_moltenvk_xcframework.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_moltenvk_xcframework.sh; sourceTree = ""; }; A9DA8341218A198C002AA662 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitignore; sourceTree = ""; }; A9DDBF8C26827F02005DD991 /* runcts */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = runcts; sourceTree = ""; }; + A9F4D8942B8D4F81004AD576 /* copy_to_staging.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = copy_to_staging.sh; sourceTree = ""; }; A9FC5F60249D2ED3003CB086 /* package_all.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_all.sh; sourceTree = ""; }; - A9FC5F64249D3778003CB086 /* create_dylib_tvos.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_dylib_tvos.sh; sourceTree = ""; }; A9FE05632B697AE400208814 /* get_failing_cts_tests.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = get_failing_cts_tests.py; sourceTree = ""; }; /* End PBXFileReference section */ @@ -245,6 +288,7 @@ A975D55B213F25AD00D4834F /* Scripts */, A92DB3E11CE0F34500FBC835 /* Docs */, A9DA833F218A193F002AA662 /* Git */, + A9F4D9582B8E7345004AD576 /* Products */, ); sourceTree = ""; }; @@ -263,10 +307,14 @@ A92DB3EF1CE0F72500FBC835 /* Products */ = { isa = PBXGroup; children = ( - A92DB3F51CE0F72500FBC835 /* libMoltenVK.a */, - 2FEA0ABE2490302F00EEF3AD /* libMoltenVK.a */, A92DB3F71CE0F72500FBC835 /* libMoltenVK.a */, + A9F4D9F42B8EC210004AD576 /* MoltenVK.framework */, + A92DB3F51CE0F72500FBC835 /* libMoltenVK.a */, + A9F4D9992B8E8CE0004AD576 /* MoltenVK.framework */, + 2FEA0ABE2490302F00EEF3AD /* libMoltenVK.a */, + A9F4D9B92B8EB63E004AD576 /* MoltenVK.framework */, DCFD7F662A45BC7D007BBBF7 /* libMoltenVK.a */, + A9F4D9D82B8EBA14004AD576 /* MoltenVK.framework */, ); name = Products; sourceTree = ""; @@ -274,13 +322,8 @@ A975D55B213F25AD00D4834F /* Scripts */ = { isa = PBXGroup; children = ( - A93ED4E324F59CDB00FEB018 /* copy_to_staging.sh */, + A9F4D8942B8D4F81004AD576 /* copy_to_staging.sh */, A93ED4DE24F59CDB00FEB018 /* copy_lib_to_staging.sh */, - A9C70F45221B04C800FBA31A /* create_dylib_ios.sh */, - A9C70F41221B04C800FBA31A /* create_dylib_macos.sh */, - A9FC5F64249D3778003CB086 /* create_dylib_tvos.sh */, - 279BD8642B7FAE0A0021CE70 /* create_dylib_xros.sh */, - A975D55C213F25D700D4834F /* create_dylib.sh */, A9B1007A24F837AF00EADC6E /* create_xcframework_func.sh */, A980A25F24C628F3007A8F6F /* gen_moltenvk_rev_hdr.sh */, A9FE05632B697AE400208814 /* get_failing_cts_tests.py */, @@ -318,6 +361,13 @@ name = Git; sourceTree = ""; }; + A9F4D9582B8E7345004AD576 /* Products */ = { + isa = PBXGroup; + children = ( + ); + name = Products; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXProject section */ @@ -340,6 +390,7 @@ Base, ); mainGroup = A90B2B1C1A9B6170008EE819; + productRefGroup = A9F4D9582B8E7345004AD576 /* Products */; projectDirPath = ""; projectReferences = ( { @@ -357,8 +408,9 @@ A975D5782140585200D4834F /* MoltenVK-iOS */, 2FEA0A2F24902F5E00EEF3AD /* MoltenVK-tvOS */, A975D58B2140586700D4834F /* MoltenVK-macOS */, - A9AD700D2440ED3B00B9E254 /* MVKShaderConverterTool */, DCFD7ED52A45BC56007BBBF7 /* MoltenVK-xrOS */, + A91170FD2B9110050057AD37 /* MoltenVK-MacCat */, + A9AD700D2440ED3B00B9E254 /* MVKShaderConverterTool */, ); }; /* End PBXProject section */ @@ -413,6 +465,34 @@ remoteRef = A98149921FB6B566005F00B4 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + A9F4D9992B8E8CE0004AD576 /* MoltenVK.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = MoltenVK.framework; + remoteRef = A9F4D9982B8E8CE0004AD576 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + A9F4D9B92B8EB63E004AD576 /* MoltenVK.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = MoltenVK.framework; + remoteRef = A9F4D9B82B8EB63E004AD576 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + A9F4D9D82B8EBA14004AD576 /* MoltenVK.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = MoltenVK.framework; + remoteRef = A9F4D9D72B8EBA14004AD576 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + A9F4D9F42B8EC210004AD576 /* MoltenVK.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = MoltenVK.framework; + remoteRef = A9F4D9F32B8EC210004AD576 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; A9FC5F5D249D2547003CB086 /* libMoltenVKShaderConverter.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -432,11 +512,29 @@ /* Begin PBXShellScriptBuildPhase section */ 2FEA0A3424902F5E00EEF3AD /* Package MoltenVK */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${BUILT_PRODUCTS_DIR}/../XCFrameworkStaging", + "${BUILD_DIR}/XCFrameworkStaging", + ); + name = "Package MoltenVK"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/$(TARGET_NAME)/PackagePhaseDummyOutputFile", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = ". \"${SRCROOT}/Scripts/package_all.sh\"\n"; + }; + A91171002B9110050057AD37 /* Package MoltenVK */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${BUILD_DIR}/XCFrameworkStaging", ); name = "Package MoltenVK"; outputPaths = ( @@ -448,11 +546,12 @@ }; A975D5872140585200D4834F /* Package MoltenVK */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${BUILT_PRODUCTS_DIR}/../XCFrameworkStaging", + "${BUILD_DIR}/XCFrameworkStaging", ); name = "Package MoltenVK"; outputPaths = ( @@ -464,11 +563,12 @@ }; A975D59A2140586700D4834F /* Package MoltenVK */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${BUILT_PRODUCTS_DIR}/../XCFrameworkStaging", + "${BUILD_DIR}/XCFrameworkStaging", ); name = "Package MoltenVK"; outputPaths = ( @@ -480,11 +580,12 @@ }; A9AD70122440ED3B00B9E254 /* Package MoltenVK */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${BUILT_PRODUCTS_DIR}/../XCFrameworkStaging", + "${BUILD_DIR}/XCFrameworkStaging", ); name = "Package MoltenVK"; outputPaths = ( @@ -496,13 +597,14 @@ }; A9B1008824F84BE400EADC6E /* Package MoltenVK */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); inputPaths = ( - "${BUILT_PRODUCTS_DIR}/../XCFrameworkStaging", + "${BUILD_DIR}/XCFrameworkStaging", ); name = "Package MoltenVK"; outputFileListPaths = ( @@ -516,11 +618,12 @@ }; DCFD7ED82A45BC56007BBBF7 /* Package MoltenVK */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${BUILT_PRODUCTS_DIR}/../XCFrameworkStaging", + "${BUILD_DIR}/XCFrameworkStaging", ); name = "Package MoltenVK"; outputPaths = ( @@ -533,45 +636,50 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXTargetDependency section */ - 2FEA0AC32490303F00EEF3AD /* PBXTargetDependency */ = { + A911710D2B9110380057AD37 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = "MoltenVK-tvOS"; - targetProxy = 2FEA0AC22490303F00EEF3AD /* PBXContainerItemProxy */; - }; - A975D5792140585200D4834F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "MoltenVK-iOS"; - targetProxy = A975D57A2140585200D4834F /* PBXContainerItemProxy */; - }; - A975D58E2140586700D4834F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "MoltenVK-macOS"; - targetProxy = A975D58F2140586700D4834F /* PBXContainerItemProxy */; + name = "MoltenVK-iOS-static"; + targetProxy = A911710C2B9110380057AD37 /* PBXContainerItemProxy */; }; A9AD70102440ED3B00B9E254 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = MoltenVKShaderConverter; targetProxy = A9AD70112440ED3B00B9E254 /* PBXContainerItemProxy */; }; - A9B1008124F84BA700EADC6E /* PBXTargetDependency */ = { + A9F4D99B2B8E8E1D004AD576 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = "MoltenVK-iOS"; - targetProxy = A9B1008024F84BA700EADC6E /* PBXContainerItemProxy */; + name = "MoltenVK-iOS-dynamic"; + targetProxy = A9F4D99A2B8E8E1D004AD576 /* PBXContainerItemProxy */; }; - A9B1008324F84BA700EADC6E /* PBXTargetDependency */ = { + A9F4D9B62B8EB63E004AD576 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = "MoltenVK-macOS"; - targetProxy = A9B1008224F84BA700EADC6E /* PBXContainerItemProxy */; + name = "MoltenVK-tvOS-dynamic"; + targetProxy = A9F4D9B52B8EB63E004AD576 /* PBXContainerItemProxy */; }; - A9B1008524F84BA700EADC6E /* PBXTargetDependency */ = { + A9F4D9D52B8EBA14004AD576 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = "MoltenVK-tvOS"; - targetProxy = A9B1008424F84BA700EADC6E /* PBXContainerItemProxy */; + name = "MoltenVK-xrOS-dynamic"; + targetProxy = A9F4D9D42B8EBA14004AD576 /* PBXContainerItemProxy */; }; - DCFD7F682A45BC81007BBBF7 /* PBXTargetDependency */ = { + A9F4D9F12B8EC210004AD576 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = "MoltenVK-xrOS"; - targetProxy = DCFD7F672A45BC81007BBBF7 /* PBXContainerItemProxy */; + name = "MoltenVK-macOS-dynamic"; + targetProxy = A9F4D9F02B8EC210004AD576 /* PBXContainerItemProxy */; + }; + A9F4D9F62B8EC22E004AD576 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "MoltenVK-iOS-dynamic"; + targetProxy = A9F4D9F52B8EC22E004AD576 /* PBXContainerItemProxy */; + }; + A9F4D9F82B8EC22E004AD576 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "MoltenVK-macOS-dynamic"; + targetProxy = A9F4D9F72B8EC22E004AD576 /* PBXContainerItemProxy */; + }; + A9F4D9FA2B8EC22E004AD576 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "MoltenVK-tvOS-dynamic"; + targetProxy = A9F4D9F92B8EC22E004AD576 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -604,6 +712,20 @@ }; name = Release; }; + A91171022B9110050057AD37 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + A91171032B9110050057AD37 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; A975D5892140585200D4834F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -695,6 +817,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + A91171012B9110050057AD37 /* Build configuration list for PBXAggregateTarget "MoltenVK-MacCat" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A91171022B9110050057AD37 /* Debug */, + A91171032B9110050057AD37 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; A975D5882140585200D4834F /* Build configuration list for PBXAggregateTarget "MoltenVK-iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package (MacCat only).xcscheme b/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package (MacCat only).xcscheme new file mode 100644 index 00000000..53bf20ae --- /dev/null +++ b/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package (MacCat only).xcscheme @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcframework b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcframework deleted file mode 120000 index 326ce4d2..00000000 --- a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcframework +++ /dev/null @@ -1 +0,0 @@ -../Package/Latest/MoltenVKShaderConverter/MoltenVKShaderConverter.xcframework \ No newline at end of file diff --git a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj index 6372955e..7c4a5b8d 100644 --- a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj +++ b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj @@ -114,6 +114,7 @@ A9546B232672A3B8004BA3E6 /* SPIRVSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SPIRVSupport.cpp; sourceTree = ""; }; A9546B242672A3B8004BA3E6 /* SPIRVSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPIRVSupport.h; sourceTree = ""; }; A964BD5F1C57EFBD00D930D8 /* MoltenVKShaderConverter */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = MoltenVKShaderConverter; sourceTree = BUILT_PRODUCTS_DIR; }; + A979A9152B9174EA00F69E67 /* libMoltenVKShaderConverter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libMoltenVKShaderConverter.a; path = "/Users/bill/Documents/Dev/iOSProjects/Molten/MoltenVK-bh/MoltenVKShaderConverter/build/Debug-xros/libMoltenVKShaderConverter.a"; sourceTree = ""; }; A97CC73D1C7527F3004A5C7E /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; A97CC73E1C7527F3004A5C7E /* MoltenVKShaderConverterTool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MoltenVKShaderConverterTool.cpp; sourceTree = ""; }; A97CC73F1C7527F3004A5C7E /* MoltenVKShaderConverterTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoltenVKShaderConverterTool.h; sourceTree = ""; }; @@ -125,7 +126,6 @@ A9B51BDB225E98BB00AC74D2 /* MVKOSExtensions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MVKOSExtensions.mm; sourceTree = ""; }; A9B51BDC225E98BB00AC74D2 /* MVKOSExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKOSExtensions.h; sourceTree = ""; }; A9F042AA1FB4D060009FCCB8 /* MVKCommonEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKCommonEnvironment.h; sourceTree = ""; }; - DCFD7F882A45BDA0007BBBF7 /* libMoltenVKShaderConverter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMoltenVKShaderConverter.a; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -256,7 +256,6 @@ A9F042A81FB4D060009FCCB8 /* Common */, A964B28D1C57EBC400D930D8 /* Products */, A972AD2921CEE6A80013AB25 /* Frameworks */, - DCFD7F882A45BDA0007BBBF7 /* libMoltenVKShaderConverter.a */, ); sourceTree = ""; }; @@ -412,7 +411,7 @@ ); name = "MoltenVKShaderConverter-xrOS"; productName = "MetalGLShaderConverter-macOS"; - productReference = DCFD7F882A45BDA0007BBBF7 /* libMoltenVKShaderConverter.a */; + productReference = A979A9152B9174EA00F69E67 /* libMoltenVKShaderConverter.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ @@ -477,7 +476,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\" \"lib${PRODUCT_NAME}.a\"\n"; }; A93ED4E824F59E1100FEB018 /* Copy to Staging */ = { isa = PBXShellScriptBuildPhase; @@ -497,7 +496,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\" \"lib${PRODUCT_NAME}.a\"\n"; }; A93ED4E924F59E1800FEB018 /* Copy to Staging */ = { isa = PBXShellScriptBuildPhase; @@ -517,7 +516,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\" \"lib${PRODUCT_NAME}.a\"\n"; }; DCFD7F842A45BDA0007BBBF7 /* Copy to Staging */ = { isa = PBXShellScriptBuildPhase; @@ -537,7 +536,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\" \"lib${PRODUCT_NAME}.a\"\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -708,6 +707,7 @@ COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + GCC_DYNAMIC_NO_PIC = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -767,6 +767,7 @@ COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_DYNAMIC_NO_PIC = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; GCC_NO_COMMON_BLOCKS = YES; diff --git a/README.md b/README.md index b172c77b..d029a0bb 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,11 @@ Table of Contents - [Using MoltenVK Directly](#download) - [Fetching **MoltenVK** Source Code](#install) - [Building **MoltenVK**](#building) - - [Building from the Command Line](#command_line_build) + - [Building With _Xcode_](#xcode_build) + - [Building From the Command Line](#command_line_build) - [Hiding _Vulkan_ API Symbols](#hiding_vulkan_symbols) - - [Accessing _Metal_ Private API calls](#metal_private_api) + - [Accessing _Metal_ Private API Calls](#metal_private_api) + - [Install *MoltenVK* to Replace The _Vulkan SDK_ `libMoltenVK.dylib`](#install_vksdk) - [Running **MoltenVK** Demo Applications](#demos) - [Using **MoltenVK** in Your Application](#using) - [**MoltenVK** and *Vulkan* Compliance](#compliance) @@ -210,6 +212,10 @@ that support *Metal*,or on the *Xcode* *iOS Simulator*, *tvOS Simulator*, or *vi - Information on *iOS* devices that are compatible with *Metal* can be found in [this article](https://developer.apple.com/library/content/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/HardwareGPUInformation/HardwareGPUInformation.html). + + +### Building With _Xcode_ + The `MoltenVKPackaging.xcodeproj` *Xcode* project contains targets and schemes to build and package the entire **MoltenVK** runtime distribution package, or to build individual **MoltenVK** or **MoltenVKShaderConverter** components. @@ -230,6 +236,9 @@ Each of these`MoltenVKPackaging.xcodeproj` *Xcode* project *Schemes* puts the re `Package` directory, creating it if necessary. This directory contains separate `Release` and `Debug` directories, holding the most recent **_Release_** and **_Debug_** builds, respectively. +_**Note:**_ Due to technical limitations in the dynamic library build tools, dynamic frameworks and libraries cannot be created +for the _tvOS Simulator_, or _MacCatalyst_ platforms. Static frameworks are created for these, and all other, platforms. + A separate `Latest` directory links to the most recent build, regardless of whether it was a **_Release_** or **_Debug_** build. Effectively, the `Package/Latest` directory points to whichever of the `Package/Release` or `Package/Debug` directories was most recently updated. @@ -240,7 +249,7 @@ to test your app with either a **_Debug_** build, or a higher-performance **_Rel -### Building from the Command Line +### 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 by executing a command similar to the following command within the `MoltenVK` repository folder, @@ -276,14 +285,15 @@ from the command line. The following `make` targets are provided: - The `all` target executes all platform targets. - The `all` target is the default target. Running `make` with no arguments is the same as running `make all`. - The `*-debug` targets build the binaries using the **_Debug_** configuration. -- The `install` target will copy the most recently built `MoltenVK.xcframework` 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 `install` target will copy the most recently built `Package/Latest/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib` + into the `/usr/local/lib` system directory on your computer. Since `/usr/local/lib` is protected, you will generally + need to run it as `sudo make install` and enter your password. The `install` target does not build **MoltenVK**, + and you need to run `make macos` or `make macos-debug` first. The `make` targets all require that *Xcode* is installed on your system. +_**Note:**_ Due to technical limitations within _Xcode_, a dynamic framework is not created for the _MacCatalyst_ platform. + Building from the command line creates the same `Package` folder structure described above when building from within *Xcode*. @@ -315,7 +325,7 @@ _Vulkan_ API calls as function pointers. -### Accessing _Metal_ Private API calls +### Accessing _Metal_ Private API Calls You can optionally build **MoltenVK** with access to private _Metal_ API calls, also known as "Service Provider Interfaces" (SPIs). Doing so will allow **MoltenVK** to extend its @@ -334,6 +344,31 @@ Functionality added with `MVK_USE_METAL_PRIVATE_API` enabled includes: - `VkGraphicsPipelineRasterizationCreateInfo::sampleMask`, using `MTLRenderPipelineDescriptor.sampleMask` instead of emulating it in the fragment shader + +### Install **MoltenVK** to Replace the _Vulkan SDK_ `libMoltenVK.dylib` + +To replace the version of the **MoltenVK** installed on _macOS_ via the +*[Vulkan SDK](https://vulkan.lunarg.com/sdk/home)* standard install process, +perform the following steps: + +1. Build a _macOS_ version of **MoltenVK**, as described [above](#building). + The default config for command-line **MoltenVK** build has verbose logging info turned on. + If you want **MoltenVK** to log like the original _Vulkan SDK_ install, use this command when building **MoltenVK**: + + ```bash + $ make macos MVK_CONFIG_LOG_LEVEL=1 + ``` + +2. From a command line terminal, execute the following command: + + ```bash + $ sudo make install + ``` + +This will copy your latest _macOS_ build of **MoltenVK** into `/usr/local/lib/libMoltenVK.dylib`, +overwriting the file installed by the _Vulkan SDK_ install process. + + Running **MoltenVK** Demo Applications -------------------------------------- @@ -380,7 +415,7 @@ compliance may fall into one of the following categories: - 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 small amount of capability is provided using this mechanism, such as via an extra render or compute shader stage. diff --git a/Scripts/copy_ext_lib_to_staging.sh b/Scripts/copy_ext_lib_to_staging.sh index 77ec865f..2deea519 100755 --- a/Scripts/copy_ext_lib_to_staging.sh +++ b/Scripts/copy_ext_lib_to_staging.sh @@ -1,4 +1,3 @@ #!/bin/bash -export MVK_XCFWK_STAGING_DIR="${PROJECT_DIR}/External/build/Intermediates/XCFrameworkStaging/${CONFIGURATION}" -. "${SRCROOT}/Scripts/copy_lib_to_staging.sh" +. "${SRCROOT}/Scripts/copy_lib_to_staging.sh" "lib${PRODUCT_NAME}.a" "${PROJECT_DIR}/External/build/Intermediates" diff --git a/Scripts/copy_lib_to_staging.sh b/Scripts/copy_lib_to_staging.sh index ff589671..b27d0fb6 100755 --- a/Scripts/copy_lib_to_staging.sh +++ b/Scripts/copy_lib_to_staging.sh @@ -1,15 +1,17 @@ #!/bin/bash # Copy the static library file to its own directory within the XCFrameworkStaging directory. +# and mark the XCFrameworkStaging directory as changed, to trigger packaging dependencies. # -# Requires the variable MVK_XCFWK_STAGING_DIR. -# -export MVK_PROD_FILENAME="lib${PRODUCT_NAME}.a" -export MVK_BUILT_PROD_FILE="${BUILT_PRODUCTS_DIR}/${MVK_PROD_FILENAME}" +# Takes 2 parameters: +# 1 - prod_file_name +# 2 - xcfwk_dst_dir, destiation directory in which to create XCFramework + +prod_file_name=${1} +xcfwk_dst_dir=${2} +built_prod_file="${BUILT_PRODUCTS_DIR}/${prod_file_name}" +staging_dir="${xcfwk_dst_dir}/XCFrameworkStaging/${CONFIGURATION}/Platform${EFFECTIVE_PLATFORM_NAME}" -staging_dir="${MVK_XCFWK_STAGING_DIR}/Platform${EFFECTIVE_PLATFORM_NAME}" mkdir -p "${staging_dir}" -cp -a "${MVK_BUILT_PROD_FILE}" "${staging_dir}/${MVK_PROD_FILENAME}" - -# Mark the XCFrameworkStaging directory as changed, to trigger packaging dependencies. -touch "${MVK_XCFWK_STAGING_DIR}/.." +cp -a "${built_prod_file}" "${staging_dir}/" +touch "${staging_dir}/.." diff --git a/Scripts/copy_to_staging.sh b/Scripts/copy_to_staging.sh index 17044f40..4aebfcac 100755 --- a/Scripts/copy_to_staging.sh +++ b/Scripts/copy_to_staging.sh @@ -1,4 +1,10 @@ #!/bin/bash -export MVK_XCFWK_STAGING_DIR="${BUILT_PRODUCTS_DIR}/../XCFrameworkStaging/${CONFIGURATION}" -. "${SRCROOT}/../Scripts/copy_lib_to_staging.sh" +# Copy the static library file to its own directory within the XCFrameworkStaging directory. +# and mark the XCFrameworkStaging directory as changed, to trigger packaging dependencies. +# +# Takes 1 parameter: +# 1 - prod_file_name + +prod_file_name=${1} +. "${SRCROOT}/../Scripts/copy_lib_to_staging.sh" ${prod_file_name} "${BUILD_DIR}" diff --git a/Scripts/create_dylib.sh b/Scripts/create_dylib.sh deleted file mode 100755 index 27acd144..00000000 --- a/Scripts/create_dylib.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -# Allow dylib building to be skipped based on bulid setting. -# For example, skipping the build of a dylib for Simulator builds -# because Xcode cannot currently handle creating a Simulator dylib -# containing both x86_64 and arm64 (Apple Silicon) architectures. -if [ "${MVK_SKIP_DYLIB}" == "YES" ]; then - exit 0 -fi - -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 "${MVK_BUILT_PROD_DIR}/dynamic" - -export MVK_EMBED_BITCODE="" -if test x"${ENABLE_BITCODE}" == xYES; then - if test x"${BITCODE_GENERATION_MODE}" == xbitcode; then - MVK_EMBED_BITCODE="-fembed-bitcode" - else - MVK_EMBED_BITCODE="-fembed-bitcode-marker" - fi -fi - -if test x"${ENABLE_THREAD_SANITIZER}" = xYES; then - MVK_SAN="-fsanitize=thread" -elif test x"${ENABLE_ADDRESS_SANITIZER}" = xYES; then - MVK_SAN="-fsanitize=address" -fi -if test x"${ENABLE_UNDEFINED_BEHAVIOR_SANITIZER}" = xYES; then - if test x"$MVK_SAN" = x; then - MVK_SAN="-fsanitize=undefined" - else - MVK_SAN="$MVK_SAN,undefined" - fi -fi - -# Suppress visibility warning spam when linking in Release or Debug mode -# and external libraries built in the other mode. -MVK_LINK_WARN="-Xlinker -w" - -clang++ \ --stdlib=${CLANG_CXX_LIBRARY} \ --dynamiclib \ -$(printf -- "-arch %s " ${ARCHS}) \ -${MVK_CLANG_OS_MIN_VERSION} \ --compatibility_version 1.0.0 -current_version 1.0.0 \ --install_name "@rpath/${MVK_DYLIB_NAME}" \ --Wno-incompatible-sysroot \ -${MVK_EMBED_BITCODE} \ -${MVK_SAN} \ -${MVK_LINK_WARN} \ --isysroot ${SDK_DIR} \ --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 "${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 "${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 deleted file mode 100755 index b3ae4b8d..00000000 --- a/Scripts/create_dylib_ios.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -e - -# We don't support dylib for Mac Catalyst yet -if [ "${IS_MACCATALYST}" == "YES" ]; then - exit 0 -fi - -export MVK_UX_FWK="UIKit" -export MVK_MIN_OS_VERSION=${IPHONEOS_DEPLOYMENT_TARGET} -export MVK_IOSURFACE_FWK="-framework IOSurface" -export MVK_IOKIT_FWK="-framework IOKit" - -# 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="" -fi - -. "${SRCROOT}/../Scripts/create_dylib.sh" diff --git a/Scripts/create_dylib_macos.sh b/Scripts/create_dylib_macos.sh deleted file mode 100755 index 0f72594c..00000000 --- a/Scripts/create_dylib_macos.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -export MVK_UX_FWK="AppKit" -export MVK_MIN_OS_VERSION=${MACOSX_DEPLOYMENT_TARGET} -export MVK_CLANG_OS_MIN_VERSION="-mmacosx-version-min=${MVK_MIN_OS_VERSION}" -export MVK_IOSURFACE_FWK="-framework IOSurface" -export MVK_IOKIT_FWK="-framework IOKit" - -. "${SRCROOT}/../Scripts/create_dylib.sh" diff --git a/Scripts/create_dylib_tvos.sh b/Scripts/create_dylib_tvos.sh deleted file mode 100755 index 27c22352..00000000 --- a/Scripts/create_dylib_tvos.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e - -export MVK_UX_FWK="UIKit" -export MVK_MIN_OS_VERSION=${TVOS_DEPLOYMENT_TARGET} -export MVK_CLANG_OS_MIN_VERSION="-mtvos-version-min=${MVK_MIN_OS_VERSION}" -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_ext_lib_xcframeworks.sh b/Scripts/create_ext_lib_xcframeworks.sh index 9cacc5f0..bddc2332 100755 --- a/Scripts/create_ext_lib_xcframeworks.sh +++ b/Scripts/create_ext_lib_xcframeworks.sh @@ -17,6 +17,6 @@ ln -sfn "${abs_ext_dir}/SPIRV-Cross" "${hdr_dir}/SPIRVCross" ln -sfn "${abs_ext_dir}/glslang/External/spirv-tools/include/spirv-tools" "${hdr_dir}/SPIRVTools" ln -sfn "${abs_ext_dir}/glslang" "${hdr_dir}/glslang" -create_xcframework "SPIRVCross" -create_xcframework "SPIRVTools" -create_xcframework "glslang" +create_xcframework "SPIRVCross" "library" +create_xcframework "SPIRVTools" "library" +create_xcframework "glslang" "library" diff --git a/Scripts/create_xcframework_func.sh b/Scripts/create_xcframework_func.sh index c7b20cff..d8b812aa 100755 --- a/Scripts/create_xcframework_func.sh +++ b/Scripts/create_xcframework_func.sh @@ -2,13 +2,22 @@ # Creates a universal XCFramework for a product from any libraries that can be found for the product. # -# Takes one parameter: +# Takes 2 parameters: # 1 - product_name +# 2 - lib_type (either "library" or "framework") # # Requires the variables MVK_XCFWK_STAGING_DIR and MVK_XCFWK_DEST_DIR. -# + function create_xcframework() { prod_name=${1} + lib_type=${2} + has_content="" + + prod_file="lib${prod_name}.a" + if [[ "${lib_type}" == "framework" ]]; then + prod_file="${prod_name}.framework" + fi + xcfwk_path="${MVK_XCFWK_DEST_DIR}/${prod_name}.xcframework" hdr_path="${MVK_XCFWK_STAGING_DIR}/Headers/${prod_name}" @@ -17,15 +26,19 @@ function create_xcframework() { # For each platform directory in the staging directory, add the library to the # XCFramework if it exists, and for each library, add headers if they exist. for prod_staging_dir in "${MVK_XCFWK_STAGING_DIR}/${CONFIGURATION}"/*; do - prod_lib_path="${prod_staging_dir}/lib${prod_name}.a" + prod_lib_path="${prod_staging_dir}/${prod_file}" if [[ -e "${prod_lib_path}" ]]; then - xcfwk_cmd+=" -library \"${prod_lib_path}\"" + xcfwk_cmd+=" -${lib_type} \"${prod_lib_path}\"" # if [[ -e "${hdr_path}" ]]; then # xcfwk_cmd+=" -headers \"${hdr_path}\"" # Headers currently break build due to Xcode 12 ProcessXCFramework bug: https://developer.apple.com/forums/thread/651043?answerId=628400022#628400022 # fi + has_content="Y" fi done - rm -rf "${xcfwk_path}" - eval "${xcfwk_cmd}" + if [ "$has_content" != "" ]; then + mkdir -p "${MVK_XCFWK_DEST_DIR}" + rm -rf "${xcfwk_path}" + eval "${xcfwk_cmd}" + fi } diff --git a/Scripts/package_moltenvk.sh b/Scripts/package_moltenvk.sh index cce0dfaf..786faee5 100755 --- a/Scripts/package_moltenvk.sh +++ b/Scripts/package_moltenvk.sh @@ -2,27 +2,34 @@ set -e -# Copy dylibs only if the source directory exists. -# Takes two args: source build path OS suffix and destination path OS directory name +# Copy dylibs only if the source file exists. +# +# Takes 2 parameters: +# 1 - source build path OS suffix (aka EFFECTIVE_PLATFORM_NAME during build) +# 2 - destination path OS directory name + function copy_dylib() { - src_dir="${BUILD_DIR}/${CONFIGURATION}${1}/dynamic" - dst_dir="${MVK_PKG_PROD_PATH}/dylib/${2}" + src_dir="${BUILD_DIR}/XCFrameworkStaging/${CONFIGURATION}/Platform${1}/${MVK_PROD_NAME}.framework" + src_file_name="${MVK_PROD_NAME}" + dst_dir="${MVK_PKG_PROD_PATH}/dynamic/dylib/${2}" + dst_file_name="lib${MVK_PROD_NAME}.dylib" # If dylib file exists, copy it, any debug symbol file, and the Vulkan layer JSON file - src_file="${src_dir}/lib${MVK_PROD_NAME}.dylib" + src_file="${src_dir}/${src_file_name}" + if [[ -e "${src_file}" ]]; then rm -rf "${dst_dir}" mkdir -p "${dst_dir}" - cp -a "${src_file}" "${dst_dir}" + cp -p "${src_file}" "${dst_dir}/${dst_file_name}" + install_name_tool -id "@rpath/${dst_file_name}" "${dst_dir}/${dst_file_name}" src_file+=".dSYM" if [[ -e "${src_file}" ]]; then - cp -a "${src_file}" "${dst_dir}" + cp -a "${src_file}" "${dst_dir}/${dst_file_name}.dSYM" fi cp -a "${MVK_PROD_PROJ_PATH}/icd/${MVK_PROD_NAME}_icd.json" "${dst_dir}" - fi } @@ -33,13 +40,14 @@ export MVK_PKG_PROD_PATH="${PROJECT_DIR}/Package/${CONFIGURATION}/${MVK_PROD_NAM # Make sure directory is there in case no dylibs are created for this platform mkdir -p "${MVK_PKG_PROD_PATH}" +# App store distribution does not support naked dylibs, so only include a naked dylib for macOS. copy_dylib "" "macOS" -copy_dylib "-iphoneos" "iOS" -copy_dylib "-iphonesimulator" "iOS-simulator" -copy_dylib "-appletvos" "tvOS" -copy_dylib "-appletvsimulator" "tvOS-simulator" -copy_dylib "-xrvos" "xrOS" -copy_dylib "-xrsimulator" "xrOS-simulator" +#copy_dylib "-iphoneos" "iOS" +#copy_dylib "-iphonesimulator" "iOS-simulator" +#copy_dylib "-appletvos" "tvOS" +#copy_dylib "-appletvsimulator" "tvOS-simulator" +#copy_dylib "-xrvos" "xrOS" +#copy_dylib "-xrsimulator" "xrOS-simulator" # Remove and replace header include folder rm -rf "${MVK_PKG_PROD_PATH}/include" diff --git a/Scripts/package_moltenvk_xcframework.sh b/Scripts/package_moltenvk_xcframework.sh index adbf8833..c9d69c4c 100755 --- a/Scripts/package_moltenvk_xcframework.sh +++ b/Scripts/package_moltenvk_xcframework.sh @@ -4,14 +4,17 @@ set -e . "${PROJECT_DIR}/Scripts/create_xcframework_func.sh" -export MVK_PROD_BASE_NAME="MoltenVK" +export prod_name="MoltenVK" export MVK_XCFWK_STAGING_DIR="${BUILD_DIR}/XCFrameworkStaging" -export MVK_XCFWK_DEST_DIR="${PROJECT_DIR}/Package/${CONFIGURATION}/${MVK_PROD_BASE_NAME}" # Assemble the headers hdr_dir="${MVK_XCFWK_STAGING_DIR}/Headers" mkdir -p "${hdr_dir}" -rm -rf "${hdr_dir}/${MVK_PROD_BASE_NAME}" -cp -pRL "${PROJECT_DIR}/${MVK_PROD_BASE_NAME}/include/${MVK_PROD_BASE_NAME}" "${hdr_dir}" +rm -rf "${hdr_dir}/${prod_name}" +cp -pRL "${PROJECT_DIR}/${prod_name}/include/${prod_name}" "${hdr_dir}" -create_xcframework "MoltenVK" +export MVK_XCFWK_DEST_DIR="${PROJECT_DIR}/Package/${CONFIGURATION}/${prod_name}/static" +create_xcframework "${prod_name}" "library" + +export MVK_XCFWK_DEST_DIR="${PROJECT_DIR}/Package/${CONFIGURATION}/${prod_name}/dynamic" +create_xcframework "${prod_name}" "framework" diff --git a/Scripts/package_shader_converter_xcframework.sh b/Scripts/package_shader_converter_xcframework.sh index 34255157..494cbfe0 100755 --- a/Scripts/package_shader_converter_xcframework.sh +++ b/Scripts/package_shader_converter_xcframework.sh @@ -4,19 +4,19 @@ set -e . "${PROJECT_DIR}/Scripts/create_xcframework_func.sh" -export MVK_PROD_BASE_NAME="MoltenVKShaderConverter" +prod_name="MoltenVKShaderConverter" export MVK_XCFWK_STAGING_DIR="${BUILD_DIR}/XCFrameworkStaging" -export MVK_XCFWK_DEST_DIR="${PROJECT_DIR}/Package/${CONFIGURATION}/${MVK_PROD_BASE_NAME}" +export MVK_XCFWK_DEST_DIR="${PROJECT_DIR}/Package/${CONFIGURATION}/${prod_name}" # Assemble the headers for the shader frameworks hdr_dir="${MVK_XCFWK_STAGING_DIR}/Headers" mkdir -p "${hdr_dir}" -rm -rf "${hdr_dir}/MoltenVKShaderConverter" -cp -pRL "${PROJECT_DIR}/${MVK_PROD_BASE_NAME}/include/MoltenVKShaderConverter" "${hdr_dir}" +rm -rf "${hdr_dir}/${prod_name}" +cp -pRL "${PROJECT_DIR}/${prod_name}/include/${prod_name}" "${hdr_dir}" # Also copy headers to an include directory in the package. # This will not be needed once the XCFramework can be created with a Headers directory. mkdir -p "${MVK_XCFWK_DEST_DIR}" -cp -pRL "${PROJECT_DIR}/${MVK_PROD_BASE_NAME}/include/" "${MVK_XCFWK_DEST_DIR}/include" +cp -pRL "${PROJECT_DIR}/${prod_name}/include/" "${MVK_XCFWK_DEST_DIR}/include" -create_xcframework "MoltenVKShaderConverter" +create_xcframework "${prod_name}" "library"