[YCbCr Samplers] Add SampleTypeBit::External
This adds SampleTypeBit::External and adds support in
AddConditionalColorFormat.
Note: It does not add corresponding wgpu::TextureSampleType as we
only need it internally and does not need to be exposed. Accordingly
it is set to a high value for future SampleTypeBit that can be added.
Change-Id: I68fef904d3963910e96146a973d333d87365dab5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/190160
Commit-Queue: Saifuddin Hitawala <hitawala@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn/native/Format.cpp b/src/dawn/native/Format.cpp
index 0af9b9f..75c54d9 100644
--- a/src/dawn/native/Format.cpp
+++ b/src/dawn/native/Format.cpp
@@ -266,6 +266,7 @@
switch (sampleTypes) {
case SampleTypeBit::Float:
case SampleTypeBit::UnfilterableFloat:
+ case SampleTypeBit::External:
firstAspect->baseType = TextureComponentType::Float;
break;
case SampleTypeBit::Sint:
diff --git a/src/dawn/native/Format.h b/src/dawn/native/Format.h
index 1cabb2d..ca94056 100644
--- a/src/dawn/native/Format.h
+++ b/src/dawn/native/Format.h
@@ -64,6 +64,9 @@
class DeviceBase;
// This mirrors wgpu::TextureSampleType as a bitmask instead.
+// NOTE: SampleTypeBit::External does not have an equivalent TextureSampleType. All future
+// additions to SampleTypeBit that have an equivalent TextureSampleType should use
+// SampleTypeBit::External's value and update SampleTypeBit::External to a higher value.
enum class SampleTypeBit : uint8_t {
None = 0x0,
Float = 0x1,
@@ -71,6 +74,7 @@
Depth = 0x4,
Sint = 0x8,
Uint = 0x10,
+ External = 0x20,
};
// Converts a wgpu::TextureSampleType to its bitmask representation.