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.
This commit is contained in:
parent
77b3cc03f4
commit
ac39eb24e1
@ -53,7 +53,7 @@ distribution package, see the main [`README.md`](../README.md) document in the `
|
||||
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
|
||||
|
@ -13,11 +13,12 @@ Copyright (c) 2015-2022 [The Brenwill Workshop Ltd.](http://www.brenwill.com)
|
||||
|
||||
|
||||
|
||||
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 @@ Released TBD
|
||||
- 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`.
|
||||
|
||||
|
||||
|
@ -50,8 +50,8 @@ typedef unsigned long MTLArgumentBuffersTier;
|
||||
* - 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 @@ typedef struct {
|
||||
* 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)
|
||||
*
|
||||
|
@ -249,8 +249,8 @@ MVKDescriptorSetLayout::MVKDescriptorSetLayout(MVKDevice* device,
|
||||
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 @@ VkResult MVKDescriptorPool::allocateDescriptorSets(const VkDescriptorSetAllocate
|
||||
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:
|
||||
|
@ -869,7 +869,7 @@ protected:
|
||||
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;
|
||||
|
@ -3364,8 +3364,8 @@ void MVKDevice::getDescriptorSetLayoutSupport(const VkDescriptorSetLayoutCreateI
|
||||
// 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 @@ void MVKDevice::getDescriptorSetLayoutSupport(const VkDescriptorSetLayoutCreateI
|
||||
// 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 @@ void MVKDevice::getDescriptorVariableDescriptorCountLayoutSupport(const VkDescri
|
||||
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;
|
||||
|
@ -402,18 +402,18 @@ void MVKInstance::initDebugCallbacks(const VkInstanceCreateInfo* pCreateInfo) {
|
||||
#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 @@ void MVKInstance::initDebugCallbacks(const VkInstanceCreateInfo* pCreateInfo) {
|
||||
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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
/**
|
||||
|
10
README.md
10
README.md
@ -69,7 +69,7 @@ document in the `Docs` directory.
|
||||
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 @@ channels, including *Apple's App Store*.
|
||||
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 @@ the contents of that directory out of this **MoltenVK** repository into your own
|
||||
**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 @@ Property claims.
|
||||
### *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
|
||||
|
Loading…
x
Reference in New Issue
Block a user