Merge pull request #2657 from squidbus/maintenance9

Add support for VK_KHR_maintenance9.
This commit is contained in:
Bill Hollings
2025-10-23 22:12:56 -04:00
committed by GitHub
6 changed files with 18 additions and 4 deletions

View File

@@ -277,6 +277,7 @@ In addition to core *Vulkan* functionality, **MoltenVK** also supports the foll
- `VK_KHR_maintenance6`
- `VK_KHR_maintenance7`
- `VK_KHR_maintenance8`
- `VK_KHR_maintenance9`
- `VK_KHR_map_memory2`
- `VK_KHR_multiview`
- `VK_KHR_portability_subset`

View File

@@ -32,6 +32,7 @@ Released TBD
- Raise minimum target to _macOS 11.0 / iOS 14.0 / tvOS 14.0_
- Add support for `VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT`.
- Add support for the following extensions:
- `VK_KHR_maintenance9`
- `VK_KHR_shader_fma`
- `VK_KHR_surface_maintenance1`
- `VK_KHR_swapchain_maintenance1`

View File

@@ -580,6 +580,11 @@ void MVKPhysicalDevice::getFeatures(VkPhysicalDeviceFeatures2* features) {
maintenance8Features->maintenance8 = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_9_FEATURES_KHR: {
auto* maintenance9Features = (VkPhysicalDeviceMaintenance9FeaturesKHR*)next;
maintenance9Features->maintenance9 = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: {
auto* portabilityFeatures = (VkPhysicalDevicePortabilitySubsetFeaturesKHR*)next;
portabilityFeatures->constantAlphaColorBlendFactors = true;
@@ -1206,6 +1211,12 @@ void MVKPhysicalDevice::getProperties(VkPhysicalDeviceProperties2* properties) {
maintenance7Properties->maxDescriptorSetUpdateAfterBindTotalBuffersDynamic =
supportedProps12.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic + supportedProps12.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_9_PROPERTIES_KHR: {
auto* maintenance9Properties = (VkPhysicalDeviceMaintenance9PropertiesKHR*)next;
maintenance9Properties->image2DViewOf3DSparse = false;
maintenance9Properties->defaultVertexAttributeValue = VK_DEFAULT_VERTEX_ATTRIBUTE_VALUE_ZERO_ZERO_ZERO_ZERO_KHR;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: {
auto* shaderIntDotProperties = (VkPhysicalDeviceShaderIntegerDotProductProperties*)next;

View File

@@ -83,6 +83,7 @@ MVK_DEVICE_FEATURE(ZeroInitializeWorkgroupMemory, ZERO_INITIALIZE_WORKGR
MVK_DEVICE_FEATURE_EXTN(FragmentShaderBarycentric, FRAGMENT_SHADER_BARYCENTRIC, KHR, 1)
MVK_DEVICE_FEATURE_EXTN(Maintenance7, MAINTENANCE_7, KHR, 1)
MVK_DEVICE_FEATURE_EXTN(Maintenance8, MAINTENANCE_8, KHR, 1)
MVK_DEVICE_FEATURE_EXTN(Maintenance9, MAINTENANCE_9, KHR, 1)
MVK_DEVICE_FEATURE_EXTN(PortabilitySubset, PORTABILITY_SUBSET, KHR, 15)
MVK_DEVICE_FEATURE_EXTN(PresentId, PRESENT_ID, KHR, 1)
MVK_DEVICE_FEATURE_EXTN(PresentId2, PRESENT_ID_2, KHR, 1)

View File

@@ -1959,13 +1959,12 @@ MVKImageViewPlane::MVKImageViewPlane(MVKImageView* imageView,
// and set the _useMTLTextureView variable appropriately.
if ( _imageView->_image ) {
_useMTLTextureView = true;
bool is3D = _imageView->_image->_mtlTextureType == MTLTextureType3D;
// If the view is identical to underlying image, don't bother using a Metal view
if (_mtlPixFmt == _imageView->_image->getMTLPixelFormat(planeIndex) &&
(_imageView->_mtlTextureType == _imageView->_image->_mtlTextureType ||
((_imageView->_mtlTextureType == MTLTextureType2D || _imageView->_mtlTextureType == MTLTextureType2DArray) && is3D)) &&
_imageView->_mtlTextureType == _imageView->_image->_mtlTextureType &&
_imageView->_subresourceRange.levelCount == _imageView->_image->_mipLevels &&
(is3D || _imageView->_subresourceRange.layerCount == _imageView->_image->_arrayLayers) &&
(_imageView->_mtlTextureType == MTLTextureType3D ||
_imageView->_subresourceRange.layerCount == _imageView->_image->_arrayLayers) &&
!_useSwizzle) {
_useMTLTextureView = false;
}

View File

@@ -84,6 +84,7 @@ MVK_EXTENSION(KHR_maintenance5, KHR_MAINTENANCE_5,
MVK_EXTENSION(KHR_maintenance6, KHR_MAINTENANCE_6, DEVICE, 10.11, 8.0, 1.0)
MVK_EXTENSION(KHR_maintenance7, KHR_MAINTENANCE_7, DEVICE, 10.11, 8.0, 1.0)
MVK_EXTENSION(KHR_maintenance8, KHR_MAINTENANCE_8, DEVICE, 10.11, 8.0, 1.0)
MVK_EXTENSION(KHR_maintenance9, KHR_MAINTENANCE_9, DEVICE, 10.11, 8.0, 1.0)
MVK_EXTENSION(KHR_map_memory2, KHR_MAP_MEMORY_2, DEVICE, 10.11, 8.0, 1.0)
MVK_EXTENSION(KHR_multiview, KHR_MULTIVIEW, DEVICE, 10.11, 8.0, 1.0)
MVK_EXTENSION(KHR_portability_subset, KHR_PORTABILITY_SUBSET, DEVICE, 10.11, 8.0, 1.0)