From ec32b2e87f53499bfb9d0cea7657350b805ca1ec Mon Sep 17 00:00:00 2001 From: sean Date: Sun, 7 Jan 2024 15:26:39 +0100 Subject: [PATCH] Add: KHR_shader_integer_dot_product --- Docs/MoltenVK_Runtime_UserGuide.md | 1 + MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm | 39 ++++++++++++++++++++++ MoltenVK/MoltenVK/Layers/MVKExtensions.def | 1 + 3 files changed, 41 insertions(+) diff --git a/Docs/MoltenVK_Runtime_UserGuide.md b/Docs/MoltenVK_Runtime_UserGuide.md index 96738ec9a..3f188a103 100644 --- a/Docs/MoltenVK_Runtime_UserGuide.md +++ b/Docs/MoltenVK_Runtime_UserGuide.md @@ -349,6 +349,7 @@ In addition to core *Vulkan* functionality, **MoltenVK** also supports the foll - `VK_KHR_shader_draw_parameters` - `VK_KHR_shader_float_controls` - `VK_KHR_shader_float16_int8` +- `VK_KHR_shader_integer_dot_product` - `VK_KHR_shader_non_semantic_info` - `VK_KHR_shader_subgroup_extended_types` - *Requires Metal 2.1 on Mac or Metal 2.2 and Apple family 4 on iOS.* diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm index 60ba45401..e644d36ae 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm @@ -375,6 +375,11 @@ portabilityFeatures->vertexAttributeAccessBeyondStride = true; // Costs additional buffers. Should make configuration switch. break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: { + auto* shaderIntDotFeatures = (VkPhysicalDeviceShaderIntegerDotProductFeatures*)next; + shaderIntDotFeatures->shaderIntegerDotProduct = true; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: { auto* formatFeatures = (VkPhysicalDevice4444FormatsFeaturesEXT*)next; bool canSupport4444 = _metalFeatures.tileBasedDeferredRendering && @@ -752,6 +757,40 @@ barycentricProperties->triStripVertexOrderIndependentOfProvokingVertex = false; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: { + auto* shaderIntDotProperties = (VkPhysicalDeviceShaderIntegerDotProductProperties*)next; + shaderIntDotProperties->integerDotProduct8BitUnsignedAccelerated = false; + shaderIntDotProperties->integerDotProduct8BitSignedAccelerated = false; + shaderIntDotProperties->integerDotProduct8BitMixedSignednessAccelerated = false; + shaderIntDotProperties->integerDotProduct4x8BitPackedUnsignedAccelerated = false; + shaderIntDotProperties->integerDotProduct4x8BitPackedSignedAccelerated = false; + shaderIntDotProperties->integerDotProduct4x8BitPackedMixedSignednessAccelerated = false; + shaderIntDotProperties->integerDotProduct16BitUnsignedAccelerated = false; + shaderIntDotProperties->integerDotProduct16BitSignedAccelerated = false; + shaderIntDotProperties->integerDotProduct16BitMixedSignednessAccelerated = false; + shaderIntDotProperties->integerDotProduct32BitUnsignedAccelerated = false; + shaderIntDotProperties->integerDotProduct32BitSignedAccelerated = false; + shaderIntDotProperties->integerDotProduct32BitMixedSignednessAccelerated = false; + shaderIntDotProperties->integerDotProduct64BitUnsignedAccelerated = false; + shaderIntDotProperties->integerDotProduct64BitSignedAccelerated = false; + shaderIntDotProperties->integerDotProduct64BitMixedSignednessAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating8BitSignedAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating16BitSignedAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating32BitSignedAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating64BitSignedAccelerated = false; + shaderIntDotProperties->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated = false; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: { auto* pushDescProps = (VkPhysicalDevicePushDescriptorPropertiesKHR*)next; pushDescProps->maxPushDescriptors = _properties.limits.maxPerStageResources; diff --git a/MoltenVK/MoltenVK/Layers/MVKExtensions.def b/MoltenVK/MoltenVK/Layers/MVKExtensions.def index a72be22c0..bbe08cd7b 100644 --- a/MoltenVK/MoltenVK/Layers/MVKExtensions.def +++ b/MoltenVK/MoltenVK/Layers/MVKExtensions.def @@ -86,6 +86,7 @@ MVK_EXTENSION(KHR_shader_atomic_int64, KHR_SHADER_ATOMIC_INT64, MVK_EXTENSION(KHR_shader_draw_parameters, KHR_SHADER_DRAW_PARAMETERS, DEVICE, 10.11, 8.0, 1.0) MVK_EXTENSION(KHR_shader_float_controls, KHR_SHADER_FLOAT_CONTROLS, DEVICE, 10.11, 8.0, 1.0) MVK_EXTENSION(KHR_shader_float16_int8, KHR_SHADER_FLOAT16_INT8, DEVICE, 10.11, 8.0, 1.0) +MVK_EXTENSION(KHR_shader_integer_dot_product, KHR_SHADER_INTEGER_DOT_PRODUCT, DEVICE, 10.11, 8.0, 1.0) MVK_EXTENSION(KHR_shader_non_semantic_info, KHR_SHADER_NON_SEMANTIC_INFO, DEVICE, 10.11, 8.0, 1.0) MVK_EXTENSION(KHR_shader_subgroup_extended_types, KHR_SHADER_SUBGROUP_EXTENDED_TYPES, DEVICE, 10.14, 13.0, 1.0) MVK_EXTENSION(KHR_spirv_1_4, KHR_SPIRV_1_4, DEVICE, 10.11, 8.0, 1.0)