Rename DawnColorStateDescriptor.colorWriteMask to writeMask

Bug: chromium:877147
Change-Id: I566cea409b89de8abd724f344f7ae83f80e56572
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6600
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
diff --git a/dawn.json b/dawn.json
index d1c321f..6044c96 100644
--- a/dawn.json
+++ b/dawn.json
@@ -121,7 +121,7 @@
             {"name": "format", "type": "texture format"},
             {"name": "alpha blend", "type": "blend descriptor"},
             {"name": "color blend", "type": "blend descriptor"},
-            {"name": "color write mask", "type": "color write mask"}
+            {"name": "write mask", "type": "color write mask"}
         ]
     },
     "bool": {
diff --git a/examples/CHelloTriangle.cpp b/examples/CHelloTriangle.cpp
index d999868..5a5d8bb 100644
--- a/examples/CHelloTriangle.cpp
+++ b/examples/CHelloTriangle.cpp
@@ -81,7 +81,7 @@
         colorStateDescriptor.format = swapChainFormat;
         colorStateDescriptor.alphaBlend = blendDescriptor;
         colorStateDescriptor.colorBlend = blendDescriptor;
-        colorStateDescriptor.colorWriteMask = DAWN_COLOR_WRITE_MASK_ALL;
+        colorStateDescriptor.writeMask = DAWN_COLOR_WRITE_MASK_ALL;
 
         descriptor.colorStateCount = 1;
         DawnColorStateDescriptor* colorStatesPtr[] = {&colorStateDescriptor};
diff --git a/src/dawn_native/RenderPipeline.cpp b/src/dawn_native/RenderPipeline.cpp
index 7fddfc0..4aa206f 100644
--- a/src/dawn_native/RenderPipeline.cpp
+++ b/src/dawn_native/RenderPipeline.cpp
@@ -117,7 +117,7 @@
             DAWN_TRY(ValidateBlendOperation(descriptor->colorBlend.operation));
             DAWN_TRY(ValidateBlendFactor(descriptor->colorBlend.srcFactor));
             DAWN_TRY(ValidateBlendFactor(descriptor->colorBlend.dstFactor));
-            DAWN_TRY(ValidateColorWriteMask(descriptor->colorWriteMask));
+            DAWN_TRY(ValidateColorWriteMask(descriptor->writeMask));
 
             dawn::TextureFormat format = descriptor->format;
             DAWN_TRY(ValidateTextureFormat(format));
diff --git a/src/dawn_native/d3d12/RenderPipelineD3D12.cpp b/src/dawn_native/d3d12/RenderPipelineD3D12.cpp
index 2cc719b..5df00b1 100644
--- a/src/dawn_native/d3d12/RenderPipelineD3D12.cpp
+++ b/src/dawn_native/d3d12/RenderPipelineD3D12.cpp
@@ -188,7 +188,7 @@
             }
         }
 
-        uint8_t D3D12RenderTargetWriteMask(dawn::ColorWriteMask colorWriteMask) {
+        uint8_t D3D12RenderTargetWriteMask(dawn::ColorWriteMask writeMask) {
             static_assert(static_cast<D3D12_COLOR_WRITE_ENABLE>(dawn::ColorWriteMask::Red) ==
                               D3D12_COLOR_WRITE_ENABLE_RED,
                           "ColorWriteMask values must match");
@@ -201,7 +201,7 @@
             static_assert(static_cast<D3D12_COLOR_WRITE_ENABLE>(dawn::ColorWriteMask::Alpha) ==
                               D3D12_COLOR_WRITE_ENABLE_ALPHA,
                           "ColorWriteMask values must match");
-            return static_cast<uint8_t>(colorWriteMask);
+            return static_cast<uint8_t>(writeMask);
         }
 
         D3D12_RENDER_TARGET_BLEND_DESC ComputeColorDesc(const ColorStateDescriptor* descriptor) {
@@ -213,8 +213,7 @@
             blendDesc.SrcBlendAlpha = D3D12Blend(descriptor->alphaBlend.srcFactor);
             blendDesc.DestBlendAlpha = D3D12Blend(descriptor->alphaBlend.dstFactor);
             blendDesc.BlendOpAlpha = D3D12BlendOperation(descriptor->alphaBlend.operation);
-            blendDesc.RenderTargetWriteMask =
-                D3D12RenderTargetWriteMask(descriptor->colorWriteMask);
+            blendDesc.RenderTargetWriteMask = D3D12RenderTargetWriteMask(descriptor->writeMask);
             blendDesc.LogicOpEnable = false;
             blendDesc.LogicOp = D3D12_LOGIC_OP_NOOP;
             return blendDesc;
diff --git a/src/dawn_native/metal/RenderPipelineMTL.mm b/src/dawn_native/metal/RenderPipelineMTL.mm
index a36cfec..fa72c79 100644
--- a/src/dawn_native/metal/RenderPipelineMTL.mm
+++ b/src/dawn_native/metal/RenderPipelineMTL.mm
@@ -182,19 +182,19 @@
             }
         }
 
-        MTLColorWriteMask MetalColorWriteMask(dawn::ColorWriteMask colorWriteMask) {
+        MTLColorWriteMask MetalColorWriteMask(dawn::ColorWriteMask writeMask) {
             MTLColorWriteMask mask = MTLColorWriteMaskNone;
 
-            if (colorWriteMask & dawn::ColorWriteMask::Red) {
+            if (writeMask & dawn::ColorWriteMask::Red) {
                 mask |= MTLColorWriteMaskRed;
             }
-            if (colorWriteMask & dawn::ColorWriteMask::Green) {
+            if (writeMask & dawn::ColorWriteMask::Green) {
                 mask |= MTLColorWriteMaskGreen;
             }
-            if (colorWriteMask & dawn::ColorWriteMask::Blue) {
+            if (writeMask & dawn::ColorWriteMask::Blue) {
                 mask |= MTLColorWriteMaskBlue;
             }
-            if (colorWriteMask & dawn::ColorWriteMask::Alpha) {
+            if (writeMask & dawn::ColorWriteMask::Alpha) {
                 mask |= MTLColorWriteMaskAlpha;
             }
 
@@ -214,7 +214,7 @@
             attachment.destinationAlphaBlendFactor =
                 MetalBlendFactor(descriptor->alphaBlend.dstFactor, true);
             attachment.alphaBlendOperation = MetalBlendOperation(descriptor->alphaBlend.operation);
-            attachment.writeMask = MetalColorWriteMask(descriptor->colorWriteMask);
+            attachment.writeMask = MetalColorWriteMask(descriptor->writeMask);
         }
 
         MTLStencilOperation MetalStencilOperation(dawn::StencilOperation stencilOperation) {
diff --git a/src/dawn_native/opengl/RenderPipelineGL.cpp b/src/dawn_native/opengl/RenderPipelineGL.cpp
index f729370..ada39b2 100644
--- a/src/dawn_native/opengl/RenderPipelineGL.cpp
+++ b/src/dawn_native/opengl/RenderPipelineGL.cpp
@@ -103,10 +103,10 @@
             } else {
                 glDisablei(GL_BLEND, attachment);
             }
-            glColorMaski(attachment, descriptor->colorWriteMask & dawn::ColorWriteMask::Red,
-                         descriptor->colorWriteMask & dawn::ColorWriteMask::Green,
-                         descriptor->colorWriteMask & dawn::ColorWriteMask::Blue,
-                         descriptor->colorWriteMask & dawn::ColorWriteMask::Alpha);
+            glColorMaski(attachment, descriptor->writeMask & dawn::ColorWriteMask::Red,
+                         descriptor->writeMask & dawn::ColorWriteMask::Green,
+                         descriptor->writeMask & dawn::ColorWriteMask::Blue,
+                         descriptor->writeMask & dawn::ColorWriteMask::Alpha);
         }
 
         GLuint OpenGLStencilOperation(dawn::StencilOperation stencilOperation) {
diff --git a/src/dawn_native/vulkan/RenderPipelineVk.cpp b/src/dawn_native/vulkan/RenderPipelineVk.cpp
index a9bab72..e2cbca9 100644
--- a/src/dawn_native/vulkan/RenderPipelineVk.cpp
+++ b/src/dawn_native/vulkan/RenderPipelineVk.cpp
@@ -199,7 +199,7 @@
             attachment.srcAlphaBlendFactor = VulkanBlendFactor(descriptor->alphaBlend.srcFactor);
             attachment.dstAlphaBlendFactor = VulkanBlendFactor(descriptor->alphaBlend.dstFactor);
             attachment.alphaBlendOp = VulkanBlendOperation(descriptor->alphaBlend.operation);
-            attachment.colorWriteMask = VulkanColorWriteMask(descriptor->colorWriteMask);
+            attachment.colorWriteMask = VulkanColorWriteMask(descriptor->writeMask);
             return attachment;
         }
 
diff --git a/src/tests/end2end/ColorStateTests.cpp b/src/tests/end2end/ColorStateTests.cpp
index f71a5de..0ead520 100644
--- a/src/tests/end2end/ColorStateTests.cpp
+++ b/src/tests/end2end/ColorStateTests.cpp
@@ -146,7 +146,7 @@
         dawn::ColorStateDescriptor descriptor;
         descriptor.alphaBlend = blend;
         descriptor.colorBlend = blend;
-        descriptor.colorWriteMask = dawn::ColorWriteMask::All;
+        descriptor.writeMask = dawn::ColorWriteMask::All;
 
         SetupSingleSourcePipelines(descriptor);
 
@@ -176,7 +176,7 @@
         dawn::ColorStateDescriptor descriptor;
         descriptor.colorBlend = colorBlend;
         descriptor.alphaBlend = alphaBlend;
-        descriptor.colorWriteMask = dawn::ColorWriteMask::All;
+        descriptor.writeMask = dawn::ColorWriteMask::All;
 
         SetupSingleSourcePipelines(descriptor);
 
@@ -298,7 +298,7 @@
     dawn::ColorStateDescriptor descriptor;
     descriptor.alphaBlend = blend;
     descriptor.colorBlend = blend;
-    descriptor.colorWriteMask = dawn::ColorWriteMask::All;
+    descriptor.writeMask = dawn::ColorWriteMask::All;
 
     SetupSingleSourcePipelines(descriptor);
 
@@ -680,7 +680,7 @@
     descriptor.alphaBlend = blend;
     {
         // Test single channel color write
-        descriptor.colorWriteMask = dawn::ColorWriteMask::Red;
+        descriptor.writeMask = dawn::ColorWriteMask::Red;
         SetupSingleSourcePipelines(descriptor);
 
         RGBA8 base(32, 64, 128, 192);
@@ -692,7 +692,7 @@
 
     {
         // Test multi channel color write
-        descriptor.colorWriteMask = dawn::ColorWriteMask::Green | dawn::ColorWriteMask::Alpha;
+        descriptor.writeMask = dawn::ColorWriteMask::Green | dawn::ColorWriteMask::Alpha;
         SetupSingleSourcePipelines(descriptor);
 
         RGBA8 base(32, 64, 128, 192);
@@ -704,7 +704,7 @@
 
     {
         // Test no channel color write
-        descriptor.colorWriteMask = dawn::ColorWriteMask::None;
+        descriptor.writeMask = dawn::ColorWriteMask::None;
         SetupSingleSourcePipelines(descriptor);
 
         RGBA8 base(32, 64, 128, 192);
@@ -725,7 +725,7 @@
         descriptor.alphaBlend = blend;
         descriptor.colorBlend = blend;
 
-        descriptor.colorWriteMask = dawn::ColorWriteMask::Red;
+        descriptor.writeMask = dawn::ColorWriteMask::Red;
         SetupSingleSourcePipelines(descriptor);
 
         RGBA8 base(32, 64, 128, 192);
@@ -1031,7 +1031,7 @@
     testDescriptor.cVertexStage.module = vsModule;
     testDescriptor.cFragmentStage.module = fsModule;
     testDescriptor.cColorStates[0]->format = renderPass.colorFormat;
-    testDescriptor.cColorStates[0]->colorWriteMask = dawn::ColorWriteMask::Red;
+    testDescriptor.cColorStates[0]->writeMask = dawn::ColorWriteMask::Red;
 
     testPipeline = device.CreateRenderPipeline(&testDescriptor);
 
diff --git a/src/tests/unittests/wire/WireArgumentTests.cpp b/src/tests/unittests/wire/WireArgumentTests.cpp
index dc4c605..965ab2c 100644
--- a/src/tests/unittests/wire/WireArgumentTests.cpp
+++ b/src/tests/unittests/wire/WireArgumentTests.cpp
@@ -94,7 +94,7 @@
     colorStateDescriptor.format = DAWN_TEXTURE_FORMAT_R8_G8_B8_A8_UNORM;
     colorStateDescriptor.alphaBlend = blendDescriptor;
     colorStateDescriptor.colorBlend = blendDescriptor;
-    colorStateDescriptor.colorWriteMask = DAWN_COLOR_WRITE_MASK_ALL;
+    colorStateDescriptor.writeMask = DAWN_COLOR_WRITE_MASK_ALL;
 
     // Create the input state
     DawnInputStateDescriptor inputState;
diff --git a/src/tests/unittests/wire/WireOptionalTests.cpp b/src/tests/unittests/wire/WireOptionalTests.cpp
index 2cf6c1e..02a3251 100644
--- a/src/tests/unittests/wire/WireOptionalTests.cpp
+++ b/src/tests/unittests/wire/WireOptionalTests.cpp
@@ -84,7 +84,7 @@
     colorStateDescriptor.format = DAWN_TEXTURE_FORMAT_R8_G8_B8_A8_UNORM;
     colorStateDescriptor.alphaBlend = blendDescriptor;
     colorStateDescriptor.colorBlend = blendDescriptor;
-    colorStateDescriptor.colorWriteMask = DAWN_COLOR_WRITE_MASK_ALL;
+    colorStateDescriptor.writeMask = DAWN_COLOR_WRITE_MASK_ALL;
 
     // Create the input state
     DawnInputStateDescriptor inputState;
diff --git a/src/utils/ComboRenderPipelineDescriptor.cpp b/src/utils/ComboRenderPipelineDescriptor.cpp
index c202ee1..e0a1a1a 100644
--- a/src/utils/ComboRenderPipelineDescriptor.cpp
+++ b/src/utils/ComboRenderPipelineDescriptor.cpp
@@ -92,7 +92,7 @@
             colorStateDescriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
             colorStateDescriptor.alphaBlend = blend;
             colorStateDescriptor.colorBlend = blend;
-            colorStateDescriptor.colorWriteMask = dawn::ColorWriteMask::All;
+            colorStateDescriptor.writeMask = dawn::ColorWriteMask::All;
             for (uint32_t i = 0; i < kMaxColorAttachments; ++i) {
                 mColorStates[i] = colorStateDescriptor;
                 cColorStates[i] = &mColorStates[i];