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>
This commit is contained in:
Austin Eng 2022-06-13 19:18:55 +00:00 committed by Dawn LUCI CQ
parent 1faf5921c6
commit 51d13a4fa4
5 changed files with 14 additions and 4 deletions

View File

@ -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"]},

View File

@ -55,6 +55,9 @@ static constexpr FeatureEnumAndInfoList kFeatureNameAndInfoList = {{
{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 @@ Feature FromAPIFeature(wgpu::FeatureName feature) {
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 @@ wgpu::FeatureName ToAPIFeature(Feature feature) {
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:

View File

@ -33,6 +33,7 @@ enum class Feature {
ShaderFloat16,
PipelineStatisticsQuery,
TimestampQuery,
DepthClipControl,
DepthClamping,
Depth24UnormStencil8,
Depth32FloatStencil8,

View File

@ -113,12 +113,14 @@ class Features : public interop::GPUSupportedFeatures {
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
}

View File

@ -32,6 +32,7 @@ bool IsFeatureSupported(WGPUFeatureName feature) {
case WGPUFeatureName_TextureCompressionETC2:
case WGPUFeatureName_TextureCompressionASTC:
case WGPUFeatureName_IndirectFirstInstance:
case WGPUFeatureName_DepthClipControl:
case WGPUFeatureName_DepthClamping:
case WGPUFeatureName_DawnShaderFloat16:
case WGPUFeatureName_DawnInternalUsages: