Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advertise VK_KHR_shader_terminate_invocation. #2424

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Docs/MoltenVK_Runtime_UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ In addition to core *Vulkan* functionality, **MoltenVK** also supports the foll
- `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.*
- `VK_KHR_shader_terminate_invocation`
- `VK_KHR_spirv_1_4`
- `VK_KHR_storage_buffer_storage_class`
- `VK_KHR_surface`
Expand Down
15 changes: 10 additions & 5 deletions MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@
shaderIntDotFeatures->shaderIntegerDotProduct = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: {
auto* terminateFeatures = (VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR*)next;
terminateFeatures->shaderTerminateInvocation = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
auto* formatFeatures = (VkPhysicalDevice4444FormatsFeaturesEXT*)next;
bool canSupport4444 = _metalFeatures.tileBasedDeferredRendering &&
Expand All @@ -468,6 +473,11 @@
formatFeatures->formatA4B4G4R4 = canSupport4444;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: {
auto* depthFeatures = (VkPhysicalDeviceDepthClipControlFeaturesEXT*)next;
depthFeatures->depthClipControl = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
auto* extDynState = (VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*)next;
extDynState->extendedDynamicState = true;
Expand Down Expand Up @@ -577,11 +587,6 @@
divisorFeatures->vertexAttributeInstanceRateZeroDivisor = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: {
auto* depthFeatures = (VkPhysicalDeviceDepthClipControlFeaturesEXT*)next;
depthFeatures->depthClipControl = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
auto* shaderIntFuncsFeatures = (VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*)next;
shaderIntFuncsFeatures->shaderIntegerFunctions2 = true;
Expand Down
2 changes: 2 additions & 0 deletions MoltenVK/MoltenVK/GPUObjects/MVKDeviceFeatureStructs.def
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ MVK_DEVICE_FEATURE(VariablePointer, VARIABLE_POINTER,
MVK_DEVICE_FEATURE(VulkanMemoryModel, VULKAN_MEMORY_MODEL, 3)
MVK_DEVICE_FEATURE_EXTN(FragmentShaderBarycentric, FRAGMENT_SHADER_BARYCENTRIC, KHR, 1)
MVK_DEVICE_FEATURE_EXTN(PortabilitySubset, PORTABILITY_SUBSET, KHR, 15)
MVK_DEVICE_FEATURE_EXTN(ShaderTerminateInvocation, SHADER_TERMINATE_INVOCATION, KHR, 1)
MVK_DEVICE_FEATURE_EXTN(4444Formats, 4444_FORMATS, EXT, 2)
MVK_DEVICE_FEATURE_EXTN(DepthClipControl, DEPTH_CLIP_CONTROL, EXT, 1)
MVK_DEVICE_FEATURE_EXTN(ExtendedDynamicState, EXTENDED_DYNAMIC_STATE, EXT, 1)
MVK_DEVICE_FEATURE_EXTN(ExtendedDynamicState2, EXTENDED_DYNAMIC_STATE_2, EXT, 3)
MVK_DEVICE_FEATURE_EXTN(ExtendedDynamicState3, EXTENDED_DYNAMIC_STATE_3, EXT, 31)
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 @@ -89,6 +89,7 @@ MVK_EXTENSION(KHR_shader_float16_int8, KHR_SHADER_FLOAT16_INT8,
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_shader_terminate_invocation, KHR_SHADER_TERMINATE_INVOCATION, DEVICE, 10.11, 8.0, 1.0)
MVK_EXTENSION(KHR_spirv_1_4, KHR_SPIRV_1_4, DEVICE, 10.11, 8.0, 1.0)
MVK_EXTENSION(KHR_storage_buffer_storage_class, KHR_STORAGE_BUFFER_STORAGE_CLASS, DEVICE, 10.11, 8.0, 1.0)
MVK_EXTENSION(KHR_surface, KHR_SURFACE, INSTANCE, 10.11, 8.0, 1.0)
Expand Down