[dawn] Begin deprecation of SubgroupsF16 feature; step 1
This change drops Subgroups support for Vulkan devices that support
ShaderF16 but not SubgroupsF16. This is a very narrow set of devices
estimated to be 4%. [0]
No immediate changes are required for D3D or Metal as support for
extended types (f16) is consistent with subgroup operations.
[0]
https://github.com/gpuweb/gpuweb/blob/main/proposals/subgroups.md#enable-extension
Bug:380244620
Change-Id: I81c31fa8b3ce5d664e98f3b7a6c74c8d512c3ed6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/217474
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Peter McNeeley <petermcneeley@google.com>
diff --git a/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp b/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
index b8fc14d..d95fe66 100644
--- a/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
+++ b/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
@@ -167,6 +167,7 @@
if (GetBackend()->IsDXCAvailable() && mDeviceInfo.supportsWaveOps) {
EnableFeature(Feature::Subgroups);
// D3D12 devices that support both native f16 and wave ops can support subgroups-f16.
+ // TODO(crbug.com/380244620): Remove when 'subgroups_f16' has been fully deprecated.
if (shaderF16Enabled) {
EnableFeature(Feature::SubgroupsF16);
}
diff --git a/src/dawn/native/vulkan/DeviceVk.cpp b/src/dawn/native/vulkan/DeviceVk.cpp
index 0216c97..3d22b86 100644
--- a/src/dawn/native/vulkan/DeviceVk.cpp
+++ b/src/dawn/native/vulkan/DeviceVk.cpp
@@ -504,7 +504,8 @@
}
// Set device feature for subgroups with f16 types.
- if (HasFeature(Feature::SubgroupsF16)) {
+ if (HasFeature(Feature::SubgroupsF16) ||
+ (HasFeature(Feature::ShaderF16) && HasFeature(Feature::Subgroups))) {
DAWN_ASSERT(usedKnobs.HasExt(DeviceExt::ShaderSubgroupExtendedTypes) &&
mDeviceInfo.shaderSubgroupExtendedTypes.shaderSubgroupExtendedTypes ==
VK_TRUE &&
diff --git a/src/dawn/native/vulkan/PhysicalDeviceVk.cpp b/src/dawn/native/vulkan/PhysicalDeviceVk.cpp
index f81e7fc..3306fb9 100644
--- a/src/dawn/native/vulkan/PhysicalDeviceVk.cpp
+++ b/src/dawn/native/vulkan/PhysicalDeviceVk.cpp
@@ -406,15 +406,24 @@
(mDeviceInfo.HasExt(DeviceExt::SubgroupSizeControl)) &&
(mDeviceInfo.subgroupSizeControlFeatures.subgroupSizeControl == VK_TRUE) &&
(mDeviceInfo.subgroupSizeControlFeatures.computeFullSubgroups == VK_TRUE)) {
- EnableFeature(Feature::Subgroups);
- // Enable SubgroupsF16 feature if:
- // 1. Subgroups feature is enabled, and
- // 2. ShaderF16 feature is enabled, and
- // 3. shaderSubgroupExtendedTypes is TRUE in
- // VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR.
- if (shaderF16Enabled &&
- mDeviceInfo.shaderSubgroupExtendedTypes.shaderSubgroupExtendedTypes == VK_TRUE) {
- EnableFeature(Feature::SubgroupsF16);
+ if (shaderF16Enabled) {
+ if (mDeviceInfo.shaderSubgroupExtendedTypes.shaderSubgroupExtendedTypes == VK_TRUE) {
+ // Enable SubgroupsF16 feature if:
+ // 1. Subgroups feature is enabled, and
+ // 2. ShaderF16 feature is enabled, and
+ // 3. shaderSubgroupExtendedTypes is TRUE in
+ // VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR.
+ // TODO(crbug.com/380244620): Remove when 'subgroups_f16' has been fully deprecated.
+ EnableFeature(Feature::SubgroupsF16);
+ // If shader f16 is enable we only enable subgroups if we extended subgroup support.
+ // This means there is a vary narrow number of devices (~4%) will not get subgroup
+ // support due to the fact that they support shader f16 but not actually f16
+ // operations in subgroups.
+ EnableFeature(Feature::Subgroups);
+ }
+ } else {
+ // Subgroups without extended type support (f16).
+ EnableFeature(Feature::Subgroups);
}
}