[YCbCr Samplers] Reland Rename SamplerYCbCrVulkanDesc to YCbCrVulkanDesc

Rename SamplerYCbCrVulkanDescriptor to YCbCrVulkanDescriptor prior to
using it with TextureViewDescriptor.

Change-Id: I839a7b2326bbc1f8495aee38e3a92acdcde1fbbd
Bug: dawn:2476
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/185080
Commit-Queue: Saifuddin Hitawala <hitawala@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/include/dawn/native/VulkanBackend.h b/include/dawn/native/VulkanBackend.h
index 0aad920..bc644ec 100644
--- a/include/dawn/native/VulkanBackend.h
+++ b/include/dawn/native/VulkanBackend.h
@@ -83,8 +83,8 @@
 };
 
 // Can be chained in WGPUSamplerDescriptor
-struct DAWN_NATIVE_EXPORT SamplerYCbCrVulkanDescriptor : wgpu::ChainedStruct {
-    SamplerYCbCrVulkanDescriptor();
+struct DAWN_NATIVE_EXPORT YCbCrVulkanDescriptor : wgpu::ChainedStruct {
+    YCbCrVulkanDescriptor();
 
     ::VkSamplerYcbcrConversionCreateInfo vulkanYCbCrInfo;
 };
diff --git a/src/dawn/dawn.json b/src/dawn/dawn.json
index fa93285..4e103af 100644
--- a/src/dawn/dawn.json
+++ b/src/dawn/dawn.json
@@ -3745,7 +3745,7 @@
             {"value": 1214, "name": "shared fence MTL shared event export info", "tags": ["dawn", "native"]},
             {"value": 1215, "name": "shared buffer memory D3D12 resource descriptor", "tags": ["dawn", "native"]},
             {"value": 1216, "name": "static sampler binding layout", "tags": ["dawn"]},
-            {"value": 1217, "name": "sampler y cb cr vulkan descriptor", "tags": ["dawn", "native"]}
+            {"value": 1217, "name": "y cb cr vulkan descriptor", "tags": ["dawn", "native"]}
         ]
     },
     "texture": {
diff --git a/src/dawn/native/ChainUtilsImpl.inl b/src/dawn/native/ChainUtilsImpl.inl
index 8b36ce7..6850ad3 100644
--- a/src/dawn/native/ChainUtilsImpl.inl
+++ b/src/dawn/native/ChainUtilsImpl.inl
@@ -50,7 +50,7 @@
 }
 
 namespace vulkan {
-struct SamplerYCbCrVulkanDescriptor;
+struct YCbCrVulkanDescriptor;
 }
 
 namespace detail {
@@ -104,13 +104,13 @@
 };
 
 template <>
-constexpr inline wgpu::SType STypeForImpl<vulkan::SamplerYCbCrVulkanDescriptor> =
-    wgpu::SType(WGPUSType_SamplerYCbCrVulkanDescriptor);
+constexpr inline wgpu::SType STypeForImpl<vulkan::YCbCrVulkanDescriptor> =
+    wgpu::SType(WGPUSType_YCbCrVulkanDescriptor);
 
 template <>
 struct AdditionalExtensions<SamplerDescriptor> {
     using List =
-        AdditionalExtensionsList<const vulkan::SamplerYCbCrVulkanDescriptor*>;
+        AdditionalExtensionsList<const vulkan::YCbCrVulkanDescriptor*>;
 };
 
 }  // namespace detail
diff --git a/src/dawn/native/Sampler.cpp b/src/dawn/native/Sampler.cpp
index 098a564..4bab8c0 100644
--- a/src/dawn/native/Sampler.cpp
+++ b/src/dawn/native/Sampler.cpp
@@ -37,7 +37,7 @@
 namespace dawn::native {
 
 namespace vulkan {
-struct SamplerYCbCrVulkanDescriptor;
+struct YCbCrVulkanDescriptor;
 }
 
 MaybeError ValidateSamplerDescriptor(DeviceBase* device, const SamplerDescriptor* descriptor) {
@@ -76,7 +76,7 @@
 
     UnpackedPtr<SamplerDescriptor> unpacked = Unpack(descriptor);
 
-    if (unpacked.Get<vulkan::SamplerYCbCrVulkanDescriptor>()) {
+    if (unpacked.Get<vulkan::YCbCrVulkanDescriptor>()) {
         DAWN_INVALID_IF(!device->HasFeature(Feature::YCbCrVulkanSamplers), "%s is not enabled.",
                         wgpu::FeatureName::YCbCrVulkanSamplers);
     }
@@ -100,7 +100,7 @@
       mLodMaxClamp(descriptor->lodMaxClamp),
       mCompareFunction(descriptor->compare),
       mMaxAnisotropy(descriptor->maxAnisotropy) {
-    if (Unpack(descriptor).Get<vulkan::SamplerYCbCrVulkanDescriptor>()) {
+    if (Unpack(descriptor).Get<vulkan::YCbCrVulkanDescriptor>()) {
         mIsYCbCr = true;
     }
 }
diff --git a/src/dawn/native/vulkan/BackendVk.cpp b/src/dawn/native/vulkan/BackendVk.cpp
index acad9cdb..001a988 100644
--- a/src/dawn/native/vulkan/BackendVk.cpp
+++ b/src/dawn/native/vulkan/BackendVk.cpp
@@ -283,8 +283,8 @@
 
 }  // anonymous namespace
 
-SamplerYCbCrVulkanDescriptor::SamplerYCbCrVulkanDescriptor() {
-    sType = wgpu::SType::SamplerYCbCrVulkanDescriptor;
+YCbCrVulkanDescriptor::YCbCrVulkanDescriptor() {
+    sType = wgpu::SType::YCbCrVulkanDescriptor;
 }
 
 VulkanInstance::VulkanInstance() = default;
diff --git a/src/dawn/native/vulkan/SamplerVk.cpp b/src/dawn/native/vulkan/SamplerVk.cpp
index e931213..4f3e334 100644
--- a/src/dawn/native/vulkan/SamplerVk.cpp
+++ b/src/dawn/native/vulkan/SamplerVk.cpp
@@ -122,8 +122,7 @@
     }
 
     VkSamplerYcbcrConversionInfo samplerYCbCrInfo = {};
-    if (auto* vulkanYCbCrDescriptor =
-            Unpack(descriptor).Get<vulkan::SamplerYCbCrVulkanDescriptor>()) {
+    if (auto* vulkanYCbCrDescriptor = Unpack(descriptor).Get<vulkan::YCbCrVulkanDescriptor>()) {
         const VkSamplerYcbcrConversionCreateInfo& vulkanYCbCrInfo =
             vulkanYCbCrDescriptor->vulkanYCbCrInfo;
 #if DAWN_PLATFORM_IS(ANDROID)
diff --git a/src/dawn/tests/end2end/YCbCrSamplerTests.cpp b/src/dawn/tests/end2end/YCbCrSamplerTests.cpp
index fadb9a6..795b3f1 100644
--- a/src/dawn/tests/end2end/YCbCrSamplerTests.cpp
+++ b/src/dawn/tests/end2end/YCbCrSamplerTests.cpp
@@ -59,7 +59,7 @@
 // Test that it is possible to create the sampler with ycbcr sampler descriptor.
 TEST_P(YCbCrSamplerTest, YCbCrSamplerValidWhenFeatureEnabled) {
     wgpu::SamplerDescriptor samplerDesc = {};
-    native::vulkan::SamplerYCbCrVulkanDescriptor samplerYCbCrDesc = {};
+    native::vulkan::YCbCrVulkanDescriptor samplerYCbCrDesc = {};
     samplerYCbCrDesc.vulkanYCbCrInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO;
     samplerYCbCrDesc.vulkanYCbCrInfo.pNext = nullptr;
     samplerYCbCrDesc.vulkanYCbCrInfo.format = VK_FORMAT_R8G8B8A8_UNORM;
@@ -73,7 +73,7 @@
 // format set.
 TEST_P(YCbCrSamplerTest, YCbCrSamplerValidWithOnlyVkFormat) {
     wgpu::SamplerDescriptor samplerDesc = {};
-    native::vulkan::SamplerYCbCrVulkanDescriptor samplerYCbCrDesc = {};
+    native::vulkan::YCbCrVulkanDescriptor samplerYCbCrDesc = {};
     samplerYCbCrDesc.vulkanYCbCrInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO;
     samplerYCbCrDesc.vulkanYCbCrInfo.pNext = nullptr;
     samplerYCbCrDesc.vulkanYCbCrInfo.format = VK_FORMAT_R8G8B8A8_UNORM;
@@ -97,7 +97,7 @@
 // format set.
 TEST_P(YCbCrSamplerTest, YCbCrSamplerValidWithOnlyExternalFormat) {
     wgpu::SamplerDescriptor samplerDesc = {};
-    native::vulkan::SamplerYCbCrVulkanDescriptor samplerYCbCrDesc = {};
+    native::vulkan::YCbCrVulkanDescriptor samplerYCbCrDesc = {};
     samplerYCbCrDesc.vulkanYCbCrInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO;
     samplerYCbCrDesc.vulkanYCbCrInfo.pNext = nullptr;
     // format is set as externalFormat.
@@ -121,7 +121,7 @@
 // set.
 TEST_P(YCbCrSamplerTest, YCbCrSamplerInvalidWithNoFormat) {
     wgpu::SamplerDescriptor samplerDesc = {};
-    native::vulkan::SamplerYCbCrVulkanDescriptor samplerYCbCrDesc = {};
+    native::vulkan::YCbCrVulkanDescriptor samplerYCbCrDesc = {};
     samplerYCbCrDesc.vulkanYCbCrInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO;
     samplerYCbCrDesc.vulkanYCbCrInfo.pNext = nullptr;
     samplerYCbCrDesc.vulkanYCbCrInfo.format = VK_FORMAT_UNDEFINED;
diff --git a/src/dawn/tests/unittests/validation/YCbCrSamplerValidationTests.cpp b/src/dawn/tests/unittests/validation/YCbCrSamplerValidationTests.cpp
index 1ad87a4..e20e1ac 100644
--- a/src/dawn/tests/unittests/validation/YCbCrSamplerValidationTests.cpp
+++ b/src/dawn/tests/unittests/validation/YCbCrSamplerValidationTests.cpp
@@ -44,7 +44,7 @@
 // if the required feature is not enabled.
 TEST_F(YCbCrSamplerValidationTest, YCbCrSamplerNotSupportedWithoutFeatureEnabled) {
     wgpu::SamplerDescriptor samplerDesc = {};
-    native::vulkan::SamplerYCbCrVulkanDescriptor samplerYCbCrDesc = {};
+    native::vulkan::YCbCrVulkanDescriptor samplerYCbCrDesc = {};
     samplerDesc.nextInChain = &samplerYCbCrDesc;
 
     ASSERT_DEVICE_ERROR(device.CreateSampler(&samplerDesc));
@@ -64,7 +64,7 @@
 // required feature is enabled.
 TEST_F(YCbCrSamplerWithFeatureValidationTest, YCbCrSamplerSupportedWhenFeatureEnabled) {
     wgpu::SamplerDescriptor samplerDesc = {};
-    native::vulkan::SamplerYCbCrVulkanDescriptor samplerYCbCrDesc = {};
+    native::vulkan::YCbCrVulkanDescriptor samplerYCbCrDesc = {};
     samplerYCbCrDesc.vulkanYCbCrInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO;
     samplerDesc.nextInChain = &samplerYCbCrDesc;