mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
tint/ast: Remove ast::StorageTexture
Instead use ast::TypeName. Also improve the validation and diagnostics around providing template arguments to types that do not accept them. Bug: tint:1810 Change-Id: I4241d50ce0425ab721157686889e918993482876 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119284 Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Reviewed-by: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
c66b5e6922
commit
1131d31761
@@ -118,6 +118,18 @@ Builtin ParseBuiltin(std::string_view str) {
|
||||
if (str == "texture_external") {
|
||||
return Builtin::kTextureExternal;
|
||||
}
|
||||
if (str == "texture_storage_1d") {
|
||||
return Builtin::kTextureStorage1D;
|
||||
}
|
||||
if (str == "texture_storage_2d") {
|
||||
return Builtin::kTextureStorage2D;
|
||||
}
|
||||
if (str == "texture_storage_2d_array") {
|
||||
return Builtin::kTextureStorage2DArray;
|
||||
}
|
||||
if (str == "texture_storage_3d") {
|
||||
return Builtin::kTextureStorage3D;
|
||||
}
|
||||
if (str == "u32") {
|
||||
return Builtin::kU32;
|
||||
}
|
||||
@@ -224,6 +236,14 @@ std::ostream& operator<<(std::ostream& out, Builtin value) {
|
||||
return out << "texture_depth_multisampled_2d";
|
||||
case Builtin::kTextureExternal:
|
||||
return out << "texture_external";
|
||||
case Builtin::kTextureStorage1D:
|
||||
return out << "texture_storage_1d";
|
||||
case Builtin::kTextureStorage2D:
|
||||
return out << "texture_storage_2d";
|
||||
case Builtin::kTextureStorage2DArray:
|
||||
return out << "texture_storage_2d_array";
|
||||
case Builtin::kTextureStorage3D:
|
||||
return out << "texture_storage_3d";
|
||||
case Builtin::kU32:
|
||||
return out << "u32";
|
||||
case Builtin::kVec2F:
|
||||
|
||||
@@ -60,6 +60,10 @@ enum class Builtin {
|
||||
kTextureDepthCubeArray,
|
||||
kTextureDepthMultisampled2D,
|
||||
kTextureExternal,
|
||||
kTextureStorage1D,
|
||||
kTextureStorage2D,
|
||||
kTextureStorage2DArray,
|
||||
kTextureStorage3D,
|
||||
kU32,
|
||||
kVec2F,
|
||||
kVec2H,
|
||||
@@ -116,6 +120,10 @@ constexpr const char* kBuiltinStrings[] = {
|
||||
"texture_depth_cube_array",
|
||||
"texture_depth_multisampled_2d",
|
||||
"texture_external",
|
||||
"texture_storage_1d",
|
||||
"texture_storage_2d",
|
||||
"texture_storage_2d_array",
|
||||
"texture_storage_3d",
|
||||
"u32",
|
||||
"vec2f",
|
||||
"vec2h",
|
||||
|
||||
@@ -241,97 +241,125 @@ void BuiltinParser(::benchmark::State& state) {
|
||||
"textuXe_ZZxtJJrnal",
|
||||
"textuPPe_eternal",
|
||||
"texturc_external",
|
||||
"ull62",
|
||||
"93yy",
|
||||
"u3KK",
|
||||
"tllxture_storage_P6d",
|
||||
"tex99ure_yytorag_1d",
|
||||
"textuKKe_storage_1d",
|
||||
"texture_storage_1d",
|
||||
"texture__xorage_d",
|
||||
"yxKur_storage_1d",
|
||||
"textureVstorkge_1z",
|
||||
"texKure_Storqge_2d",
|
||||
"texture_storage_d",
|
||||
"teture_storage_VVd",
|
||||
"texture_storage_2d",
|
||||
"textureIstoraAUe_2d",
|
||||
"jextre_storaR_2d",
|
||||
"extue44storYYge_2",
|
||||
"textre_storage_2d_array",
|
||||
"tex9ur_stor11ge_d_xxrray",
|
||||
"tmmxture_storJe_2d_arrcc",
|
||||
"texture_storage_2d_array",
|
||||
"tJJxture_storage_2_array",
|
||||
"DDCCltufe_storaUe_2d_array",
|
||||
"tegture_storage_2d_array",
|
||||
"exture_srageCC3d",
|
||||
"txture_storage_3d",
|
||||
"textuIe_sto__age_3d",
|
||||
"texture_storage_3d",
|
||||
"texttte_PPorage_3d",
|
||||
"texture_stora3de_3d",
|
||||
"exture_Ktoragyy_3d",
|
||||
"",
|
||||
"03nn",
|
||||
"uCnuu",
|
||||
"u32",
|
||||
"x_",
|
||||
"K",
|
||||
"kVz",
|
||||
"veKSf",
|
||||
"vc2f",
|
||||
"ec2VV",
|
||||
"vec2f",
|
||||
"IAAc2f",
|
||||
"jbR",
|
||||
"veY4",
|
||||
"ec2h",
|
||||
"vc911",
|
||||
"mmcch",
|
||||
"vec2h",
|
||||
"vJJch",
|
||||
"lDDcUfC",
|
||||
"vec2g",
|
||||
"CCe",
|
||||
"ec2i",
|
||||
"vIc__i",
|
||||
"vec2i",
|
||||
"ePPtt",
|
||||
"v3dc2i",
|
||||
"vcyyi",
|
||||
"u2",
|
||||
"v03nnu",
|
||||
"Cuuecnv",
|
||||
"vec2u",
|
||||
"vX2ll",
|
||||
"vocppu",
|
||||
"vwwc2",
|
||||
"3Xl",
|
||||
"pp3o",
|
||||
"uww",
|
||||
"veuug",
|
||||
"vaac",
|
||||
"TRZcccf",
|
||||
"vec3f",
|
||||
"vTc3O8",
|
||||
"vem03f",
|
||||
"meBB3f",
|
||||
"Mpp3",
|
||||
"OOe3h",
|
||||
"veG3G",
|
||||
"vec3h",
|
||||
"11eHH3h",
|
||||
"vec2f",
|
||||
"vTc2O8",
|
||||
"vem02f",
|
||||
"meBB2f",
|
||||
"Mpp2",
|
||||
"OOe2h",
|
||||
"veG2G",
|
||||
"vec2h",
|
||||
"11eHH2h",
|
||||
"veFFe6",
|
||||
"ve3",
|
||||
"vKii3l",
|
||||
"ec3i",
|
||||
"v993IIv",
|
||||
"vec3i",
|
||||
"ve2",
|
||||
"vKii2l",
|
||||
"ec2i",
|
||||
"v992IIv",
|
||||
"vec2i",
|
||||
"veci",
|
||||
"vechi",
|
||||
"vczllPi",
|
||||
"u",
|
||||
"vffqq3",
|
||||
"vJdd3u",
|
||||
"vec3u",
|
||||
"vffqq2",
|
||||
"vJdd2u",
|
||||
"vec2u",
|
||||
"vecXX",
|
||||
"ve32",
|
||||
"Nyyc3u",
|
||||
"vO4",
|
||||
"ve22",
|
||||
"Nyyc2u",
|
||||
"vO3",
|
||||
"PEruZ",
|
||||
"vlc2edd",
|
||||
"vec4f",
|
||||
"vec3f",
|
||||
"ec9f",
|
||||
"ve1II",
|
||||
"veb4f",
|
||||
"veb3f",
|
||||
"vi7",
|
||||
"oec4ii",
|
||||
"ec4",
|
||||
"vec4h",
|
||||
"oec3ii",
|
||||
"ec3",
|
||||
"vec3h",
|
||||
"veci",
|
||||
"22ec",
|
||||
"vGc4C",
|
||||
"ffec48",
|
||||
"c4i",
|
||||
"vGc3C",
|
||||
"ffec38",
|
||||
"c3i",
|
||||
"JJecSSi",
|
||||
"vec4i",
|
||||
"94i",
|
||||
"vbbJJ4TT",
|
||||
"vec3i",
|
||||
"93i",
|
||||
"vbbJJ3TT",
|
||||
"e66i",
|
||||
"u664u",
|
||||
"vW4u",
|
||||
"v4u",
|
||||
"vec4u",
|
||||
"u663u",
|
||||
"vW3u",
|
||||
"v3u",
|
||||
"vec3u",
|
||||
"vecu",
|
||||
"rec4u",
|
||||
"2ec4B",
|
||||
"rec3u",
|
||||
"2ec3B",
|
||||
"vcBBf",
|
||||
"vRc4f",
|
||||
"v4LL0",
|
||||
"vec4f",
|
||||
"vKOOf",
|
||||
"vgwcf",
|
||||
"vLphf",
|
||||
"eiiEh",
|
||||
"ec4h",
|
||||
"UU884",
|
||||
"vec4h",
|
||||
"rrecvvh",
|
||||
"ecmm",
|
||||
"vec4j",
|
||||
"vec4X",
|
||||
"vec48",
|
||||
"vecvEE",
|
||||
"vec4i",
|
||||
"z99ci",
|
||||
"GGeJJA4i",
|
||||
"vess4i",
|
||||
"vPcKu",
|
||||
"tpc4u",
|
||||
"vec",
|
||||
"vec4u",
|
||||
"MMec4u",
|
||||
"vJJc40",
|
||||
"8c",
|
||||
};
|
||||
for (auto _ : state) {
|
||||
for (auto* str : kStrings) {
|
||||
|
||||
@@ -73,6 +73,10 @@ static constexpr Case kValidCases[] = {
|
||||
{"texture_depth_cube_array", Builtin::kTextureDepthCubeArray},
|
||||
{"texture_depth_multisampled_2d", Builtin::kTextureDepthMultisampled2D},
|
||||
{"texture_external", Builtin::kTextureExternal},
|
||||
{"texture_storage_1d", Builtin::kTextureStorage1D},
|
||||
{"texture_storage_2d", Builtin::kTextureStorage2D},
|
||||
{"texture_storage_2d_array", Builtin::kTextureStorage2DArray},
|
||||
{"texture_storage_3d", Builtin::kTextureStorage3D},
|
||||
{"u32", Builtin::kU32},
|
||||
{"vec2f", Builtin::kVec2F},
|
||||
{"vec2h", Builtin::kVec2H},
|
||||
@@ -179,45 +183,57 @@ static constexpr Case kInvalidCases[] = {
|
||||
{"texture_exernss77", Builtin::kUndefined},
|
||||
{"texture_bbxternRRl", Builtin::kUndefined},
|
||||
{"textureXXexternal", Builtin::kUndefined},
|
||||
{"qOOO2", Builtin::kUndefined},
|
||||
{"us", Builtin::kUndefined},
|
||||
{"u3X", Builtin::kUndefined},
|
||||
{"ve2f", Builtin::kUndefined},
|
||||
{"qq2", Builtin::kUndefined},
|
||||
{"vec222", Builtin::kUndefined},
|
||||
{"vezzXy", Builtin::kUndefined},
|
||||
{"ieVVP", Builtin::kUndefined},
|
||||
{"venCh", Builtin::kUndefined},
|
||||
{"vHc2Aq", Builtin::kUndefined},
|
||||
{"ve2i", Builtin::kUndefined},
|
||||
{"vefK", Builtin::kUndefined},
|
||||
{"vgg2", Builtin::kUndefined},
|
||||
{"vecu", Builtin::kUndefined},
|
||||
{"4TNc2u", Builtin::kUndefined},
|
||||
{"CCextOOre_stoage_qOd", Builtin::kUndefined},
|
||||
{"txtsre_sturage_1L", Builtin::kUndefined},
|
||||
{"texture_stoXage_1d", Builtin::kUndefined},
|
||||
{"textue_storage_2d", Builtin::kUndefined},
|
||||
{"teuresOorageqq2d", Builtin::kUndefined},
|
||||
{"texture_sto22age_2d", Builtin::kUndefined},
|
||||
{"exture_syora0e_2d_Xzzrray", Builtin::kUndefined},
|
||||
{"texiVVr_storageP2d_array", Builtin::kUndefined},
|
||||
{"texturestorage_2nn_arCay", Builtin::kUndefined},
|
||||
{"texturHHstorAAe_qqd", Builtin::kUndefined},
|
||||
{"textur_storage_3d", Builtin::kUndefined},
|
||||
{"texure_sfKorage3d", Builtin::kUndefined},
|
||||
{"gg", Builtin::kUndefined},
|
||||
{"u3", Builtin::kUndefined},
|
||||
{"NT42", Builtin::kUndefined},
|
||||
{"ppec7l", Builtin::kUndefined},
|
||||
{"zNe3f", Builtin::kUndefined},
|
||||
{"uXXb3f", Builtin::kUndefined},
|
||||
{"vec3", Builtin::kUndefined},
|
||||
{"883K", Builtin::kUndefined},
|
||||
{"zNe2f", Builtin::kUndefined},
|
||||
{"uXXb2f", Builtin::kUndefined},
|
||||
{"vec2", Builtin::kUndefined},
|
||||
{"882K", Builtin::kUndefined},
|
||||
{"vq9h", Builtin::kUndefined},
|
||||
{"vec311", Builtin::kUndefined},
|
||||
{"vec211", Builtin::kUndefined},
|
||||
{"22ciii", Builtin::kUndefined},
|
||||
{"ec77i", Builtin::kUndefined},
|
||||
{"NN23u", Builtin::kUndefined},
|
||||
{"vVVc3u", Builtin::kUndefined},
|
||||
{"WW11w3u", Builtin::kUndefined},
|
||||
{"NN22u", Builtin::kUndefined},
|
||||
{"vVVc2u", Builtin::kUndefined},
|
||||
{"WW11w2u", Builtin::kUndefined},
|
||||
{"vcwwf", Builtin::kUndefined},
|
||||
{"vDc4f", Builtin::kUndefined},
|
||||
{"vDc3f", Builtin::kUndefined},
|
||||
{"vecK", Builtin::kUndefined},
|
||||
{"f11r4PP", Builtin::kUndefined},
|
||||
{"ve4h", Builtin::kUndefined},
|
||||
{"vec4YY", Builtin::kUndefined},
|
||||
{"f11r3PP", Builtin::kUndefined},
|
||||
{"ve3h", Builtin::kUndefined},
|
||||
{"vec3YY", Builtin::kUndefined},
|
||||
{"vkktHH", Builtin::kUndefined},
|
||||
{"rrec4i", Builtin::kUndefined},
|
||||
{"rrec3i", Builtin::kUndefined},
|
||||
{"vWWssi", Builtin::kUndefined},
|
||||
{"veYu", Builtin::kUndefined},
|
||||
{"eq4f", Builtin::kUndefined},
|
||||
{"u22ec4u", Builtin::kUndefined},
|
||||
{"eq3f", Builtin::kUndefined},
|
||||
{"u22ec3u", Builtin::kUndefined},
|
||||
{"c4f", Builtin::kUndefined},
|
||||
{"vec4", Builtin::kUndefined},
|
||||
{"vYyc47E", Builtin::kUndefined},
|
||||
{"veMoh", Builtin::kUndefined},
|
||||
{"ve4MM", Builtin::kUndefined},
|
||||
{"55ec4h", Builtin::kUndefined},
|
||||
{"N4i", Builtin::kUndefined},
|
||||
{"ve33i", Builtin::kUndefined},
|
||||
{"3ec4i", Builtin::kUndefined},
|
||||
{"mecI", Builtin::kUndefined},
|
||||
{"vrnK4u", Builtin::kUndefined},
|
||||
{"v4", Builtin::kUndefined},
|
||||
};
|
||||
|
||||
using BuiltinParseTest = testing::TestWithParam<Case>;
|
||||
|
||||
Reference in New Issue
Block a user