Skip to content

Commit

Permalink
Add: KHR_shader_integer_dot_product
Browse files Browse the repository at this point in the history
  • Loading branch information
spnda committed Jan 7, 2024
1 parent d481226 commit ec32b2e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions Docs/MoltenVK_Runtime_UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down
39 changes: 39 additions & 0 deletions MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions MoltenVK/MoltenVK/Layers/MVKExtensions.def
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ec32b2e

Please sign in to comment.