Add @blend_src as an alias for @index.
This is only a temporary aliasing while we update Skia to use @blend_src
instead of @index. @index will be renamed to @blend_src in a follow-up
CL.
Bug: dawn:2380
Change-Id: I68482b2821a37d02b910a74ffc22dfb9e19964a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/171840
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/lang/core/attribute.cc b/src/tint/lang/core/attribute.cc
index 2568294..77b8d6c 100644
--- a/src/tint/lang/core/attribute.cc
+++ b/src/tint/lang/core/attribute.cc
@@ -48,6 +48,9 @@
if (str == "binding") {
return Attribute::kBinding;
}
+ if (str == "blend_src") {
+ return Attribute::kBlendSrc;
+ }
if (str == "builtin") {
return Attribute::kBuiltin;
}
@@ -104,6 +107,8 @@
return "align";
case Attribute::kBinding:
return "binding";
+ case Attribute::kBlendSrc:
+ return "blend_src";
case Attribute::kBuiltin:
return "builtin";
case Attribute::kColor:
diff --git a/src/tint/lang/core/attribute.h b/src/tint/lang/core/attribute.h
index 46d7619..b33df90 100644
--- a/src/tint/lang/core/attribute.h
+++ b/src/tint/lang/core/attribute.h
@@ -51,6 +51,7 @@
kUndefined,
kAlign,
kBinding,
+ kBlendSrc,
kBuiltin,
kColor,
kCompute,
@@ -86,9 +87,9 @@
Attribute ParseAttribute(std::string_view str);
constexpr std::string_view kAttributeStrings[] = {
- "align", "binding", "builtin", "color", "compute", "diagnostic",
- "fragment", "group", "id", "index", "interpolate", "invariant",
- "location", "must_use", "size", "vertex", "workgroup_size",
+ "align", "binding", "blend_src", "builtin", "color", "compute",
+ "diagnostic", "fragment", "group", "id", "index", "interpolate",
+ "invariant", "location", "must_use", "size", "vertex", "workgroup_size",
};
} // namespace tint::core
diff --git a/src/tint/lang/core/attribute_bench.cc b/src/tint/lang/core/attribute_bench.cc
index 16a660c..6286ce8 100644
--- a/src/tint/lang/core/attribute_bench.cc
+++ b/src/tint/lang/core/attribute_bench.cc
@@ -59,111 +59,118 @@
"bindiivg",
"8WWnding",
"bxxding",
- "bXltigg",
- "ultXn",
- "buil3in",
+ "bXnd_ggrc",
+ "bleXVuc",
+ "3lend_src",
+ "blend_src",
+ "blend_sEc",
+ "blTTPn_src",
+ "ddlen_sxxc",
+ "b44iltin",
+ "buSSltVVn",
+ "RuiR22n",
"builtin",
- "Euiltin",
- "bPTTltin",
- "builtdxx",
- "c44lor",
- "coVVSSr",
- "22RRr",
+ "bFlt9n",
+ "buitin",
+ "VOORRHin",
+ "olyr",
+ "n77rrllGr",
+ "colo40",
"color",
- "cFor",
- "colr",
- "ROOHVr",
- "copuye",
- "llnorrp77te",
- "comp4t00",
+ "oor",
+ "cozz",
+ "1ippor",
+ "compuXXe",
+ "9II5onnpute",
+ "comaSSrHHYe",
"compute",
- "opooe",
- "zzpute",
- "ciimppu1",
- "XXiagnostic",
- "IIia99nonnt55c",
- "dYagSSrrstHHac",
+ "cokke",
+ "jomgRu",
+ "cbput",
+ "diagnojtic",
+ "dagnostic",
+ "diagosqi",
"diagnostic",
- "dakkoHtc",
- "jiagnsgRR",
- "diagbost",
- "fragjent",
- "fragmnt",
- "frqent",
+ "diagnNNstc",
+ "dignvvtic",
+ "diagnostiQ",
+ "frafmrt",
+ "frjgment",
+ "frawNN82t",
"fragment",
- "fragenNN",
- "ravvent",
- "frgmQQnt",
- "grof",
- "grojp",
- "NNrw2u",
+ "fragmnt",
+ "frrrgment",
+ "fGagment",
+ "grFFup",
+ "gE",
+ "grrrp",
"group",
- "grup",
- "grroup",
- "Group",
- "iFF",
- "NN",
- "iAA",
+ "grp",
+ "grJJD",
+ "gu",
+ "K",
+ "FsJ",
+ "KK_v",
"id",
- "d",
- "L",
- "yy",
- "nek",
- "indx",
- "Jndx",
+ "5O8",
+ "",
+ "DDbbB",
+ "indKKx",
+ "in33O",
+ "6QQottex",
"index",
- "incex",
- "iOdex",
- "__nttKKvv",
- "int8rpoxx5e",
- "inteqq__lte",
- "interpqlate",
+ "i6dex",
+ "zzdeO6",
+ "iyydex",
+ "nterZZHate",
+ "WWnerpolaq4e",
+ "interOOoate",
"interpolate",
- "33ntOpolat66",
- "intoott6QQlate",
- "66terpolate",
- "zzxvO6rint",
- "invayyiant",
- "HHnariZt",
+ "iYohepolte",
+ "inteolat",
+ "interoFate",
+ "invarwnt",
+ "GvrKanff",
+ "KKnqariant",
"invariant",
- "iWW44rianq",
- "iOOvaiant",
- "ivariYnt",
- "ltion",
- "loaFion",
- "wocatio",
+ "invammia3t",
+ "invarint",
+ "inqriant",
+ "obbatibn",
+ "lcaiiio",
+ "loqatiOn",
"location",
- "Kcatoff",
- "qocKKtion",
- "lFcmmt3on",
- "mustuse",
- "must_se",
- "ubbt_ube",
+ "loTTatiovv",
+ "FFocation",
+ "fo00QPio",
+ "must_uPe",
+ "ust_uss77",
+ "mustCubbRe",
"must_use",
- "mstiius",
- "muqt_uOe",
- "muTTt_usvv",
- "FFize",
- "QP00",
- "siPe",
+ "must_usXX",
+ "muOOt_CCse",
+ "sst_usL",
+ "sizX",
+ "sze",
+ "qq",
"size",
- "sis77",
- "CiRbbe",
- "sizXX",
- "CCrtOOOO",
- "vrsuL",
- "verteX",
+ "s22ze",
+ "iz0yz",
+ "VPzi",
+ "vrtCnn",
+ "ArqqHHx",
+ "ertex",
"vertex",
+ "vefKK",
+ "Pegge",
"verte",
- "qqrx",
- "verte22",
- "workgou0yzzizXX",
- "workgrop_VPize",
- "wokgroupnnsCze",
+ "4orkgrouTT_Nizc",
+ "worgrouppp7lize",
+ "wgzrkgrup_siNe",
"workgroup_size",
- "workgrouq_sizHA",
- "workgrup_size",
- "forroupKKsize",
+ "uuorkgbop_sXXze",
+ "worgroup_size",
+ "worKgroQ_88ze",
};
for (auto _ : state) {
for (auto* str : kStrings) {
diff --git a/src/tint/lang/core/attribute_test.cc b/src/tint/lang/core/attribute_test.cc
index 10d8e72..6c61414 100644
--- a/src/tint/lang/core/attribute_test.cc
+++ b/src/tint/lang/core/attribute_test.cc
@@ -57,23 +57,15 @@
}
static constexpr Case kValidCases[] = {
- {"align", Attribute::kAlign},
- {"binding", Attribute::kBinding},
- {"builtin", Attribute::kBuiltin},
- {"color", Attribute::kColor},
- {"compute", Attribute::kCompute},
- {"diagnostic", Attribute::kDiagnostic},
- {"fragment", Attribute::kFragment},
- {"group", Attribute::kGroup},
- {"id", Attribute::kId},
- {"index", Attribute::kIndex},
- {"interpolate", Attribute::kInterpolate},
- {"invariant", Attribute::kInvariant},
- {"location", Attribute::kLocation},
- {"must_use", Attribute::kMustUse},
- {"size", Attribute::kSize},
- {"vertex", Attribute::kVertex},
- {"workgroup_size", Attribute::kWorkgroupSize},
+ {"align", Attribute::kAlign}, {"binding", Attribute::kBinding},
+ {"blend_src", Attribute::kBlendSrc}, {"builtin", Attribute::kBuiltin},
+ {"color", Attribute::kColor}, {"compute", Attribute::kCompute},
+ {"diagnostic", Attribute::kDiagnostic}, {"fragment", Attribute::kFragment},
+ {"group", Attribute::kGroup}, {"id", Attribute::kId},
+ {"index", Attribute::kIndex}, {"interpolate", Attribute::kInterpolate},
+ {"invariant", Attribute::kInvariant}, {"location", Attribute::kLocation},
+ {"must_use", Attribute::kMustUse}, {"size", Attribute::kSize},
+ {"vertex", Attribute::kVertex}, {"workgroup_size", Attribute::kWorkgroupSize},
};
static constexpr Case kInvalidCases[] = {
@@ -83,51 +75,54 @@
{"bind1ng", Attribute::kUndefined},
{"bqnJing", Attribute::kUndefined},
{"bindin7ll", Attribute::kUndefined},
- {"ppqqiliHH", Attribute::kUndefined},
- {"bucv", Attribute::kUndefined},
- {"biltGn", Attribute::kUndefined},
- {"covior", Attribute::kUndefined},
- {"co8WWr", Attribute::kUndefined},
- {"Mxxlo", Attribute::kUndefined},
- {"cXputgg", Attribute::kUndefined},
- {"opuXe", Attribute::kUndefined},
- {"comp3te", Attribute::kUndefined},
- {"diagnostiE", Attribute::kUndefined},
- {"TTiagnosPPi", Attribute::kUndefined},
- {"diagdoxxtic", Attribute::kUndefined},
- {"44ragment", Attribute::kUndefined},
- {"fSSagmenVV", Attribute::kUndefined},
- {"Rag2Rent", Attribute::kUndefined},
- {"gFup", Attribute::kUndefined},
- {"grop", Attribute::kUndefined},
- {"ROOHVp", Attribute::kUndefined},
- {"y", Attribute::kUndefined},
- {"Gn77rl", Attribute::kUndefined},
- {"04d", Attribute::kUndefined},
- {"oox", Attribute::kUndefined},
- {"inzz", Attribute::kUndefined},
- {"1ippex", Attribute::kUndefined},
- {"interpoXXate", Attribute::kUndefined},
- {"intII99r55olate", Attribute::kUndefined},
- {"intaarpoSSrHHYe", Attribute::kUndefined},
- {"kkvHant", Attribute::kUndefined},
- {"jgaianRR", Attribute::kUndefined},
- {"inaianb", Attribute::kUndefined},
- {"locajion", Attribute::kUndefined},
- {"locaton", Attribute::kUndefined},
- {"loqion", Attribute::kUndefined},
- {"mustusNN", Attribute::kUndefined},
- {"usvvuse", Attribute::kUndefined},
- {"mut_QQse", Attribute::kUndefined},
- {"srf", Attribute::kUndefined},
- {"sije", Attribute::kUndefined},
- {"NNz2w", Attribute::kUndefined},
- {"vrtex", Attribute::kUndefined},
- {"rrertex", Attribute::kUndefined},
- {"vGrtex", Attribute::kUndefined},
- {"workgroup_sizFF", Attribute::kUndefined},
- {"wErkrp_size", Attribute::kUndefined},
- {"worgrroup_size", Attribute::kUndefined},
+ {"blen_sppqHH", Attribute::kUndefined},
+ {"blen_r", Attribute::kUndefined},
+ {"bbndGsrc", Attribute::kUndefined},
+ {"builiivn", Attribute::kUndefined},
+ {"8WWiltin", Attribute::kUndefined},
+ {"bxxltin", Attribute::kUndefined},
+ {"cggor", Attribute::kUndefined},
+ {"VoX", Attribute::kUndefined},
+ {"colo3", Attribute::kUndefined},
+ {"Eompute", Attribute::kUndefined},
+ {"cPTTpute", Attribute::kUndefined},
+ {"compudxx", Attribute::kUndefined},
+ {"diagno44tic", Attribute::kUndefined},
+ {"diaVVSnostic", Attribute::kUndefined},
+ {"2iRRnostic", Attribute::kUndefined},
+ {"rFg9ent", Attribute::kUndefined},
+ {"frament", Attribute::kUndefined},
+ {"ROOrHgeVt", Attribute::kUndefined},
+ {"royp", Attribute::kUndefined},
+ {"n77rrloGp", Attribute::kUndefined},
+ {"grou40", Attribute::kUndefined},
+ {"HH", Attribute::kUndefined},
+ {"p", Attribute::kUndefined},
+ {"1ii", Attribute::kUndefined},
+ {"XXndex", Attribute::kUndefined},
+ {"in9IInn5x", Attribute::kUndefined},
+ {"HHrnSSaYx", Attribute::kUndefined},
+ {"nHkkolate", Attribute::kUndefined},
+ {"jRRterogte", Attribute::kUndefined},
+ {"iterpolbe", Attribute::kUndefined},
+ {"invariajt", Attribute::kUndefined},
+ {"ivariant", Attribute::kUndefined},
+ {"ivariqt", Attribute::kUndefined},
+ {"locaioNN", Attribute::kUndefined},
+ {"ocvvion", Attribute::kUndefined},
+ {"loatQQon", Attribute::kUndefined},
+ {"musf_re", Attribute::kUndefined},
+ {"mujt_use", Attribute::kUndefined},
+ {"muswNN82e", Attribute::kUndefined},
+ {"sze", Attribute::kUndefined},
+ {"sirre", Attribute::kUndefined},
+ {"sGze", Attribute::kUndefined},
+ {"verFFex", Attribute::kUndefined},
+ {"vre", Attribute::kUndefined},
+ {"vrrrte", Attribute::kUndefined},
+ {"orkgroup_sze", Attribute::kUndefined},
+ {"DXkgroJJp_size", Attribute::kUndefined},
+ {"wo8kroup_sz", Attribute::kUndefined},
};
using AttributeParseTest = testing::TestWithParam<Case>;
diff --git a/src/tint/lang/core/core.def b/src/tint/lang/core/core.def
index 2606174..89efe1e 100644
--- a/src/tint/lang/core/core.def
+++ b/src/tint/lang/core/core.def
@@ -198,6 +198,7 @@
enum attribute {
align
binding
+ blend_src
builtin
compute
diagnostic