Add depth-clip-control feature enum

Not implemented on any of the backends yet. The feature
has CTS coverage so tests can be enabled as implementation
is written.

Bug: dawn:1178
Change-Id: Ib0fa39346a42cbd996d3c42bf779767d159067e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93309
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/dawn.json b/dawn.json
index d6cbc6b..d3eac41 100644
--- a/dawn.json
+++ b/dawn.json
@@ -1344,7 +1344,7 @@
         "category": "enum",
         "values": [
             {"value": 0, "name": "undefined", "jsrepr": "undefined"},
-            {"value": 1, "name": "depth clip control", "tags": ["upstream", "emscripten"]},
+            {"value": 1, "name": "depth clip control"},
             {"value": 2, "name": "depth24 unorm stencil8"},
             {"value": 3, "name": "depth32 float stencil8"},
             {"value": 4, "name": "timestamp query"},
@@ -2141,7 +2141,6 @@
     "primitive depth clip control": {
         "category": "structure",
         "chained": "in",
-        "tags": ["upstream", "emscripten"],
         "members": [
             {"name": "unclipped depth", "type": "bool", "default": "false"}
         ]
@@ -2469,7 +2468,7 @@
             {"value": 4, "name": "surface descriptor from canvas HTML selector"},
             {"value": 5, "name": "shader module SPIRV descriptor"},
             {"value": 6, "name": "shader module WGSL descriptor"},
-            {"value": 7, "name": "primitive depth clip control", "tags": ["upstream", "emscripten"]},
+            {"value": 7, "name": "primitive depth clip control"},
             {"value": 8, "name": "surface descriptor from wayland surface", "tags": ["native"]},
             {"value": 9, "name": "surface descriptor from android native window", "tags": ["native"]},
             {"value": 10, "name": "surface descriptor from xcb window", "tags": ["upstream"]},
diff --git a/src/dawn/native/Features.cpp b/src/dawn/native/Features.cpp
index 7929a92..7a8b2e9 100644
--- a/src/dawn/native/Features.cpp
+++ b/src/dawn/native/Features.cpp
@@ -55,6 +55,9 @@
     {Feature::TimestampQuery,
      {"timestamp-query", "Support Timestamp Query",
       "https://bugs.chromium.org/p/dawn/issues/detail?id=434"}},
+    {Feature::DepthClipControl,
+     {"depth-clip-control", "Disable depth clipping of primitives to the clip volume",
+      "https://bugs.chromium.org/p/dawn/issues/detail?id=1178"}},
     {Feature::DepthClamping,
      {"depth-clamping", "Clamp depth to [0, 1] in NDC space instead of clipping",
       "https://bugs.chromium.org/p/dawn/issues/detail?id=716"}},
@@ -100,6 +103,8 @@
             return Feature::TextureCompressionETC2;
         case wgpu::FeatureName::TextureCompressionASTC:
             return Feature::TextureCompressionASTC;
+        case wgpu::FeatureName::DepthClipControl:
+            return Feature::DepthClipControl;
         case wgpu::FeatureName::DepthClamping:
             return Feature::DepthClamping;
         case wgpu::FeatureName::Depth24UnormStencil8:
@@ -134,6 +139,8 @@
             return wgpu::FeatureName::PipelineStatisticsQuery;
         case Feature::TimestampQuery:
             return wgpu::FeatureName::TimestampQuery;
+        case Feature::DepthClipControl:
+            return wgpu::FeatureName::DepthClipControl;
         case Feature::DepthClamping:
             return wgpu::FeatureName::DepthClamping;
         case Feature::Depth24UnormStencil8:
diff --git a/src/dawn/native/Features.h b/src/dawn/native/Features.h
index 3f4318b..4846b03 100644
--- a/src/dawn/native/Features.h
+++ b/src/dawn/native/Features.h
@@ -33,6 +33,7 @@
     ShaderFloat16,
     PipelineStatisticsQuery,
     TimestampQuery,
+    DepthClipControl,
     DepthClamping,
     Depth24UnormStencil8,
     Depth32FloatStencil8,
diff --git a/src/dawn/node/binding/GPUAdapter.cpp b/src/dawn/node/binding/GPUAdapter.cpp
index 58b89b6..a2d7248 100644
--- a/src/dawn/node/binding/GPUAdapter.cpp
+++ b/src/dawn/node/binding/GPUAdapter.cpp
@@ -113,12 +113,14 @@
                 case wgpu::FeatureName::IndirectFirstInstance:
                     enabled_.emplace(interop::GPUFeatureName::kIndirectFirstInstance);
                     break;
+                case wgpu::FeatureName::DepthClipControl:
+                    enabled_.emplace(interop::GPUFeatureName::kDepthClipControl);
+                    break;
                 default:
                     break;
             }
         }
         // TODO(dawn:1123) add support for these extensions when possible.
-        // wgpu::interop::GPUFeatureName::kDepthClipControl
         // wgpu::interop::GPUFeatureName::kShaderF16
         // wgpu::interop::GPUFeatureName::kBgra8UnormStorage
     }
diff --git a/src/dawn/wire/SupportedFeatures.cpp b/src/dawn/wire/SupportedFeatures.cpp
index 0e5688a..352ed0f 100644
--- a/src/dawn/wire/SupportedFeatures.cpp
+++ b/src/dawn/wire/SupportedFeatures.cpp
@@ -32,6 +32,7 @@
         case WGPUFeatureName_TextureCompressionETC2:
         case WGPUFeatureName_TextureCompressionASTC:
         case WGPUFeatureName_IndirectFirstInstance:
+        case WGPUFeatureName_DepthClipControl:
         case WGPUFeatureName_DepthClamping:
         case WGPUFeatureName_DawnShaderFloat16:
         case WGPUFeatureName_DawnInternalUsages: