Skip to content

Commit

Permalink
Support IOSurface on iOS only if IPHONEOS_DEPLOYMENT_TARGET is at lea…
Browse files Browse the repository at this point in the history
…st iOS 11.0.

On iOS, only compile IOSurface support, and link IOSurface framework to
libMoltenVK.dylib, if IPHONEOS_DEPLOYMENT_TARGET is at least iOS 11.0.
Update to latest version of SPIRV-Cross.
Update MoltenVK version to 1.0.15.
  • Loading branch information
billhollings committed Jul 12, 2018
1 parent 166de13 commit 86bb515
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 45 deletions.
4 changes: 2 additions & 2 deletions Common/MVKCommonEnvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern "C" {
# endif // DEBUG
#endif // MVK_DEBUG

/** Building for iOS. Use ifdef instead of defined() operator to allow MVK_IOS to be used in expansions */
/** Building for iOS. Use ifdef instead of defined() operator to allow MVK_IOS to be used in expansions */
#ifndef MVK_IOS
# ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
# define MVK_IOS 1
Expand All @@ -51,7 +51,7 @@ extern "C" {
# endif
#endif

/** Building for macOS. Use ifdef instead of defined() operator to allow MVK_MACOS to be used in expansions */
/** Building for macOS. Use ifdef instead of defined() operator to allow MVK_MACOS to be used in expansions */
#ifndef MVK_MACOS
# ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
# define MVK_MACOS 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
A9096E4F1F7EF10300DFBEA6 /* IOSurface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9096E4E1F7EF10300DFBEA6 /* IOSurface.framework */; };
A95C050B1C98FC1100CC653D /* blue.ppm in Resources */ = {isa = PBXBuildFile; fileRef = A95C05021C98FC1100CC653D /* blue.ppm */; };
A95C050C1C98FC1100CC653D /* blue.ppm in Resources */ = {isa = PBXBuildFile; fileRef = A95C05021C98FC1100CC653D /* blue.ppm */; };
A95C050D1C98FC1100CC653D /* green.ppm in Resources */ = {isa = PBXBuildFile; fileRef = A95C05041C98FC1100CC653D /* green.ppm */; };
Expand Down Expand Up @@ -154,7 +153,6 @@
files = (
A9B5D0A21CF8835500D7CBDD /* MoltenVK.framework in Frameworks */,
A9B5D0A61CF8838E00D7CBDD /* MoltenVKGLSLToSPIRVConverter.framework in Frameworks */,
A9096E4F1F7EF10300DFBEA6 /* IOSurface.framework in Frameworks */,
A9B5D09E1CF8831400D7CBDD /* libc++.tbd in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
A904B5721C9A08C90008C013 /* cube-frag.spv in Resources */ = {isa = PBXBuildFile; fileRef = A904B52E1C9A08C90008C013 /* cube-frag.spv */; };
A904B5751C9A08C90008C013 /* cube-vert.spv in Resources */ = {isa = PBXBuildFile; fileRef = A904B52F1C9A08C90008C013 /* cube-vert.spv */; };
A904B5761C9A08C90008C013 /* cube-vert.spv in Resources */ = {isa = PBXBuildFile; fileRef = A904B52F1C9A08C90008C013 /* cube-vert.spv */; };
A9096E511F7EF11A00DFBEA6 /* IOSurface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9096E501F7EF11A00DFBEA6 /* IOSurface.framework */; };
A91F43A01EDDD46B00733D01 /* libMoltenVK.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A91F439F1EDDD46B00733D01 /* libMoltenVK.dylib */; };
A91F43A51EDDD5CF00733D01 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A91F43A41EDDD5CF00733D01 /* libc++.tbd */; };
A91F43A61EDDD61100733D01 /* libMoltenVK.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = A91F439F1EDDD46B00733D01 /* libMoltenVK.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
Expand Down Expand Up @@ -109,7 +108,6 @@
buildActionMask = 2147483647;
files = (
A91F43A01EDDD46B00733D01 /* libMoltenVK.dylib in Frameworks */,
A9096E511F7EF11A00DFBEA6 /* IOSurface.framework in Frameworks */,
A91F43A51EDDD5CF00733D01 /* libc++.tbd in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
A9096E531F7EF13000DFBEA6 /* IOSurface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9096E521F7EF13000DFBEA6 /* IOSurface.framework */; };
A99789AF1CD3D4E2005E7DAC /* Hologram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A99789831CD3D4E2005E7DAC /* Hologram.cpp */; };
A99789B01CD3D4E2005E7DAC /* Hologram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A99789831CD3D4E2005E7DAC /* Hologram.cpp */; };
A99789B11CD3D4E2005E7DAC /* Hologram.frag in Resources */ = {isa = PBXBuildFile; fileRef = A99789841CD3D4E2005E7DAC /* Hologram.frag */; };
Expand Down Expand Up @@ -130,7 +129,6 @@
files = (
A9F4FB4A1CF688A5003FA0C3 /* MoltenVK.framework in Frameworks */,
A9F4FB4F1CF68C79003FA0C3 /* MoltenVKGLSLToSPIRVConverter.framework in Frameworks */,
A9096E531F7EF13000DFBEA6 /* IOSurface.framework in Frameworks */,
A9F4FB481CF6882E003FA0C3 /* libc++.tbd in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
24 changes: 15 additions & 9 deletions Docs/MoltenVK_Runtime_UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ the *Metal* environment.
found in the **MoltenVK** distribution package.
- If building for *macOS*, add an entry that points to the `MoltenVK/macOS` folder,
found in the **MoltenVK** distribution package.

3. On the *Build Phases* tab, open the *Link Binary With Libraries* list.

3. If using `IOSurfaces` on *iOS*, in the *Build Settings* tab, open the **iOS Deployment Target**
(aka `IPHONEOS_DEPLOYMENT_TARGET`) setting, and ensure it is set to a value of `iOS 11.0` or greater.

4. On the *Build Phases* tab, open the *Link Binary With Libraries* list.

1. Drag the `MoltenVK/iOS/MoltenVK.framework` or `MoltenVK/macOS/MoltenVK.framework` folder,
found in the **MoltenVK** distribution package, to the *Link Binary With Libraries* list.
Expand All @@ -122,13 +125,13 @@ the *Metal* environment.
**Enable Modules (C and Objective-C** (aka `CLANG_ENABLE_MODULES`) settings enabled, click the
**+** button, and (selecting from the list of system frameworks) add the following frameworks:
- `Metal.framework`
- `IOSurface.framework`
- `Foundation.framework`.
- `QuartzCore.framework`
- `IOKit.framework` (*macOS*)
- `UIKit.framework` (*iOS*)
- `Foundation.framework`.
- `IOSurface.framework` (*macOS*, or *iOS* if `IPHONEOS_DEPLOYMENT_TARGET` is at least `iOS 11.0`)

4. When a *Metal* app is running from *Xcode*, the default ***Scheme*** settings reduce
5. When a *Metal* app is running from *Xcode*, the default ***Scheme*** settings reduce
performance. To improve performance and gain the benefits of *Metal*, perform the
following in *Xcode*:

Expand Down Expand Up @@ -172,7 +175,10 @@ follow these instructions:
either `@executable_path` or `@loader_path`. The `libMoltenVK.dylib` library is internally
configured to be located at `@rpath/libMoltenVK.dylib`.

3. On the *Build Phases* tab, open the *Link Binary With Libraries* list.
3. If using `IOSurfaces` on *iOS*, in the *Build Settings* tab, open the **iOS Deployment Target**
(aka `IPHONEOS_DEPLOYMENT_TARGET`) setting, and ensure it is set to a value of `iOS 11.0` or greater.

4. On the *Build Phases* tab, open the *Link Binary With Libraries* list.

1. Drag the `MoltenVK/iOS/libMoltenVK.dylib` or `MoltenVK/macOS/libMoltenVK.dylib` file,
found in the **MoltenVK** distribution package, to the *Link Binary With Libraries* list.
Expand All @@ -181,13 +187,13 @@ follow these instructions:
**Enable Modules (C and Objective-C** (aka `CLANG_ENABLE_MODULES`) settings enabled, click the
**+** button, and (selecting from the list of system frameworks) add the following frameworks:
- `Metal.framework`
- `IOSurface.framework`
- `Foundation.framework`.
- `QuartzCore.framework`
- `IOKit.framework` (*macOS*)
- `UIKit.framework` (*iOS*)
- `Foundation.framework`.
- `IOSurface.framework` (*macOS*, or *iOS* if `IPHONEOS_DEPLOYMENT_TARGET` is at least `iOS 11.0`)

4. Arrange to install the `libMoltenVK.dylib` file in your application environment:
5. Arrange to install the `libMoltenVK.dylib` file in your application environment:

- 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.
Expand Down
2 changes: 1 addition & 1 deletion ExternalRevisions/SPIRV-Cross_repo_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a6814a405abe81545bd3b0a50d374735001173c1
be7425ef70231ab82930331959ab487d605d0482
16 changes: 8 additions & 8 deletions MoltenVK/MoltenVK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\nexport MVK_PROD_NAME=\"MoltenVK\"\nexport MVK_DYLIB_NAME=\"lib${MVK_PROD_NAME}.dylib\"\nexport MVK_BUILT_PROD_PATH=\"${BUILT_PRODUCTS_DIR}\"\nexport MVK_SYS_FWK_DIR=\"${SDK_DIR}/System/Library/Frameworks\"\nexport MVK_USR_LIB_DIR=\"${SDK_DIR}/usr/lib\"\n\nclang \\\n-dynamiclib \\\n-arch x86_64 \\\n-mmacosx-version-min=10.11 \\\n-compatibility_version 1.0.0 -current_version 1.0.0 \\\n-install_name \"@rpath/${MVK_DYLIB_NAME}\" \\\n-Wno-incompatible-sysroot \\\n-isysroot ${SDK_DIR} \\\n-iframework ${MVK_SYS_FWK_DIR} \\\n-framework Metal -framework IOSurface -framework IOKit -framework QuartzCore -framework Foundation \\\n--library-directory ${MVK_USR_LIB_DIR} \\\n-lSystem -lc++ \\\n-o \"${MVK_BUILT_PROD_PATH}/${MVK_DYLIB_NAME}\" \\\n-force_load \"${MVK_BUILT_PROD_PATH}/${MVK_PROD_NAME}.framework/${MVK_PROD_NAME}\"\n";
shellScript = "set -e\n\nexport MVK_PROD_NAME=\"MoltenVK\"\nexport MVK_DYLIB_NAME=\"lib${MVK_PROD_NAME}.dylib\"\nexport MVK_BUILT_PROD_PATH=\"${BUILT_PRODUCTS_DIR}\"\nexport MVK_SYS_FWK_DIR=\"${SDK_DIR}/System/Library/Frameworks\"\nexport MVK_USR_LIB_DIR=\"${SDK_DIR}/usr/lib\"\n\nclang \\\n-dynamiclib \\\n-arch x86_64 \\\n-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET} \\\n-compatibility_version 1.0.0 -current_version 1.0.0 \\\n-install_name \"@rpath/${MVK_DYLIB_NAME}\" \\\n-Wno-incompatible-sysroot \\\n-isysroot ${SDK_DIR} \\\n-iframework ${MVK_SYS_FWK_DIR} \\\n-framework Metal -framework IOSurface -framework IOKit -framework QuartzCore -framework Foundation \\\n--library-directory ${MVK_USR_LIB_DIR} \\\n-lSystem -lc++ \\\n-o \"${MVK_BUILT_PROD_PATH}/${MVK_DYLIB_NAME}\" \\\n-force_load \"${MVK_BUILT_PROD_PATH}/${MVK_PROD_NAME}.framework/${MVK_PROD_NAME}\"\n";
};
A9731FAD1EDDAE39006B7298 /* Create Dynamic Library */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -820,7 +820,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\nexport MVK_PROD_NAME=\"MoltenVK\"\nexport MVK_DYLIB_NAME=\"lib${MVK_PROD_NAME}.dylib\"\nexport MVK_BUILT_PROD_PATH=\"${BUILT_PRODUCTS_DIR}\"\nexport MVK_SYS_FWK_DIR=\"${SDK_DIR}/System/Library/Frameworks\"\nexport MVK_USR_LIB_DIR=\"${SDK_DIR}/usr/lib\"\n\nclang \\\n-dynamiclib \\\n-arch arm64 \\\n-mios-version-min=9.0 \\\n-compatibility_version 1.0.0 -current_version 1.0.0 \\\n-install_name \"@rpath/${MVK_DYLIB_NAME}\" \\\n-Wno-incompatible-sysroot \\\n-isysroot ${SDK_DIR} \\\n-iframework ${MVK_SYS_FWK_DIR} \\\n-framework Metal -framework UIKit -framework QuartzCore -framework Foundation \\\n--library-directory ${MVK_USR_LIB_DIR} \\\n-lSystem -lc++ \\\n-o \"${MVK_BUILT_PROD_PATH}/${MVK_DYLIB_NAME}\" \\\n-force_load \"${MVK_BUILT_PROD_PATH}/${MVK_PROD_NAME}.framework/${MVK_PROD_NAME}\"\n";
shellScript = "set -e\n\nexport MVK_PROD_NAME=\"MoltenVK\"\nexport MVK_DYLIB_NAME=\"lib${MVK_PROD_NAME}.dylib\"\nexport MVK_BUILT_PROD_PATH=\"${BUILT_PRODUCTS_DIR}\"\nexport MVK_SYS_FWK_DIR=\"${SDK_DIR}/System/Library/Frameworks\"\nexport MVK_USR_LIB_DIR=\"${SDK_DIR}/usr/lib\"\n\n# Do not link to IOSurface if deploying to iOS versions below 11.0, doing so will\n# link IOSurface as a private framework, which will trigger App Store rejection.\nif [ $(echo \"${IPHONEOS_DEPLOYMENT_TARGET} >= 11.0\" | bc) -eq 1 ]\nthen\n export MVK_IOSURFACE_FWK=\"-framework IOSurface\"\nelse\n export MVK_IOSURFACE_FWK=\"\"\nfi\n\nclang \\\n-dynamiclib \\\n-arch arm64 \\\n-mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET} \\\n-compatibility_version 1.0.0 -current_version 1.0.0 \\\n-install_name \"@rpath/${MVK_DYLIB_NAME}\" \\\n-Wno-incompatible-sysroot \\\n-isysroot ${SDK_DIR} \\\n-iframework ${MVK_SYS_FWK_DIR} \\\n-framework Metal ${MVK_IOSURFACE_FWK} -framework UIKit -framework QuartzCore -framework Foundation \\\n--library-directory ${MVK_USR_LIB_DIR} \\\n-lSystem -lc++ \\\n-o \"${MVK_BUILT_PROD_PATH}/${MVK_DYLIB_NAME}\" \\\n-force_load \"${MVK_BUILT_PROD_PATH}/${MVK_PROD_NAME}.framework/${MVK_PROD_NAME}\"\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -940,22 +940,27 @@
A9B8EE1E1A98D796009C5A02 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = arm64;
};
name = Debug;
};
A9B8EE1F1A98D796009C5A02 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = arm64;
};
name = Release;
};
A9CBEDFF1B6299D800E45FDC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
MACOSX_DEPLOYMENT_TARGET = 10.11;
SDKROOT = macosx;
VALID_ARCHS = x86_64;
};
Expand All @@ -964,6 +969,7 @@
A9CBEE001B6299D800E45FDC /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
MACOSX_DEPLOYMENT_TARGET = 10.11;
SDKROOT = macosx;
VALID_ARCHS = x86_64;
};
Expand Down Expand Up @@ -1019,14 +1025,11 @@
"\"$(SRCROOT)/../MoltenVKShaderConverter\"",
"\"$(SRCROOT)/../External/cereal/include\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = MoltenVK;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
Expand Down Expand Up @@ -1077,13 +1080,10 @@
"\"$(SRCROOT)/../MoltenVKShaderConverter\"",
"\"$(SRCROOT)/../External/cereal/include\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = MoltenVK;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down
10 changes: 9 additions & 1 deletion MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern "C" {
*/
#define MVK_VERSION_MAJOR 1
#define MVK_VERSION_MINOR 0
#define MVK_VERSION_PATCH 14
#define MVK_VERSION_PATCH 15

#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)
Expand Down Expand Up @@ -275,6 +275,14 @@ VKAPI_ATTR void VKAPI_CALL vkGetMTLTextureMVK(
*
* If a MTLTexture has already been created for this image, it will be destroyed.
*
* IOSurfaces are supported on the following platforms:
* - macOS 10.11 and above
* - iOS 11.0 and above
*
* To enable IOSurface support, ensure the Deployment Target build setting
* (MACOSX_DEPLOYMENT_TARGET or IPHONEOS_DEPLOYMENT_TARGET) is set to at least
* one of the values above when compiling MoltenVK, and any app that uses MoltenVK.
*
* Returns:
* - VK_SUCCESS.
* - VK_ERROR_FEATURE_NOT_PRESENT if IOSurfaces are not supported on the platform.
Expand Down
18 changes: 2 additions & 16 deletions MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,6 @@
# define MVKViewClass NSView
#endif

// To present surface using a command buffer, define the MVK_PRESENT_WITHOUT_COMMAND_BUFFER build setting.
#ifdef MVK_PRESENT_WITHOUT_COMMAND_BUFFER
# define MVK_PRESENT_WITH_COMMAND_BUFFER_BOOL 0
#else
# define MVK_PRESENT_WITH_COMMAND_BUFFER_BOOL 1
#endif

// To display the MoltenVK logo watermark by default, define the MVK_DISPLAY_WATERMARK build setting.
#ifdef MVK_DISPLAY_WATERMARK
# define MVK_DISPLAY_WATERMARK_BOOL 1
#else
# define MVK_DISPLAY_WATERMARK_BOOL 0
#endif


#pragma mark -
#pragma mark MVKPhysicalDevice
Expand Down Expand Up @@ -322,14 +308,15 @@
_metalFeatures.maxPerStageSamplerCount = 16;
_metalFeatures.maxQueryBufferSize = (64 * KIBI);

_metalFeatures.ioSurfaces = MVK_SUPPORT_IOSURFACE_BOOL;

#if MVK_IOS
_metalFeatures.mslVersion = SPIRVToMSLConverterOptions::makeMSLVersion(1);
_metalFeatures.maxPerStageTextureCount = 31;
_metalFeatures.mtlBufferAlignment = 64;
_metalFeatures.mtlCopyBufferAlignment = 1;
_metalFeatures.texelBuffers = true;
_metalFeatures.maxTextureDimension = (4 * KIBI);
_metalFeatures.ioSurfaces = false;

if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_iOS_GPUFamily1_v2] ) {
_metalFeatures.mslVersion = SPIRVToMSLConverterOptions::makeMSLVersion(1, 1);
Expand Down Expand Up @@ -362,7 +349,6 @@
_metalFeatures.mtlCopyBufferAlignment = 4;
_metalFeatures.indirectDrawing = true;
_metalFeatures.baseVertexInstanceDrawing = true;
_metalFeatures.ioSurfaces = true;
_metalFeatures.depthClipMode = true;
_metalFeatures.maxTextureDimension = (16 * KIBI);

Expand Down
4 changes: 2 additions & 2 deletions MoltenVK/MoltenVK/GPUObjects/MVKImage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@

if (!_device->_pMetalFeatures->ioSurfaces) { return mvkNotifyErrorWithText(VK_ERROR_FEATURE_NOT_PRESENT, "vkUseIOSurfaceMVK() : IOSurfaces are not supported on this platform."); }

#if !MVK_IOS
#if MVK_SUPPORT_IOSURFACE_BOOL

resetMTLTexture();
resetIOSurface();
Expand Down Expand Up @@ -334,7 +334,7 @@
}

#endif

return VK_SUCCESS;
}

Expand Down
29 changes: 29 additions & 0 deletions MoltenVK/MoltenVK/Utility/MVKEnvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,32 @@
VK_VERSION_MINOR(api_ver), \
0)

/** To present surface using a command buffer, define the MVK_PRESENT_WITHOUT_COMMAND_BUFFER build setting. */
#ifdef MVK_PRESENT_WITHOUT_COMMAND_BUFFER
# define MVK_PRESENT_WITH_COMMAND_BUFFER_BOOL 0
#else
# define MVK_PRESENT_WITH_COMMAND_BUFFER_BOOL 1
#endif

/** To display the MoltenVK logo watermark by default, define the MVK_DISPLAY_WATERMARK build setting. */
#ifdef MVK_DISPLAY_WATERMARK
# define MVK_DISPLAY_WATERMARK_BOOL 1
#else
# define MVK_DISPLAY_WATERMARK_BOOL 0
#endif


/**
* IOSurfaces are supported on macOS, and on iOS starting with iOS 11.
*
* To enable IOSurface support on iOS in MoltenVK, set the iOS Deployment Target
* (IPHONEOS_DEPLOYMENT_TARGET) build setting to 11.0 or greater when building
* MoltenVK, and any app that uses IOSurfaces.
*/
#if MVK_MACOS
# define MVK_SUPPORT_IOSURFACE_BOOL 1
#endif

#if MVK_IOS
# define MVK_SUPPORT_IOSURFACE_BOOL (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_11_0)
#endif
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ Once built, **MoltenVK** can be run on *iOS* or *macOS* devices that support *Me
- Information on compatible *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).

>***Note:*** To support `IOSurfaces` on *iOS*, **MoltenVK**, and any app that uses **MoltenVK**,
must be built with a minimum **iOS Deployment Target** (aka `IPHONEOS_DEPLOYMENT_TARGET `) build
setting of `iOS 11.0` or greater.

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.
Expand Down

0 comments on commit 86bb515

Please sign in to comment.