Tint: Rename the attribute `index` to `blend_src`

This patch renames the attribute `index` to `blend_src` to align with
the WGSL SPEC.

Bug: chromium:341973423
Change-Id: I78172d67adfdf99ab7bf5a36ffe3c95f0ea5d12c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/191763
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: dan sinclair <dsinclair@google.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
diff --git a/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc b/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
index 67b931d..c71943c 100644
--- a/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
@@ -2164,8 +2164,8 @@
         out << "location = " << std::to_string(attrs.location.value());
         first = false;
     }
-    if (attrs.index.has_value()) {
-        out << ", index = " << std::to_string(attrs.index.value());
+    if (attrs.blend_src.has_value()) {
+        out << ", index = " << std::to_string(attrs.blend_src.value());
     }
     if (!first) {
         out << ") ";
diff --git a/src/tint/lang/spirv/writer/ast_printer/builder.cc b/src/tint/lang/spirv/writer/ast_printer/builder.cc
index 563ac13..668015c 100644
--- a/src/tint/lang/spirv/writer/ast_printer/builder.cc
+++ b/src/tint/lang/spirv/writer/ast_printer/builder.cc
@@ -806,7 +806,7 @@
             [&](const ast::BlendSrcAttribute*) {
                 module_.PushAnnot(spv::Op::OpDecorate,
                                   {Operand(var_id), U32Operand(SpvDecorationIndex),
-                                   Operand(sem->Attributes().index.value())});
+                                   Operand(sem->Attributes().blend_src.value())});
                 return true;
             },
             [&](const ast::InterpolateAttribute* interpolate) {
diff --git a/src/tint/lang/wgsl/resolver/resolver.cc b/src/tint/lang/wgsl/resolver/resolver.cc
index 2f14dd4..8f55977 100644
--- a/src/tint/lang/wgsl/resolver/resolver.cc
+++ b/src/tint/lang/wgsl/resolver/resolver.cc
@@ -664,7 +664,7 @@
                     if (value != Success) {
                         return kErrored;
                     }
-                    global->Attributes().index = value.Get();
+                    global->Attributes().blend_src = value.Get();
                     return kSuccess;
                 },
                 [&](const ast::ColorAttribute* attr) {
diff --git a/src/tint/lang/wgsl/sem/variable.h b/src/tint/lang/wgsl/sem/variable.h
index 51cac2a..8dc1af9 100644
--- a/src/tint/lang/wgsl/sem/variable.h
+++ b/src/tint/lang/wgsl/sem/variable.h
@@ -161,10 +161,10 @@
     /// @note a GlobalVariable generally doesn't have a `location` in WGSL, as it isn't allowed by
     /// the spec. The location maybe attached by transforms such as CanonicalizeEntryPointIO.
     std::optional<uint32_t> location;
-    /// The `index` attribute value for the variable, if set
-    /// @note a GlobalVariable generally doesn't have a `index` in WGSL, as it isn't allowed by
+    /// The `blend_src` attribute value for the variable, if set
+    /// @note a GlobalVariable generally doesn't have a `blend_src` in WGSL, as it isn't allowed by
     /// the spec. The location maybe attached by transforms such as CanonicalizeEntryPointIO.
-    std::optional<uint32_t> index;
+    std::optional<uint32_t> blend_src;
     /// The `color` attribute value for the variable, if set
     /// @note a GlobalVariable generally doesn't have a `color` in WGSL, as it isn't allowed by
     /// the spec. The location maybe attached by transforms such as CanonicalizeEntryPointIO.