Skip to content

Commit f0de07e

Browse files
committed
Add support for VK_KHR_shader_quad_control
1 parent b2d90ce commit f0de07e

File tree

6 files changed

+13
-1
lines changed

6 files changed

+13
-1
lines changed

Docs/MoltenVK_Runtime_UserGuide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ In addition to core *Vulkan* functionality, **MoltenVK** also supports the foll
285285
- `VK_KHR_shader_integer_dot_product`
286286
- `VK_KHR_shader_maximal_reconvergence`
287287
- `VK_KHR_shader_non_semantic_info`
288+
- `VK_KHR_shader_quad_control`
288289
- `VK_KHR_shader_relaxed_extended_instruction`
289290
- `VK_KHR_shader_subgroup_extended_types`
290291
- *Requires Metal 2.1 on Mac or Metal 2.2 and Apple family 4 on iOS.*

Docs/Whats_New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Released TBD
2525
- `VK_KHR_present_id`
2626
- `VK_KHR_present_wait`
2727
- `VK_KHR_shader_maximal_reconvergence`
28+
- `VK_KHR_shader_quad_control`
2829
- `VK_KHR_shader_relaxed_extended_instruction`
2930
- `VK_KHR_shader_subgroup_uniform_control_flow`
3031
- `VK_KHR_surface_protected_capabilities`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f1cb5b6634c58be69c327450d0023fb061f0f650
1+
22b22f5685d868828be01c9ac00c31902e60afd9

MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,11 @@
618618
shaderReconvergenceFeatures->shaderMaximalReconvergence = _gpuCapabilities.isAppleGPU;
619619
break;
620620
}
621+
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR: {
622+
auto* shaderQuadControlFeatures = (VkPhysicalDeviceShaderQuadControlFeaturesKHR*)next;
623+
shaderQuadControlFeatures->shaderQuadControl = _gpuCapabilities.isAppleGPU && _metalFeatures.quadPermute;
624+
break;
625+
}
621626
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR: {
622627
auto* shaderRelaxedFeatures = (VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR*)next;
623628
shaderRelaxedFeatures->shaderRelaxedExtendedInstruction = true;
@@ -3756,6 +3761,9 @@ static uint32_t mvkGetEntryProperty(io_registry_entry_t entry, CFStringRef prope
37563761
pWritableExtns->vk_KHR_shader_subgroup_uniform_control_flow.enabled = false;
37573762
pWritableExtns->vk_KHR_shader_maximal_reconvergence.enabled = false;
37583763
}
3764+
if (!_gpuCapabilities.isAppleGPU || !_metalFeatures.quadPermute) {
3765+
pWritableExtns->vk_KHR_shader_quad_control.enabled = false;
3766+
}
37593767
if (!_metalFeatures.samplerMirrorClampToEdge) {
37603768
pWritableExtns->vk_KHR_sampler_mirror_clamp_to_edge.enabled = false;
37613769
}

MoltenVK/MoltenVK/GPUObjects/MVKDeviceFeatureStructs.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ MVK_DEVICE_FEATURE_EXTN(PortabilitySubset, PORTABILITY_SUBSET,
8383
MVK_DEVICE_FEATURE_EXTN(PresentId, PRESENT_ID, KHR, 1)
8484
MVK_DEVICE_FEATURE_EXTN(PresentWait, PRESENT_WAIT, KHR, 1)
8585
MVK_DEVICE_FEATURE_EXTN(ShaderMaximalReconvergence, SHADER_MAXIMAL_RECONVERGENCE, KHR, 1)
86+
MVK_DEVICE_FEATURE_EXTN(ShaderQuadControl, SHADER_QUAD_CONTROL, KHR, 1)
8687
MVK_DEVICE_FEATURE_EXTN(ShaderRelaxedExtendedInstruction, SHADER_RELAXED_EXTENDED_INSTRUCTION, KHR, 1)
8788
MVK_DEVICE_FEATURE_EXTN(ShaderSubgroupUniformControlFlow, SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW, KHR, 1)
8889
MVK_DEVICE_FEATURE_EXTN(4444Formats, 4444_FORMATS, EXT, 2)

MoltenVK/MoltenVK/Layers/MVKExtensions.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ MVK_EXTENSION(KHR_shader_float_controls, KHR_SHADER_FLOAT_CONTROL
100100
MVK_EXTENSION(KHR_shader_integer_dot_product, KHR_SHADER_INTEGER_DOT_PRODUCT, DEVICE, 10.11, 8.0, 1.0)
101101
MVK_EXTENSION(KHR_shader_maximal_reconvergence, KHR_SHADER_MAXIMAL_RECONVERGENCE, DEVICE, 10.11, 8.0, 1.0)
102102
MVK_EXTENSION(KHR_shader_non_semantic_info, KHR_SHADER_NON_SEMANTIC_INFO, DEVICE, 10.11, 8.0, 1.0)
103+
MVK_EXTENSION(KHR_shader_quad_control, KHR_SHADER_QUAD_CONTROL, DEVICE, 10.14, 13.0, 1.0)
103104
MVK_EXTENSION(KHR_shader_relaxed_extended_instruction, KHR_SHADER_RELAXED_EXTENDED_INSTRUCTION, DEVICE, 10.11, 8.0, 1.0)
104105
MVK_EXTENSION(KHR_shader_subgroup_extended_types, KHR_SHADER_SUBGROUP_EXTENDED_TYPES, DEVICE, 10.14, 13.0, 1.0)
105106
MVK_EXTENSION(KHR_shader_subgroup_rotate, KHR_SHADER_SUBGROUP_ROTATE, DEVICE, 10.14, 13.0, 1.0)

0 commit comments

Comments
 (0)