Add support for Vulkan 1.2.
- Set MVK_VULKAN_API_VERSION from VK_API_VERSION_1_2.
- Update MoltenVK version to 1.2.0.
- Remove several previously overlooked extension suffixes
in use of promoted Vulkan struct and enum values.
- Update documentation.
diff --git a/Docs/MoltenVK_Runtime_UserGuide.md b/Docs/MoltenVK_Runtime_UserGuide.md
index bcc42c7..6582dbc 100644
--- a/Docs/MoltenVK_Runtime_UserGuide.md
+++ b/Docs/MoltenVK_Runtime_UserGuide.md
@@ -53,7 +53,7 @@
About **MoltenVK**
------------------
-**MoltenVK** is a layered implementation of [*Vulkan 1.1*](https://www.khronos.org/vulkan)
+**MoltenVK** is a layered implementation of [*Vulkan 1.2*](https://www.khronos.org/vulkan)
graphics and compute functionality, that is built on Apple's [*Metal*](https://developer.apple.com/metal)
graphics and compute framework on *macOS*, *iOS*, and *tvOS*. **MoltenVK** allows you to use *Vulkan*
graphics and compute functionality to develop modern, cross-platform, high-performance graphical games
diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md
index 578c775..98106d9 100644
--- a/Docs/Whats_New.md
+++ b/Docs/Whats_New.md
@@ -13,11 +13,12 @@
-MoltenVK 1.1.12
+MoltenVK 1.2.0
--------------
Released TBD
+- Add support for _Vulkan 1.2_.
- Add support for extensions:
- `VK_KHR_shader_float_controls`
- `VK_KHR_spirv_1_4`
@@ -31,8 +32,10 @@
- Fix occassional crash from retention of `MVKSwapchain` for future drawable presentations.
- Fix undefined reference to `vkGetBufferDeviceAddressEXT` when building with `MVK_HIDE_VULKAN_SYMBOLS=1`.
- Update `Makefile` to forward any build setting declared on the command line to Xcode.
+- Add _**non-functional** Vulkan 1.3_ core function **_stubs_**, to avoid link errors with some external
+ libraries that assume _Vulkan 1.3_ linkages from the standard _Vulkan_ header files included with **MoltenVK**.
- Add `MVK_USE_CEREAL` build setting to avoid use of Cereal external library (for pipeline caching).
-- `MoltenVKShaderConverter` tool automatically map bindings when converting _GLSL_.
+- `MoltenVKShaderConverter` tool automatically maps bindings when converting _GLSL_.
- Update `VK_MVK_MOLTENVK_SPEC_VERSION` to version `36`.
diff --git a/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h b/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h
index 683a435..fb3eb2f 100644
--- a/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h
+++ b/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h
@@ -50,8 +50,8 @@
* - 401215 (version 4.12.15)
*/
#define MVK_VERSION_MAJOR 1
-#define MVK_VERSION_MINOR 1
-#define MVK_VERSION_PATCH 12
+#define MVK_VERSION_MINOR 2
+#define MVK_VERSION_PATCH 0
#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)
@@ -747,6 +747,7 @@
* When reading this value, it will be one of the VK_API_VERSION_1_* values, including the latest
* VK_HEADER_VERSION component. When setting this value, it should be set to one of:
*
+ * VK_API_VERSION_1_2 (equivalent decimal number 4202496)
* VK_API_VERSION_1_1 (equivalent decimal number 4198400)
* VK_API_VERSION_1_0 (equivalent decimal number 4194304)
*
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm
index 156572b..4d22d55 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm
@@ -249,8 +249,8 @@
const VkDescriptorBindingFlags* MVKDescriptorSetLayout::getBindingFlags(const VkDescriptorSetLayoutCreateInfo* pCreateInfo) {
for (const auto* next = (VkBaseInStructure*)pCreateInfo->pNext; next; next = next->pNext) {
switch (next->sType) {
- case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT: {
- auto* pDescSetLayoutBindingFlags = (VkDescriptorSetLayoutBindingFlagsCreateInfoEXT*)next;
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
+ auto* pDescSetLayoutBindingFlags = (VkDescriptorSetLayoutBindingFlagsCreateInfo*)next;
return pDescSetLayoutBindingFlags->bindingCount ? pDescSetLayoutBindingFlags->pBindingFlags : nullptr;
}
default:
@@ -468,8 +468,8 @@
const uint32_t* MVKDescriptorPool::getVariableDecriptorCounts(const VkDescriptorSetAllocateInfo* pAllocateInfo) {
for (const auto* next = (VkBaseInStructure*)pAllocateInfo->pNext; next; next = next->pNext) {
switch (next->sType) {
- case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT: {
- auto* pVarDescSetVarCounts = (VkDescriptorSetVariableDescriptorCountAllocateInfoEXT*)next;
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: {
+ auto* pVarDescSetVarCounts = (VkDescriptorSetVariableDescriptorCountAllocateInfo*)next;
return pVarDescSetVarCounts->descriptorSetCount ? pVarDescSetVarCounts->pDescriptorCounts : nullptr;
}
default:
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.h b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.h
index d378fd9..54ca3a6 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.h
@@ -869,7 +869,7 @@
void updateActivityPerformance(MVKPerformanceTracker& activity, uint64_t startTime, uint64_t endTime);
void getDescriptorVariableDescriptorCountLayoutSupport(const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
VkDescriptorSetLayoutSupport* pSupport,
- VkDescriptorSetVariableDescriptorCountLayoutSupportEXT* pVarDescSetCountSupport);
+ VkDescriptorSetVariableDescriptorCountLayoutSupport* pVarDescSetCountSupport);
MVKPhysicalDevice* _physicalDevice = nullptr;
MVKCommandResourceFactory* _commandResourceFactory = nullptr;
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
index f43f942..f67ac5c 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
@@ -3364,8 +3364,8 @@
// Check whether the layout has a variable-count descriptor, and if so, whether we can support it.
for (auto* next = (VkBaseOutStructure*)pSupport->pNext; next; next = next->pNext) {
switch (next->sType) {
- case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT: {
- auto* pVarDescSetCountSupport = (VkDescriptorSetVariableDescriptorCountLayoutSupportEXT*)next;
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
+ auto* pVarDescSetCountSupport = (VkDescriptorSetVariableDescriptorCountLayoutSupport*)next;
getDescriptorVariableDescriptorCountLayoutSupport(pCreateInfo, pSupport, pVarDescSetCountSupport);
break;
}
@@ -3378,7 +3378,7 @@
// Check whether the layout has a variable-count descriptor, and if so, whether we can support it.
void MVKDevice::getDescriptorVariableDescriptorCountLayoutSupport(const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
VkDescriptorSetLayoutSupport* pSupport,
- VkDescriptorSetVariableDescriptorCountLayoutSupportEXT* pVarDescSetCountSupport) {
+ VkDescriptorSetVariableDescriptorCountLayoutSupport* pVarDescSetCountSupport) {
// Assume we don't need this, then set appropriately if we do.
pVarDescSetCountSupport->maxVariableDescriptorCount = 0;
@@ -3386,8 +3386,8 @@
int32_t varBindingIdx = -1;
for (const auto* next = (VkBaseInStructure*)pCreateInfo->pNext; next; next = next->pNext) {
switch (next->sType) {
- case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT: {
- auto* pDescSetLayoutBindingFlags = (VkDescriptorSetLayoutBindingFlagsCreateInfoEXT*)next;
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
+ auto* pDescSetLayoutBindingFlags = (VkDescriptorSetLayoutBindingFlagsCreateInfo*)next;
for (uint32_t bindIdx = 0; bindIdx < pDescSetLayoutBindingFlags->bindingCount; bindIdx++) {
if (mvkIsAnyFlagEnabled(pDescSetLayoutBindingFlags->pBindingFlags[bindIdx], VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT)) {
varBindingIdx = bindIdx;
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm b/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm
index ecb6825..1fb78e6 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm
@@ -402,18 +402,18 @@
#define ADD_INST_ENTRY_POINT(func) ADD_ENTRY_POINT(func, VK_API_VERSION_1_0, nullptr, nullptr, false)
#define ADD_DVC_ENTRY_POINT(func) ADD_ENTRY_POINT(func, VK_API_VERSION_1_0, nullptr, nullptr, true)
+// Add a core function.
#define ADD_INST_1_1_ENTRY_POINT(func) ADD_ENTRY_POINT(func, VK_API_VERSION_1_1, nullptr, nullptr, false)
#define ADD_INST_1_3_ENTRY_POINT(func) ADD_ENTRY_POINT(func, VK_API_VERSION_1_3, nullptr, nullptr, false)
#define ADD_DVC_1_1_ENTRY_POINT(func) ADD_ENTRY_POINT(func, VK_API_VERSION_1_1, nullptr, nullptr, true)
#define ADD_DVC_1_2_ENTRY_POINT(func) ADD_ENTRY_POINT(func, VK_API_VERSION_1_2, nullptr, nullptr, true)
#define ADD_DVC_1_3_ENTRY_POINT(func) ADD_ENTRY_POINT(func, VK_API_VERSION_1_3, nullptr, nullptr, true)
-// Adds both the 1.1 function and the promoted extension function.
+// Add both the promoted core function and the extension function.
#define ADD_INST_1_1_PROMOTED_ENTRY_POINT(func, EXT) \
ADD_INST_1_1_ENTRY_POINT(func); \
ADD_ENTRY_POINT_MAP(func##KHR, func, 0, VK_##EXT##_EXTENSION_NAME, nullptr, false)
-// Adds both the 1.1 function and the promoted extension function.
#define ADD_DVC_1_1_PROMOTED_ENTRY_POINT(func, EXT) \
ADD_DVC_1_1_ENTRY_POINT(func); \
ADD_ENTRY_POINT_MAP(func##KHR, func, 0, VK_##EXT##_EXTENSION_NAME, nullptr, true)
@@ -430,6 +430,7 @@
ADD_DVC_1_3_ENTRY_POINT(func); \
ADD_ENTRY_POINT_MAP(func##suffix, func, 0, VK_##EXT##_EXTENSION_NAME, nullptr, true)
+// Add an extension function.
#define ADD_INST_EXT_ENTRY_POINT(func, EXT) ADD_ENTRY_POINT(func, 0, VK_##EXT##_EXTENSION_NAME, nullptr, false)
#define ADD_DVC_EXT_ENTRY_POINT(func, EXT) ADD_ENTRY_POINT(func, 0, VK_##EXT##_EXTENSION_NAME, nullptr, true)
diff --git a/MoltenVK/MoltenVK/Utility/MVKEnvironment.h b/MoltenVK/MoltenVK/Utility/MVKEnvironment.h
index 307038d..dc9e455 100644
--- a/MoltenVK/MoltenVK/Utility/MVKEnvironment.h
+++ b/MoltenVK/MoltenVK/Utility/MVKEnvironment.h
@@ -36,8 +36,8 @@
#endif
/** Macro to determine the Vulkan version supported by MoltenVK. */
-#define MVK_VULKAN_API_VERSION VK_MAKE_VERSION(VK_VERSION_MAJOR(VK_API_VERSION_1_1), \
- VK_VERSION_MINOR(VK_API_VERSION_1_1), \
+#define MVK_VULKAN_API_VERSION VK_MAKE_VERSION(VK_VERSION_MAJOR(VK_API_VERSION_1_2), \
+ VK_VERSION_MINOR(VK_API_VERSION_1_2), \
VK_HEADER_VERSION)
/**
diff --git a/README.md b/README.md
index 49f7468..14c9ab5 100644
--- a/README.md
+++ b/README.md
@@ -69,7 +69,7 @@
Introduction to MoltenVK
------------------------
-**MoltenVK** is a layered implementation of [*Vulkan 1.1*](https://www.khronos.org/vulkan)
+**MoltenVK** is a layered implementation of [*Vulkan 1.2*](https://www.khronos.org/vulkan)
graphics and compute functionality, that is built on Apple's [*Metal*](https://developer.apple.com/metal)
graphics and compute framework on *macOS*, *iOS*, and *tvOS*. **MoltenVK** allows you to use *Vulkan*
graphics and compute functionality to develop modern, cross-platform, high-performance graphical
@@ -88,7 +88,7 @@
The **MoltenVK** runtime package contains two products:
- **MoltenVK** is a implementation of an almost-complete subset of the
- [*Vulkan 1.1*](https://www.khronos.org/vulkan) graphics and compute API.
+ [*Vulkan 1.2*](https://www.khronos.org/vulkan) graphics and compute API.
- **MoltenVKShaderConverter** converts *SPIR-V* shader code to *Metal Shading Language (MSL)*
shader code, and converts *GLSL* shader source code to *SPIR-V* shader code and/or
@@ -305,11 +305,11 @@
**MoltenVK** and *Vulkan* Compliance
------------------------------------
-**MoltenVK** is designed to be an implementation of a *Vulkan 1.1* subset that runs on *macOS*, *iOS*,
+**MoltenVK** is designed to be an implementation of a *Vulkan 1.2* subset that runs on *macOS*, *iOS*,
and *tvOS* platforms by mapping *Vulkan* capability to native *Metal* capability.
The fundamental design and development goal of **MoltenVK** is to provide this capability in a way that
-is both maximally compliant with the *Vulkan 1.1* specification, and maximally performant.
+is both maximally compliant with the *Vulkan 1.2* specification, and maximally performant.
Such compliance and performance is inherently affected by the capability available through *Metal*, as the
native graphics driver on *macOS*, *iOS*, and *tvOS* platforms. *Vulkan* compliance may fall into one of
@@ -389,7 +389,7 @@
### *Vulkan* Validation
Despite running on top of *Metal*, **MoltenVK** operates as a *Vulkan* core layer. As such, as per the
-error handling guidelines of the [*Vulkan* specification](https://www.khronos.org/registry/vulkan/specs/1.1/html/vkspec.html#fundamentals-errors), **MoltenVK** should not perform *Vulkan* validation. When adding functionality
+error handling guidelines of the [*Vulkan* specification](https://www.khronos.org/registry/vulkan/specs/1.2/html/vkspec.html#fundamentals-errors), **MoltenVK** should not perform *Vulkan* validation. When adding functionality
to **MoltenVK**, avoid adding unnecessary validation code.
Validation and error generation **_is_** appropriate within **MoltenVK** in cases where **MoltenVK** deviates