dawn: make shader-f16 feature stable

This CL make shader-f16 feature from experimental to stable, so that it
is exposed without AllowUnsafeAPIs toggle. This CL also make some clean
up on related tests.

Bug: dawn:1510
Change-Id: I4dfe2a7d852719484ba3684ab6168432823af934
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/153922
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn/native/Features.cpp b/src/dawn/native/Features.cpp
index da802c5..c6d416c 100644
--- a/src/dawn/native/Features.cpp
+++ b/src/dawn/native/Features.cpp
@@ -88,8 +88,7 @@
       "https://bugs.chromium.org/p/dawn/issues/detail?id=1197", FeatureInfo::FeatureState::Stable}},
     {Feature::ShaderF16,
      {"Supports the \"enable f16;\" directive in WGSL",
-      "https://bugs.chromium.org/p/dawn/issues/detail?id=1510",
-      FeatureInfo::FeatureState::Experimental}},
+      "https://bugs.chromium.org/p/dawn/issues/detail?id=1510", FeatureInfo::FeatureState::Stable}},
     {Feature::RG11B10UfloatRenderable,
      {"Allows the RENDER_ATTACHMENT usage on textures with format \"rg11b10ufloat\", and also "
       "allows textures of that format to be multisampled.",
diff --git a/src/dawn/tests/end2end/ComputeLayoutMemoryBufferTests.cpp b/src/dawn/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
index 8ca8d30..d88fb06 100644
--- a/src/dawn/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
+++ b/src/dawn/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
@@ -562,9 +562,9 @@
 
     const Field& field = GetParam().mField;
 
-    if (field.IsRequireF16Feature() && !device.HasFeature(wgpu::FeatureName::ShaderF16)) {
-        return;
-    }
+    // Skip if device don't support f16 extension.
+    DAWN_TEST_UNSUPPORTED_IF(field.IsRequireF16Feature() &&
+                             !device.HasFeature(wgpu::FeatureName::ShaderF16));
 
     std::string shader = std::string(field.IsRequireF16Feature() ? "enable f16;" : "") +
                          R"(
@@ -725,9 +725,9 @@
         return;
     }
 
-    if (field.IsRequireF16Feature() && !device.HasFeature(wgpu::FeatureName::ShaderF16)) {
-        return;
-    }
+    // Skip if device don't support f16 extension.
+    DAWN_TEST_UNSUPPORTED_IF(field.IsRequireF16Feature() &&
+                             !device.HasFeature(wgpu::FeatureName::ShaderF16));
 
     std::string shader = std::string(field.IsRequireF16Feature() ? "enable f16;" : "") +
                          R"(
diff --git a/src/dawn/tests/end2end/ShaderF16Tests.cpp b/src/dawn/tests/end2end/ShaderF16Tests.cpp
index 7a4822d..72a6c6c 100644
--- a/src/dawn/tests/end2end/ShaderF16Tests.cpp
+++ b/src/dawn/tests/end2end/ShaderF16Tests.cpp
@@ -111,9 +111,8 @@
         GetParam().mRequireShaderF16Feature &&
         // Adapter support the feature
         IsShaderF16SupportedOnAdapter() &&
-        // Proper toggle, allow_unsafe_apis and use_dxc if d3d12
-        // Note that "allow_unsafe_apis" is always enabled in DawnTestBase::CreateDeviceImpl.
-        HasToggleEnabled("allow_unsafe_apis") && UseDxcEnabledOrNonD3D12();
+        // Proper toggle, use_dxc if d3d12
+        UseDxcEnabledOrNonD3D12();
     const bool deviceSupportShaderF16Feature = device.HasFeature(wgpu::FeatureName::ShaderF16);
     EXPECT_EQ(deviceSupportShaderF16Feature, shouldShaderF16FeatureSupportedByDevice);
 
diff --git a/src/dawn/tests/unittests/validation/ShaderModuleValidationTests.cpp b/src/dawn/tests/unittests/validation/ShaderModuleValidationTests.cpp
index 66380ec..67fe96d 100644
--- a/src/dawn/tests/unittests/validation/ShaderModuleValidationTests.cpp
+++ b/src/dawn/tests/unittests/validation/ShaderModuleValidationTests.cpp
@@ -793,7 +793,7 @@
 };
 
 constexpr struct WGSLExtensionInfo kExtensions[] = {
-    {"f16", true, "shader-f16"},
+    {"f16", false, "shader-f16"},
     {"chromium_experimental_dp4a", true, "chromium-experimental-dp4a"},
     {"chromium_experimental_subgroups", true, "chromium-experimental-subgroups"},
     {"chromium_disable_uniformity_analysis", true, nullptr},