Support Metal 3.0.
Merge Metal-3.0 branch into master branch.
Update What's New document with merged features.
diff --git a/Common/MVKLogging.h b/Common/MVKLogging.h
index ddf2933..51e4ade 100644
--- a/Common/MVKLogging.h
+++ b/Common/MVKLogging.h
@@ -189,6 +189,9 @@
# define MVK_DEBUGGER() { kill( getpid(), SIGINT ) ; }
#endif
+// Log the size of a type, struct, or class
+#define MVKLogSizeOf(T) printf("sizeof(%s): %lu.\n", #T, sizeof(T))
+
#ifdef __cplusplus
}
diff --git a/Common/MVKOSExtensions.mm b/Common/MVKOSExtensions.mm
index 0922bc2..d195cb7 100644
--- a/Common/MVKOSExtensions.mm
+++ b/Common/MVKOSExtensions.mm
@@ -79,7 +79,7 @@
string mvkGetEnvVar(string varName, bool* pWasFound) {
@autoreleasepool {
- NSDictionary*nsEnv = [[NSProcessInfo processInfo] environment];
+ NSDictionary* nsEnv = [[NSProcessInfo processInfo] environment];
NSString* envStr = nsEnv[@(varName.c_str())];
if (pWasFound) { *pWasFound = envStr != nil; }
return envStr ? envStr.UTF8String : "";
diff --git a/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/project.pbxproj b/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/project.pbxproj
index f9061f2..26b8d52 100644
--- a/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/project.pbxproj
+++ b/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/project.pbxproj
@@ -545,7 +545,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1100;
+ LastUpgradeCheck = 1110;
TargetAttributes = {
A977BCBD1B66BB010067E5BF = {
DevelopmentTeam = VU3TCKU48B;
diff --git a/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/xcshareddata/xcschemes/API-Samples-iOS.xcscheme b/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/xcshareddata/xcschemes/API-Samples-iOS.xcscheme
index 45f8223..0c65fe4 100644
--- a/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/xcshareddata/xcschemes/API-Samples-iOS.xcscheme
+++ b/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/xcshareddata/xcschemes/API-Samples-iOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/xcshareddata/xcschemes/API-Samples-macOS.xcscheme b/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/xcshareddata/xcschemes/API-Samples-macOS.xcscheme
index 4725475..1b2e9b2 100644
--- a/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/xcshareddata/xcschemes/API-Samples-macOS.xcscheme
+++ b/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/xcshareddata/xcschemes/API-Samples-macOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/project.pbxproj b/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/project.pbxproj
index 7e27753..940a572 100644
--- a/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/project.pbxproj
+++ b/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/project.pbxproj
@@ -30,7 +30,7 @@
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
- dstSubfolderSpec = 6;
+ dstSubfolderSpec = 10;
files = (
A9C2ABB02185098A00DDBC03 /* libMoltenVK.dylib in CopyFiles */,
);
@@ -40,7 +40,7 @@
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
- dstSubfolderSpec = 6;
+ dstSubfolderSpec = 10;
files = (
A9C2ABB12185099500DDBC03 /* libMoltenVK.dylib in CopyFiles */,
);
@@ -234,7 +234,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1100;
+ LastUpgradeCheck = 1110;
TargetAttributes = {
A9B53B0F1C3AC0BE00ABC6F6 = {
DevelopmentTeam = VU3TCKU48B;
@@ -320,7 +320,7 @@
MVK_SAMP_CUBE,
);
INFOPLIST_FILE = "$(SRCROOT)/macOS/Info.plist";
- LD_RUNPATH_SEARCH_PATHS = "@executable_path";
+ LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/macOS/dynamic\"";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_NAME = Cube;
@@ -339,7 +339,7 @@
MVK_SAMP_CUBE,
);
INFOPLIST_FILE = "$(SRCROOT)/macOS/Info.plist";
- LD_RUNPATH_SEARCH_PATHS = "@executable_path";
+ LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/macOS/dynamic\"";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_NAME = Cube;
@@ -359,7 +359,7 @@
);
INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
- LD_RUNPATH_SEARCH_PATHS = "@executable_path";
+ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/iOS/dynamic\"";
PRODUCT_NAME = Cube;
SDKROOT = iphoneos;
@@ -380,7 +380,7 @@
);
INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
- LD_RUNPATH_SEARCH_PATHS = "@executable_path";
+ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/iOS/dynamic\"";
PRODUCT_NAME = Cube;
SDKROOT = iphoneos;
diff --git a/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/xcshareddata/xcschemes/Cube-iOS.xcscheme b/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/xcshareddata/xcschemes/Cube-iOS.xcscheme
index a22239d..f456808 100644
--- a/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/xcshareddata/xcschemes/Cube-iOS.xcscheme
+++ b/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/xcshareddata/xcschemes/Cube-iOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/xcshareddata/xcschemes/Cube-macOS.xcscheme b/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/xcshareddata/xcschemes/Cube-macOS.xcscheme
index f69ee36..c80cb45 100644
--- a/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/xcshareddata/xcschemes/Cube-macOS.xcscheme
+++ b/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/xcshareddata/xcschemes/Cube-macOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/project.pbxproj b/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/project.pbxproj
index 4f55c8c..cefd96d 100644
--- a/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/project.pbxproj
+++ b/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/project.pbxproj
@@ -265,7 +265,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1100;
+ LastUpgradeCheck = 1110;
TargetAttributes = {
A977BCBD1B66BB010067E5BF = {
DevelopmentTeam = VU3TCKU48B;
diff --git a/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/xcshareddata/xcschemes/Hologram-iOS.xcscheme b/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/xcshareddata/xcschemes/Hologram-iOS.xcscheme
index 85189b8..7c62036 100644
--- a/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/xcshareddata/xcschemes/Hologram-iOS.xcscheme
+++ b/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/xcshareddata/xcschemes/Hologram-iOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/xcshareddata/xcschemes/Hologram-macOS.xcscheme b/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/xcshareddata/xcschemes/Hologram-macOS.xcscheme
index b0ebf7d..9964944 100644
--- a/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/xcshareddata/xcschemes/Hologram-macOS.xcscheme
+++ b/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/xcshareddata/xcschemes/Hologram-macOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Docs/MoltenVK_Runtime_UserGuide.md b/Docs/MoltenVK_Runtime_UserGuide.md
index 9bd6595..07b0b9d 100644
--- a/Docs/MoltenVK_Runtime_UserGuide.md
+++ b/Docs/MoltenVK_Runtime_UserGuide.md
@@ -106,6 +106,11 @@
*static library*, or *dynamic library*, by following the steps in this section. If you are unsure
about which linking and deployment option you need, follow the steps for installing a
*static framework*, as it is the simplest to install.
+
+>**_Note:_** Distributing an app containing a dynamic library via the *iOS App Store* can require
+specialized bundling. Unless you have specific needs for dynamic libraries, the recommended
+approach on *iOS* is to link **MoltenVK** to your app as a static library.
+
1. Open your application in *Xcode* and select your application's target in the
*Project Navigator* panel.
@@ -124,6 +129,7 @@
add an entry that points to **_one_** of the following folders:
- `MoltenVK/macOS/static` *(macOS)*
- `MoltenVK/iOS/static` *(iOS)*
+
2. In the **Header Search Paths** (aka `HEADER_SEARCH_PATHS`) setting,
add an entry that points to the `MoltenVK/include` folder.
@@ -132,12 +138,17 @@
add an entry that points to **_one_** of the following folders:
- `MoltenVK/macOS/dynamic` *(macOS)*
- `MoltenVK/iOS/dynamic` *(iOS)*
+
2. In the **Header Search Paths** (aka `HEADER_SEARCH_PATHS`) setting,
add an entry that points to the `MoltenVK/include` folder.
3. 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 value to either `@executable_path` or `@loader_path`.
+ you would typically set this value to either:
+
+ - `@executable_path/../Frameworks` *(macOS)*
+ - `@executable_path/Frameworks` *(iOS)*
+
The `libMoltenVK.dylib` library is internally configured to be located at
`@rpath/libMoltenVK.dylib`.
@@ -168,14 +179,17 @@
- `UIKit.framework` (*iOS*)
- `IOSurface.framework` (*macOS*, or *iOS* if `IPHONEOS_DEPLOYMENT_TARGET` is at least `iOS 11.0`)
-
6. If installing **MoltenVK** as a *dynamic library* in your application, 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.
+
2. Set the *Destination* into which you want to place the `libMoltenVK.dylib` file.
- Typically this will be *Executables*.
+ Typically this will be *Frameworks* (and should match the **Runpath Search Paths**
+ (aka `LD_RUNPATH_SEARCH_PATHS`) build setting you set above).
+
3. Drag **_one_** of the following files to the *Copy Files* list in this new build phase:
- `MoltenVK/macOS/dynamic/libMoltenVK.dylib` *(macOS)*
- `MoltenVK/iOS/dynamic/libMoltenVK.dylib` *(iOS)*
diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md
index 87a421c..faf9ea1 100644
--- a/Docs/Whats_New.md
+++ b/Docs/Whats_New.md
@@ -13,6 +13,34 @@
+
+MoltenVK 1.0.38
+---------------
+
+Released 2019/10/31
+
+- Add support for Metal 3.0 capabilities.
+- Add support for extensions:
+ - `VK_EXT_swapchain_colorspace` (*iOS*, already supported on *macOS*).
+ - `VK_EXT_hdr_metadata` (*macOS*)
+- Use native texture swizzling when available.
+- Use placement `MTLHeaps` for `VkDeviceMemory` when possible.
+- Report heap sizes accurately when possible.
+- Add support for additional colorspace options.
+- Add support for the `VkPhysicalDeviceFeatures::shaderResourceMinLod` feature.
+- Add support for compressed 3D images on *macOS*.
+- Update `MoltenVK_Runtime_UserGuide.md` about embedding `libMoltenVK.dylib` in an application.
+- Clarify static linking as the recommended linking approach for *iOS* app store distribution.
+- Add request for feedback from people who reject **MoltenVK** to `README.md` document.
+- Allow `MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS` build setting to be overridden.
+- Fix memory leaks of system classes during `VkInstance` and `VkQueue` creation.
+- Fix memory leaks when compiling shaders and pipelines without default OS autorelease pool.
+- Reduce memory usage by adjusting default memory allocs for many `MVKVectorInline` uses and
+ replacing use of `MVKVectorDefault` with `std::vector` in descriptor set bindings.
+
+
+
+
MoltenVK 1.0.37
---------------
@@ -95,7 +123,7 @@
- `VK_EXT_post_depth_coverage`
- `VK_EXT_scalar_block_layout`
- `VK_EXT_shader_stencil_export`
- - `VK_EXT_swapchain_colorspace`
+ - `VK_EXT_swapchain_colorspace` (*macOS*)
- `VK_EXT_texel_buffer_alignment`
- `VK_AMD_shader_image_load_store_lod`
- `VK_AMD_shader_trinary_minmax`
diff --git a/ExternalDependencies.xcodeproj/project.pbxproj b/ExternalDependencies.xcodeproj/project.pbxproj
index 3f8af4b..38d8409 100644
--- a/ExternalDependencies.xcodeproj/project.pbxproj
+++ b/ExternalDependencies.xcodeproj/project.pbxproj
@@ -2976,7 +2976,7 @@
A9F55D25198BE6A7004EC31B /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1020;
+ LastUpgradeCheck = 1100;
ORGANIZATIONNAME = "The Brenwill Workshop Ltd.";
TargetAttributes = {
A972A7E421CEC72F0013AB25 = {
diff --git "a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies \050Debug\051.xcscheme" "b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies \050Debug\051.xcscheme"
index 5cd87df..3d422f5 100644
--- "a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies \050Debug\051.xcscheme"
+++ "b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies \050Debug\051.xcscheme"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1020"
+ LastUpgradeVersion = "1100"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
- <AdditionalOptions>
- </AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -56,8 +54,6 @@
ReferencedContainer = "container:ExternalDependencies.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <AdditionalOptions>
- </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
diff --git a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies-iOS.xcscheme b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies-iOS.xcscheme
index a295522..7a454af 100644
--- a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies-iOS.xcscheme
+++ b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies-iOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1020"
+ LastUpgradeVersion = "1100"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
- <AdditionalOptions>
- </AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
@@ -56,8 +54,6 @@
ReferencedContainer = "container:ExternalDependencies.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <AdditionalOptions>
- </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
diff --git a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies-macOS.xcscheme b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies-macOS.xcscheme
index 520e255..e74ca3a 100644
--- a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies-macOS.xcscheme
+++ b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies-macOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1020"
+ LastUpgradeVersion = "1100"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
- <AdditionalOptions>
- </AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
@@ -56,8 +54,6 @@
ReferencedContainer = "container:ExternalDependencies.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <AdditionalOptions>
- </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
diff --git a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies.xcscheme b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies.xcscheme
index 62c42e0..079b27f 100644
--- a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies.xcscheme
+++ b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/ExternalDependencies.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1020"
+ LastUpgradeVersion = "1100"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
- <AdditionalOptions>
- </AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
@@ -56,8 +54,6 @@
ReferencedContainer = "container:ExternalDependencies.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <AdditionalOptions>
- </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
diff --git a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Cross-iOS.xcscheme b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Cross-iOS.xcscheme
index ab274f6..7a3d597 100644
--- a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Cross-iOS.xcscheme
+++ b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Cross-iOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1020"
+ LastUpgradeVersion = "1100"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
- <AdditionalOptions>
- </AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
@@ -56,8 +54,6 @@
ReferencedContainer = "container:ExternalDependencies.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <AdditionalOptions>
- </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
diff --git a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Cross-macOS.xcscheme b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Cross-macOS.xcscheme
index 86868af..251a517 100644
--- a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Cross-macOS.xcscheme
+++ b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Cross-macOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1020"
+ LastUpgradeVersion = "1100"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
- <AdditionalOptions>
- </AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
@@ -56,8 +54,6 @@
ReferencedContainer = "container:ExternalDependencies.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <AdditionalOptions>
- </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
diff --git a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Tools-iOS.xcscheme b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Tools-iOS.xcscheme
index 383fd0a..3851e6e 100644
--- a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Tools-iOS.xcscheme
+++ b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Tools-iOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1020"
+ LastUpgradeVersion = "1100"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
- <AdditionalOptions>
- </AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
@@ -56,8 +54,6 @@
ReferencedContainer = "container:ExternalDependencies.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <AdditionalOptions>
- </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
diff --git a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Tools-macOS.xcscheme b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Tools-macOS.xcscheme
index f0d5117..05f1f63 100644
--- a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Tools-macOS.xcscheme
+++ b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/SPIRV-Tools-macOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1020"
+ LastUpgradeVersion = "1100"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
- <AdditionalOptions>
- </AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
@@ -56,8 +54,6 @@
ReferencedContainer = "container:ExternalDependencies.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <AdditionalOptions>
- </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
diff --git a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/glslang-iOS.xcscheme b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/glslang-iOS.xcscheme
index 59b3803..41cbb39 100644
--- a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/glslang-iOS.xcscheme
+++ b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/glslang-iOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1020"
+ LastUpgradeVersion = "1100"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
- <AdditionalOptions>
- </AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
@@ -56,8 +54,6 @@
ReferencedContainer = "container:ExternalDependencies.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <AdditionalOptions>
- </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
diff --git a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/glslang-macOS.xcscheme b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/glslang-macOS.xcscheme
index f421c7e..3bf3607 100644
--- a/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/glslang-macOS.xcscheme
+++ b/ExternalDependencies.xcodeproj/xcshareddata/xcschemes/glslang-macOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1020"
+ LastUpgradeVersion = "1100"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
- <AdditionalOptions>
- </AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -56,8 +54,6 @@
ReferencedContainer = "container:ExternalDependencies.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <AdditionalOptions>
- </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
diff --git a/MoltenVK/MoltenVK.xcodeproj/project.pbxproj b/MoltenVK/MoltenVK.xcodeproj/project.pbxproj
index 560dc69..db7c8d3 100644
--- a/MoltenVK/MoltenVK.xcodeproj/project.pbxproj
+++ b/MoltenVK/MoltenVK.xcodeproj/project.pbxproj
@@ -830,7 +830,7 @@
A9F55D25198BE6A7004EC31B /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1100;
+ LastUpgradeCheck = 1110;
ORGANIZATIONNAME = "The Brenwill Workshop Ltd.";
TargetAttributes = {
A9B8EE091A98D796009C5A02 = {
diff --git a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-iOS.xcscheme b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-iOS.xcscheme
index a562221..7776cbb 100644
--- a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-iOS.xcscheme
+++ b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-iOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-macOS.xcscheme b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-macOS.xcscheme
index aef2431..2f55f9f 100644
--- a/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-macOS.xcscheme
+++ b/MoltenVK/MoltenVK.xcodeproj/xcshareddata/xcschemes/MoltenVK-macOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h b/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h
index 4d0699d..4ec230f 100644
--- a/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h
+++ b/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h
@@ -50,7 +50,7 @@
*/
#define MVK_VERSION_MAJOR 1
#define MVK_VERSION_MINOR 0
-#define MVK_VERSION_PATCH 37
+#define MVK_VERSION_PATCH 38
#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)
@@ -110,6 +110,7 @@
* 2: Log the name of each Vulkan call when the call is entered and exited. This effectively
* brackets any other logging activity within the scope of the Vulkan call.
* 3: Same as option 2, plus logs the time spent inside the Vulkan function.
+ * If none of these is set, no Vulkan call logging will occur.
*
* 3. Setting the MVK_CONFIG_FORCE_LOW_POWER_GPU runtime environment variable or MoltenVK compile-time
* build setting to 1 will force MoltenVK to use a low-power GPU, if one is availble on the device.
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.h b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.h
index 9b80795..9f03ef4 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.h
@@ -24,6 +24,7 @@
#include <MoltenVKSPIRVToMSLConverter/SPIRVToMSLConverter.h>
#include <unordered_set>
#include <unordered_map>
+#include <vector>
class MVKDescriptorPool;
class MVKDescriptorBinding;
@@ -117,7 +118,7 @@
MVKDescriptorSetLayout* _layout;
VkDescriptorSetLayoutBinding _info;
- MVKVectorInline<MVKSampler*, 16> _immutableSamplers;
+ std::vector<MVKSampler*> _immutableSamplers;
MVKShaderResourceBinding _mtlResourceIndexOffsets;
bool _applyToStage[kMVKShaderStageMax];
};
@@ -181,7 +182,7 @@
void addDescriptorPool(MVKDescriptorPool* mvkDescPool) { _descriptorPools.insert(mvkDescPool); }
void removeDescriptorPool(MVKDescriptorPool* mvkDescPool) { _descriptorPools.erase(mvkDescPool); }
- MVKVectorInline<MVKDescriptorSetLayoutBinding, 8> _bindings;
+ MVKVectorInline<MVKDescriptorSetLayoutBinding, 1> _bindings;
std::unordered_map<uint32_t, uint32_t> _bindingToIndex;
MVKShaderResourceBinding _mtlResourceCounts;
std::unordered_set<MVKDescriptorPool*> _descriptorPools;
@@ -271,13 +272,13 @@
MVKDescriptorSet* _pDescSet;
MVKDescriptorSetLayoutBinding* _pBindingLayout;
- MVKVectorInline<VkDescriptorImageInfo, 1> _imageBindings;
- MVKVectorInline<VkDescriptorBufferInfo, 1> _bufferBindings;
- MVKVectorInline<VkBufferView, 1> _texelBufferBindings;
- MVKVectorInline<id<MTLBuffer>, 1> _mtlBuffers;
- MVKVectorInline<NSUInteger, 1> _mtlBufferOffsets;
- MVKVectorInline<id<MTLTexture>, 1> _mtlTextures;
- MVKVectorInline<id<MTLSamplerState>, 1> _mtlSamplers;
+ std::vector<VkDescriptorImageInfo> _imageBindings;
+ std::vector<VkDescriptorBufferInfo> _bufferBindings;
+ std::vector<VkBufferView> _texelBufferBindings;
+ std::vector<id<MTLBuffer>> _mtlBuffers;
+ std::vector<NSUInteger> _mtlBufferOffsets;
+ std::vector<id<MTLTexture>> _mtlTextures;
+ std::vector<id<MTLSamplerState>> _mtlSamplers;
bool _hasDynamicSamplers;
};
@@ -323,7 +324,7 @@
MVKDescriptorBinding* getBinding(uint32_t binding);
MVKDescriptorSetLayout* _pLayout = nullptr;
- MVKVectorInline<MVKDescriptorBinding, 8> _bindings;
+ MVKVectorInline<MVKDescriptorBinding, 1> _bindings;
};
@@ -407,7 +408,7 @@
void propogateDebugName() override {}
VkDescriptorUpdateTemplateTypeKHR _type;
- MVKVectorInline<VkDescriptorUpdateTemplateEntryKHR, 4> _entries;
+ MVKVectorInline<VkDescriptorUpdateTemplateEntryKHR, 1> _entries;
};
#pragma mark -
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
index fe98677..c52d1fe 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
@@ -1950,10 +1950,10 @@
if (getSupportsGPUFamily(MTLGPUFamilyCommon2)) { logMsg += "\n\t\tGPU Family Common 2"; }
if (getSupportsGPUFamily(MTLGPUFamilyCommon1)) { logMsg += "\n\t\tGPU Family Common 1"; }
-#if MVK_IOS
- if (getSupportsGPUFamily(MTLGPUFamilyiOSMac2)) { logMsg += "\n\t\tGPU Family iOS-Mac 2"; }
- if (getSupportsGPUFamily(MTLGPUFamilyiOSMac1)) { logMsg += "\n\t\tGPU Family iOS-Mac 1"; }
+ if (getSupportsGPUFamily(MTLGPUFamilyMacCatalyst2)) { logMsg += "\n\t\tGPU Family Mac Catalyst 2"; }
+ if (getSupportsGPUFamily(MTLGPUFamilyMacCatalyst1)) { logMsg += "\n\t\tGPU Family Mac Catalyst 1"; }
+#if MVK_IOS
if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_iOS_GPUFamily5_v1] ) { logMsg += "\n\t\tiOS GPU Family 5 v1"; }
if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_iOS_GPUFamily4_v2] ) { logMsg += "\n\t\tiOS GPU Family 4 v2"; }
@@ -1978,9 +1978,6 @@
#endif
#if MVK_MACOS
- if (getSupportsGPUFamily(MTLGPUFamilyMacCatalyst2)) { logMsg += "\n\t\tGPU Family Mac Catalyst 2"; }
- if (getSupportsGPUFamily(MTLGPUFamilyMacCatalyst1)) { logMsg += "\n\t\tGPU Family Mac Catalyst 1"; }
-
if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily2_v1] ) { logMsg += "\n\t\tmacOS GPU Family 2 v1"; }
if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v4] ) { logMsg += "\n\t\tmacOS GPU Family 1 v4"; }
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKFramebuffer.h b/MoltenVK/MoltenVK/GPUObjects/MVKFramebuffer.h
index e7a0852..095c5d5 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKFramebuffer.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKFramebuffer.h
@@ -56,6 +56,6 @@
VkExtent2D _extent;
uint32_t _layerCount;
- MVKVectorInline<MVKImageView*, 8> _attachments;
+ MVKVectorInline<MVKImageView*, 4> _attachments;
};
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKImage.h b/MoltenVK/MoltenVK/GPUObjects/MVKImage.h
index 9ac30d9..f210a13 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKImage.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKImage.h
@@ -257,7 +257,7 @@
VkPipelineStageFlags dstStageMask,
VkImageMemoryBarrier* pImageMemoryBarrier);
- MVKVectorInline<MVKImageSubresource, 4> _subresources;
+ MVKVectorInline<MVKImageSubresource, 1> _subresources;
std::unordered_map<NSUInteger, id<MTLTexture>> _mtlTextureViews;
VkExtent3D _extent;
uint32_t _mipLevels;
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKInstance.h b/MoltenVK/MoltenVK/GPUObjects/MVKInstance.h
index 301a4f0..645ed49 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKInstance.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKInstance.h
@@ -187,9 +187,9 @@
MVKConfiguration _mvkConfig;
VkApplicationInfo _appInfo;
- MVKVectorInline<MVKPhysicalDevice*, 4> _physicalDevices;
- MVKVectorInline<MVKDebugReportCallback*, 4> _debugReportCallbacks;
- MVKVectorInline<MVKDebugUtilsMessenger*, 4> _debugUtilMessengers;
+ MVKVectorInline<MVKPhysicalDevice*, 1> _physicalDevices;
+ MVKVectorDefault<MVKDebugReportCallback*> _debugReportCallbacks;
+ MVKVectorDefault<MVKDebugUtilsMessenger*> _debugUtilMessengers;
std::unordered_map<std::string, MVKEntryPoint> _entryPoints;
std::mutex _dcbLock;
bool _hasDebugReportCallbacks;
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm b/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm
index 8c0a9b9..c5a7ae8 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm
@@ -282,17 +282,16 @@
#pragma mark Object Creation
-// Returns a new array containing the MTLDevices available on this system, sorted according to power,
+// Returns an autoreleased array containing the MTLDevices available on this system, sorted according to power,
// with higher power GPU's at the front of the array. This ensures that a lazy app that simply
// grabs the first GPU will get a high-power one by default. If the MVK_CONFIG_FORCE_LOW_POWER_GPU
// env var or build setting is set, the returned array will only include low-power devices.
-// It is the caller's responsibility to release the array when not required anymore.
// If Metal is not supported, returns an empty array.
-static NSArray<id<MTLDevice>>* newAvailableMTLDevicesArray() {
- NSMutableArray* mtlDevs = [NSMutableArray new];
+static NSArray<id<MTLDevice>>* availableMTLDevicesArray() {
+ NSMutableArray* mtlDevs = [NSMutableArray array];
#if MVK_MACOS
- NSArray* rawMTLDevs = MTLCopyAllDevices(); // temp retain
+ NSArray* rawMTLDevs = [MTLCopyAllDevices() autorelease];
if (rawMTLDevs) {
bool forceLowPower = MVK_CONFIG_FORCE_LOW_POWER_GPU;
MVK_SET_FROM_ENV_OR_BUILD_BOOL(forceLowPower, MVK_CONFIG_FORCE_LOW_POWER_GPU);
@@ -322,13 +321,11 @@
}];
}
- [rawMTLDevs release]; // release temp
#endif // MVK_MACOS
#if MVK_IOS
- id<MTLDevice> md = MTLCreateSystemDefaultDevice();
+ id<MTLDevice> md = [MTLCreateSystemDefaultDevice() autorelease];
if (md) { [mtlDevs addObject: md]; }
- [md release];
#endif // MVK_IOS
return mtlDevs; // retained
@@ -359,13 +356,16 @@
mvkGetVulkanVersionString(MVK_VULKAN_API_VERSION).c_str()));
}
- // Populate the array of physical GPU devices
- NSArray<id<MTLDevice>>* mtlDevices = newAvailableMTLDevicesArray(); // temp retain
- _physicalDevices.reserve(mtlDevices.count);
- for (id<MTLDevice> mtlDev in mtlDevices) {
- _physicalDevices.push_back(new MVKPhysicalDevice(this, mtlDev));
+ // Populate the array of physical GPU devices.
+ // This effort creates a number of autoreleased instances of Metal
+ // and other Obj-C classes, so wrap it all in an autorelease pool.
+ @autoreleasepool {
+ NSArray<id<MTLDevice>>* mtlDevices = availableMTLDevicesArray();
+ _physicalDevices.reserve(mtlDevices.count);
+ for (id<MTLDevice> mtlDev in mtlDevices) {
+ _physicalDevices.push_back(new MVKPhysicalDevice(this, mtlDev));
+ }
}
- [mtlDevices release]; // release temp
if (_physicalDevices.empty()) {
setConfigurationResult(reportError(VK_ERROR_INCOMPATIBLE_DRIVER, "Vulkan is not supported on this device. MoltenVK requires Metal, which is not available on this device."));
@@ -648,21 +648,6 @@
}
void MVKInstance::initConfig() {
-
-// The default value for MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS actually depends on whether
-// MTLEvents are supported, becuase if MTLEvents are not supported, then synchronous queues
-// should be turned off by default to ensure , whereas if MTLEvents are supported, we want
-// sychronous queues for better behaviour. The app can of course still override this default
-// behaviour by setting the env var, or the config directly.
-#undef MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS
-#define MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS syncQueueSubmits
-#if MVK_MACOS
- bool syncQueueSubmits = mvkOSVersion() >= 10.14; // Support for MTLEvents
-#endif
-#if MVK_IOS
- bool syncQueueSubmits = mvkOSVersion() >= 12.0; // Support for MTLEvents
-#endif
-
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.debugMode, MVK_DEBUG);
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.shaderConversionFlipVertexY, MVK_CONFIG_SHADER_CONVERSION_FLIP_VERTEX_Y);
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.synchronousQueueSubmits, MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS);
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.h b/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.h
index 020af29..2157f67 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.h
@@ -107,9 +107,9 @@
protected:
void propogateDebugName() override {}
- MVKVectorInline<MVKDescriptorSetLayout*, 8> _descriptorSetLayouts;
- MVKVectorInline<MVKShaderResourceBinding, 8> _dslMTLResourceIndexOffsets;
- MVKVectorInline<VkPushConstantRange, 8> _pushConstants;
+ MVKVectorInline<MVKDescriptorSetLayout*, 1> _descriptorSetLayouts;
+ MVKVectorInline<MVKShaderResourceBinding, 1> _dslMTLResourceIndexOffsets;
+ MVKVectorDefault<VkPushConstantRange> _pushConstants;
MVKShaderResourceBinding _pushConstantsMTLResourceIndexes;
MVKShaderImplicitRezBinding _swizzleBufferIndex;
MVKShaderImplicitRezBinding _bufferSizeBufferIndex;
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKQueue.h b/MoltenVK/MoltenVK/GPUObjects/MVKQueue.h
index 2976527..01d75b8 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKQueue.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKQueue.h
@@ -206,8 +206,8 @@
void commitActiveMTLCommandBuffer(bool signalCompletion = false);
void finish();
- MVKVectorInline<MVKCommandBuffer*, 16> _cmdBuffers;
- MVKVectorInline<MVKSemaphore*, 16> _signalSemaphores;
+ MVKVectorInline<MVKCommandBuffer*, 32> _cmdBuffers;
+ MVKVectorInline<MVKSemaphore*, 8> _signalSemaphores;
MVKFence* _fence;
id<MTLCommandBuffer> _activeMTLCommandBuffer;
};
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKQueue.mm b/MoltenVK/MoltenVK/GPUObjects/MVKQueue.mm
index 9a4dba4..d2cd34b 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKQueue.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKQueue.mm
@@ -38,9 +38,11 @@
lock_guard<mutex> lock(_qLock);
id<MTLCommandQueue> mtlQ = _mtlQueues[queueIndex];
if ( !mtlQ ) {
- uint32_t maxCmdBuffs = _physicalDevice->getInstance()->getMoltenVKConfiguration()->maxActiveMetalCommandBuffersPerQueue;
- mtlQ = [_physicalDevice->getMTLDevice() newCommandQueueWithMaxCommandBufferCount: maxCmdBuffs]; // retained
- _mtlQueues[queueIndex] = mtlQ;
+ @autoreleasepool { // Catch any autoreleased objects created during MTLCommandQueue creation
+ uint32_t maxCmdBuffs = _physicalDevice->getInstance()->getMoltenVKConfiguration()->maxActiveMetalCommandBuffersPerQueue;
+ mtlQ = [_physicalDevice->getMTLDevice() newCommandQueueWithMaxCommandBufferCount: maxCmdBuffs]; // retained
+ _mtlQueues[queueIndex] = mtlQ;
+ }
}
return mtlQ;
}
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKRenderPass.h b/MoltenVK/MoltenVK/GPUObjects/MVKRenderPass.h
index 253f367..0c48ba2 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKRenderPass.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKRenderPass.h
@@ -174,8 +174,8 @@
void propogateDebugName() override {}
MVKVectorInline<MVKRenderPassAttachment, kMVKDefaultAttachmentCount> _attachments;
- MVKVectorInline<MVKRenderSubpass, 4> _subpasses;
- MVKVectorInline<VkSubpassDependency, 4 * 2> _subpassDependencies;
+ MVKVectorInline<MVKRenderSubpass, 1> _subpasses;
+ MVKVectorDefault<VkSubpassDependency> _subpassDependencies;
};
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKRenderPass.mm b/MoltenVK/MoltenVK/GPUObjects/MVKRenderPass.mm
index 42b499b..ddcbe4b 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKRenderPass.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKRenderPass.mm
@@ -348,7 +348,7 @@
// Add subpasses and dependencies first
_subpasses.reserve(pCreateInfo->subpassCount);
for (uint32_t i = 0; i < pCreateInfo->subpassCount; i++) {
- _subpasses.push_back(MVKRenderSubpass(this, &pCreateInfo->pSubpasses[i]));
+ _subpasses.emplace_back(this, &pCreateInfo->pSubpasses[i]);
}
_subpassDependencies.reserve(pCreateInfo->dependencyCount);
for (uint32_t i = 0; i < pCreateInfo->dependencyCount; i++) {
@@ -358,7 +358,7 @@
// Add attachments after subpasses, so each attachment can link to subpasses
_attachments.reserve(pCreateInfo->attachmentCount);
for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) {
- _attachments.push_back(MVKRenderPassAttachment(this, &pCreateInfo->pAttachments[i]));
+ _attachments.emplace_back(this, &pCreateInfo->pAttachments[i]);
}
}
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKShaderModule.h b/MoltenVK/MoltenVK/GPUObjects/MVKShaderModule.h
index 4ef1dfb..6274ee6 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKShaderModule.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKShaderModule.h
@@ -151,7 +151,7 @@
void merge(MVKShaderLibraryCache* other);
MVKVulkanAPIDeviceObject* _owner;
- MVKVectorInline<std::pair<SPIRVToMSLConversionConfiguration, MVKShaderLibrary*>, 4> _shaderLibraries;
+ MVKVectorInline<std::pair<SPIRVToMSLConversionConfiguration, MVKShaderLibrary*>, 1> _shaderLibraries;
};
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.h b/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.h
index 2346699..107d42a 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.h
@@ -115,7 +115,7 @@
struct Availability {
MVKSwapchainImageAvailability status;
- MVKVectorInline<MVKSwapchainSignaler, 4> signalers;
+ MVKVectorInline<MVKSwapchainSignaler, 1> signalers;
MVKSwapchainSignaler preSignaled;
};
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKSync.mm b/MoltenVK/MoltenVK/GPUObjects/MVKSync.mm
index a7ad544..e95d111 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKSync.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKSync.mm
@@ -310,7 +310,7 @@
MVKDevice* mvkDev = _owner->getDevice();
_startTime = mvkDev->getPerformanceTimestamp();
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ @autoreleasepool { block(); } });
// Limit timeout to avoid overflow since wait_for() uses wait_until()
chrono::nanoseconds nanoTimeout(min(mvkDev->_pMVKConfig->metalCompileTimeout, kMVKUndefinedLargeUInt64));
diff --git a/MoltenVK/MoltenVK/Utility/MVKEnvironment.h b/MoltenVK/MoltenVK/Utility/MVKEnvironment.h
index 8ae135c..cd5e5a4 100644
--- a/MoltenVK/MoltenVK/Utility/MVKEnvironment.h
+++ b/MoltenVK/MoltenVK/Utility/MVKEnvironment.h
@@ -56,9 +56,23 @@
# define MVK_CONFIG_SHADER_CONVERSION_FLIP_VERTEX_Y 1
#endif
-/** Process command queue submissions on the same thread on which the submission call was made. Enable by default. */
+/**
+ * Process command queue submissions on the same thread on which the submission call was made.
+ * The default value actually depends on whether MTLEvents are supported, becuase if MTLEvents
+ * are not supported, then synchronous queues should be turned off by default to ensure the
+ * CPU emulation of VkEvent behaviour does not deadlock a queue submission, whereas if MTLEvents
+ * are supported, we want sychronous queues for better, and more performant, behaviour.
+ * The app can of course still override this default behaviour by setting the
+ * MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS env var, or the config directly.
+ */
+#if MVK_MACOS
+# define MVK_MTLEVENT_MIN_OS 10.14
+#endif
+#if MVK_IOS
+# define MVK_MTLEVENT_MIN_OS 12.0
+#endif
#ifndef MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS
-# define MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS 1
+# define MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS (mvkOSVersion() >= MVK_MTLEVENT_MIN_OS)
#endif
/** Fill a Metal command buffers when each Vulkan command buffer is filled. */
diff --git a/MoltenVK/MoltenVK/Vulkan/mvk_datatypes.mm b/MoltenVK/MoltenVK/Vulkan/mvk_datatypes.mm
index e113912..950ffb5 100644
--- a/MoltenVK/MoltenVK/Vulkan/mvk_datatypes.mm
+++ b/MoltenVK/MoltenVK/Vulkan/mvk_datatypes.mm
@@ -226,8 +226,8 @@
# define MTLPixelFormatDepth16Unorm_Stencil8 MTLPixelFormatDepth32Float_Stencil8
#endif
-
-static const MVKFormatDesc _formatDescriptions[] {
+// This cannot be const, because we write to MVKFormatDesc::hasReportedSubstitution
+static MVKFormatDesc _formatDescriptions[] {
MVK_MAKE_FMT_STRUCT( VK_FORMAT_UNDEFINED, MTLPixelFormatInvalid, MTLPixelFormatInvalid, kMTLFmtNA, kMTLFmtNA, 1, 1, 0, MTLVertexFormatInvalid, MTLVertexFormatInvalid, kMTLFmtNA, kMTLFmtNA, kMVKFormatNone, MVK_FMT_NO_FEATS, MVK_FMT_NO_FEATS ),
MVK_MAKE_FMT_STRUCT( VK_FORMAT_R4G4_UNORM_PACK8, MTLPixelFormatInvalid, MTLPixelFormatInvalid, kMTLFmtNA, kMTLFmtNA, 1, 1, 1, MTLVertexFormatInvalid, MTLVertexFormatInvalid, kMTLFmtNA, kMTLFmtNA, kMVKFormatColorFloat, MVK_FMT_NO_FEATS, MVK_FMT_NO_FEATS ),
diff --git a/MoltenVKPackaging.xcodeproj/project.pbxproj b/MoltenVKPackaging.xcodeproj/project.pbxproj
index a27c9b4..5c7ac40 100644
--- a/MoltenVKPackaging.xcodeproj/project.pbxproj
+++ b/MoltenVKPackaging.xcodeproj/project.pbxproj
@@ -248,7 +248,7 @@
A90B2B1D1A9B6170008EE819 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1100;
+ LastUpgradeCheck = 1110;
TargetAttributes = {
A9FEADBC1F3517480010240E = {
DevelopmentTeam = VU3TCKU48B;
diff --git "a/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050Debug\051.xcscheme" "b/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050Debug\051.xcscheme"
index 86f6dfb..937f8f2 100644
--- "a/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050Debug\051.xcscheme"
+++ "b/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050Debug\051.xcscheme"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git "a/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050iOS only\051.xcscheme" "b/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050iOS only\051.xcscheme"
index c440721..5be1a24 100644
--- "a/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050iOS only\051.xcscheme"
+++ "b/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050iOS only\051.xcscheme"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git "a/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050macOS only\051.xcscheme" "b/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050macOS only\051.xcscheme"
index e184010..c5717dc 100644
--- "a/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050macOS only\051.xcscheme"
+++ "b/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package \050macOS only\051.xcscheme"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package.xcscheme b/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package.xcscheme
index b18d370..e6085db 100644
--- a/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package.xcscheme
+++ b/MoltenVKPackaging.xcodeproj/xcshareddata/xcschemes/MoltenVK Package.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "NO"
diff --git a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj
index 69532ad..a164d94 100644
--- a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj
+++ b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj
@@ -415,7 +415,7 @@
A9F55D25198BE6A7004EC31B /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1100;
+ LastUpgradeCheck = 1110;
ORGANIZATIONNAME = "The Brenwill Workshop Ltd.";
TargetAttributes = {
A9092A8C1A81717B00051823 = {
diff --git a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKGLSLToSPIRVConverter-iOS.xcscheme b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKGLSLToSPIRVConverter-iOS.xcscheme
index 49b6e0d..9614bcd 100644
--- a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKGLSLToSPIRVConverter-iOS.xcscheme
+++ b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKGLSLToSPIRVConverter-iOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKGLSLToSPIRVConverter-macOS.xcscheme b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKGLSLToSPIRVConverter-macOS.xcscheme
index e56b79c..980c076 100644
--- a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKGLSLToSPIRVConverter-macOS.xcscheme
+++ b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKGLSLToSPIRVConverter-macOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKSPIRVToMSLConverter-iOS.xcscheme b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKSPIRVToMSLConverter-iOS.xcscheme
index a7fdafe..8cf73e7 100644
--- a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKSPIRVToMSLConverter-iOS.xcscheme
+++ b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKSPIRVToMSLConverter-iOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKSPIRVToMSLConverter-macOS.xcscheme b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKSPIRVToMSLConverter-macOS.xcscheme
index e973648..c770f80 100644
--- a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKSPIRVToMSLConverter-macOS.xcscheme
+++ b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKSPIRVToMSLConverter-macOS.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKShaderConverter.xcscheme b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKShaderConverter.xcscheme
index e47bbe9..b4b9429 100644
--- a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKShaderConverter.xcscheme
+++ b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKShaderConverter.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1100"
+ LastUpgradeVersion = "1110"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/README.md b/README.md
index ab05ba1..6440624 100644
--- a/README.md
+++ b/README.md
@@ -287,10 +287,15 @@
- If you encounter an issue with the behaviour of **MoltenVK**, you can report it in the
[*MoltenVK Issues List*](https://github.com/KhronosGroup/MoltenVK/issues).
-
+
- If you encounter an issue with the *Vulkan SDK*, including the *Validation Layers*, you can report it in the
[*Vulkan SDK Issues List*](https://vulkan.lunarg.com/issue/home).
+- If you explore **MoltenVK** and determine that it does not meet your requirements at this time, we would appreciate
+ hearing why that is so, on the [*MoltenVK Issues List*](https://github.com/KhronosGroup/MoltenVK/issues).
+ The goal of **MoltenVK** is to increase the value of *Vulkan* as a true cross-platform ecosystem, by providing
+ *Vulkan* on *Apple* platforms. Hearing why this is currently not working for you will help us in that goal.
+
<a name="contributing"></a>