Add depth-clamping support for Metal
This CL adds depth clamping support to Metal by invoking
MTLRenderCommandEncoder::setDepthClipMode. I only implemented the
feature for the new-style of RenderPipelineDescriptor since the
old one seems to be deprecated.
Bug: dawn:716
Change-Id: Icd63c72294546042ae452360863a7f9c16b40f95
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45640
Commit-Queue: Brian Ho <hob@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_native/Extensions.cpp b/src/dawn_native/Extensions.cpp
index 98d4a61..47b2481 100644
--- a/src/dawn_native/Extensions.cpp
+++ b/src/dawn_native/Extensions.cpp
@@ -52,7 +52,11 @@
{"multiplanar_formats",
"Import and use multi-planar texture formats with per plane views",
"https://bugs.chromium.org/p/dawn/issues/detail?id=551"},
- &WGPUDeviceProperties::multiPlanarFormats}}};
+ &WGPUDeviceProperties::multiPlanarFormats},
+ {Extension::DepthClamping,
+ {"depth_clamping", "Clamp depth to [0, 1] in NDC space instead of clipping",
+ "https://bugs.chromium.org/p/dawn/issues/detail?id=716"},
+ &WGPUDeviceProperties::depthClamping}}};
} // anonymous namespace