Add Dual Source Blending Feature Enum
Adds dual source blending feature name to the Dawn feature enum.
Bug: dawn:1907
Change-Id: Ib3e0d028a1009607fa64e1a65197c8f8332b3b62
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/142341
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Brandon1 Jones <brandon1.jones@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/dawn.json b/dawn.json
index 0d51ca3..72908b7 100644
--- a/dawn.json
+++ b/dawn.json
@@ -1464,7 +1464,8 @@
{"value": 1007, "name": "implicit device synchronization", "tags": ["dawn", "native"]},
{"value": 1008, "name": "surface capabilities", "tags": ["dawn"]},
{"value": 1009, "name": "transient attachments", "tags": ["dawn"]},
- {"value": 1010, "name": "MSAA render to single sampled", "tags": ["dawn"]}
+ {"value": 1010, "name": "MSAA render to single sampled", "tags": ["dawn"]},
+ {"value": 1011, "name": "dual source blending", "tags": ["dawn"]}
]
},
"filter mode": {
diff --git a/docs/dawn/features/dual_source_blending.md b/docs/dawn/features/dual_source_blending.md
new file mode 100644
index 0000000..916537a
--- /dev/null
+++ b/docs/dawn/features/dual_source_blending.md
@@ -0,0 +1,5 @@
+# Dual Source Blending
+
+The `dual-source-blending` feature adds additional blend factors and the WGSL @index attribute to allow a fragment shader to output two colors to the same output buffer.
+
+TODO(dawn:1709): Add details about how to use this feature.
diff --git a/src/dawn/native/Features.cpp b/src/dawn/native/Features.cpp
index a63eb53..b50e22d 100644
--- a/src/dawn/native/Features.cpp
+++ b/src/dawn/native/Features.cpp
@@ -121,6 +121,13 @@
{"msaa-render-to-single-sampled",
"Support multisampled rendering on single-sampled attachments efficiently.",
"https://bugs.chromium.org/p/dawn/issues/detail?id=1710", FeatureInfo::FeatureState::Stable}},
+ {Feature::DualSourceBlending,
+ {"dual-source-blending",
+ "Support dual source blending. Enables Src1, OneMinusSrc1, Src1Alpha, and OneMinusSrc1Alpha "
+ "blend factors along with @index WGSL output attribute.",
+ "https://dawn.googlesource.com/dawn/+/refs/heads/main/docs/dawn/features/"
+ "dual_source_blending.md",
+ FeatureInfo::FeatureState::Experimental}},
}};
Feature FromAPIFeature(wgpu::FeatureName feature) {
@@ -173,6 +180,8 @@
return Feature::Float32Filterable;
case wgpu::FeatureName::MSAARenderToSingleSampled:
return Feature::MSAARenderToSingleSampled;
+ case wgpu::FeatureName::DualSourceBlending:
+ return Feature::DualSourceBlending;
}
return Feature::InvalidEnum;
}
@@ -221,7 +230,8 @@
return wgpu::FeatureName::Float32Filterable;
case Feature::MSAARenderToSingleSampled:
return wgpu::FeatureName::MSAARenderToSingleSampled;
-
+ case Feature::DualSourceBlending:
+ return wgpu::FeatureName::DualSourceBlending;
case Feature::EnumCount:
break;
}
diff --git a/src/dawn/native/Features.h b/src/dawn/native/Features.h
index ef27ff6..7a2fc2d 100644
--- a/src/dawn/native/Features.h
+++ b/src/dawn/native/Features.h
@@ -50,6 +50,7 @@
SurfaceCapabilities,
TransientAttachments,
MSAARenderToSingleSampled,
+ DualSourceBlending,
EnumCount,
InvalidEnum = EnumCount,
diff --git a/src/dawn/wire/SupportedFeatures.cpp b/src/dawn/wire/SupportedFeatures.cpp
index b85e39a..416b63f 100644
--- a/src/dawn/wire/SupportedFeatures.cpp
+++ b/src/dawn/wire/SupportedFeatures.cpp
@@ -45,6 +45,7 @@
case WGPUFeatureName_TransientAttachments:
case WGPUFeatureName_Float32Filterable:
case WGPUFeatureName_MSAARenderToSingleSampled:
+ case WGPUFeatureName_DualSourceBlending:
return true;
}