Tint: Add input_attachment as builtin type.
Bug: 341117913
Change-Id: I7a504c78280d78684046ce4ad164748db83910f1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/189520
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/src/tint/lang/core/builtin_type.cc b/src/tint/lang/core/builtin_type.cc
index 190cf7f..4fddb22 100644
--- a/src/tint/lang/core/builtin_type.cc
+++ b/src/tint/lang/core/builtin_type.cc
@@ -141,6 +141,9 @@
if (str == "i32") {
return BuiltinType::kI32;
}
+ if (str == "input_attachment") {
+ return BuiltinType::kInputAttachment;
+ }
if (str == "mat2x2") {
return BuiltinType::kMat2X2;
}
@@ -403,6 +406,8 @@
return "f32";
case BuiltinType::kI32:
return "i32";
+ case BuiltinType::kInputAttachment:
+ return "input_attachment";
case BuiltinType::kMat2X2:
return "mat2x2";
case BuiltinType::kMat2X2F:
diff --git a/src/tint/lang/core/builtin_type.h b/src/tint/lang/core/builtin_type.h
index ac0a22e..0f7a9f0 100644
--- a/src/tint/lang/core/builtin_type.h
+++ b/src/tint/lang/core/builtin_type.h
@@ -79,6 +79,7 @@
kF16,
kF32,
kI32,
+ kInputAttachment,
kMat2X2,
kMat2X2F,
kMat2X2H,
@@ -195,6 +196,7 @@
"f16",
"f32",
"i32",
+ "input_attachment",
"mat2x2",
"mat2x2f",
"mat2x2h",
diff --git a/src/tint/lang/core/builtin_type_bench.cc b/src/tint/lang/core/builtin_type_bench.cc
index f963bc7..1e5b673 100644
--- a/src/tint/lang/core/builtin_type_bench.cc
+++ b/src/tint/lang/core/builtin_type_bench.cc
@@ -276,447 +276,454 @@
"iJJ",
"UfCDD",
"i3g",
- "CCtx",
- "mt2x2",
- "mat2x__",
+ "inCCt_atachmen",
+ "iput_attachment",
+ "input__attachmenI",
+ "input_attachment",
+ "inpt_PttttaNment",
+ "input_attddc3ment",
+ "inKutyyattahment",
+ "mtx",
+ "mat03nn",
+ "mvtnCuuK",
"mat2x2",
- "attxPP",
- "mdd32x2",
- "yyK2x2",
- "m2uu",
- "ma0nnx2i",
- "KanuuCC2f",
- "mat2x2f",
- "mlX2x2f",
- "oat2pp2f",
- "wwat22f",
+ "lXatx2",
+ "matppxo",
+ "maw2x2",
"matguum",
"mt2ma2",
- "Tat2xZRRh",
+ "Tat2xZRRf",
+ "mat2x2f",
+ "ma8T2xOf",
+ "m0at2x2f",
+ "mBBt2x2f",
+ "at2ppM",
+ "matOO2h",
+ "mGG2x2G",
"mat2x2h",
- "ma8T2xOh",
- "m0at2x2h",
- "mBBt2x2h",
- "Matpp",
- "Oat2x3",
- "GGG2x3",
+ "mHHt2x11h",
+ "eat2x6Fh",
+ "atx2h",
+ "mKl2ii3",
+ "at2x3",
+ "9IIat2x3",
"mat2x3",
- "mHHt2113",
- "mateF63",
- "matx",
- "mat2ii3l",
- "mt2x3f",
- "IIvvt2x39",
- "mat2x3f",
- "mat23f",
- "mat2h3f",
- "mllt2xPzz",
- "t3h",
- "mtffxqqh",
+ "ma2x3",
+ "hat2x3",
+ "zzPt2xll",
+ "t3f",
+ "mtffxqqf",
"mtJJx3dd",
- "mat2x3h",
- "mzz2X3h",
+ "mat2x3f",
+ "mzz2X3f",
"matx32",
- "maN2yy3h",
- "atxO",
- "rauExP",
- "meet22dd",
+ "maN2yy3f",
+ "mt2O3",
+ "uZtrx3h",
+ "latdde23h",
+ "mat2x3h",
+ "matVVh",
+ "1IIt2x3",
+ "mat2xbh",
+ "t7i4",
+ "maio2x4",
+ "a5x4",
"mat2x4",
- "maV92",
- "maI2x1",
- "mab2x4",
- "matzf",
- "mao2ii4f",
- "mat45",
+ "St2x4",
+ "m22tx",
+ "maC7G4",
+ "maff284f",
+ "t2x4f",
+ "SSatJJx4f",
"mat2x4f",
- "at2xSf",
- "mat22f",
- "maG1C4f",
- "maff284h",
- "t2x4h",
- "SSatJJx4h",
+ "atx9f",
+ "maJJbbTT4f",
+ "66a2xf",
+ "ut2x466",
+ "aW2x4h",
+ "mtx4h",
"mat2x4h",
- "atx9h",
- "maJJbbTT4h",
- "66a2xh",
- "ma663u",
- "Wa3x2",
- "ma32",
+ "mOt2x4",
+ "THat2xBB",
+ "maRR2xh",
+ "VLLa30",
+ "at3KOO",
+ "awg3x2",
"mat3x2",
- "ma3x2",
- "rat3x2",
- "m2t3xB",
- "matxBBf",
- "maRR3xf",
- "maVV0Lf",
- "mat3x2f",
- "a3OOK2f",
- "magw3xf",
- "hht3L2f",
- "aKii3xh",
- "ma3x2h",
+ "maLhhp",
+ "iitEx2",
+ "at3x2",
"UUa3882",
- "mat3x2h",
- "rrvvt3x2h",
+ "rrvvt3x2f",
"m3xwmm",
- "j443x2h",
- "matXx3",
- "m8t3x3",
- "mat3vEE",
+ "mat3x2f",
+ "j443x2f",
+ "matXx2f",
+ "mat8x2f",
+ "mvEE3x2h",
+ "mai93zz",
+ "mQQJJnxGGh",
+ "mat3x2h",
+ "mass3x2h",
+ "matKxPh",
+ "mat3tth",
+ "atx3",
+ "maMM3x3",
+ "mJ0t3x3",
"mat3x3",
- "mzzi3x",
- "maGGQ3JJ3",
- "mat3ss3",
- "matKxPf",
- "mat3ttf",
- "mt3x3",
- "mat3x3f",
- "mMMt3x3f",
- "maJ03x3f",
- "V8x3",
- "maKggx3hh",
- "maf3x3h",
- "matQ7x3h",
- "mat3x3h",
- "mat3YYh",
+ "V38",
+ "hggat3x3",
+ "maf3x3",
+ "matQ7x3f",
+ "mat3YYf",
"mak3x3",
+ "mat3x3f",
"man3x2",
- "mFFx4",
- "GGatPPuUU",
- "mEEFa4",
+ "ma3FFf",
+ "uGGtIUPP3f",
+ "EEvFx3h",
+ "ddtBBDDeh",
+ "m55tMccE3",
+ "mat3x3h",
+ "aKKx3",
+ "mat3x3R",
+ "maDx39",
+ "mt3x4",
+ "aIt34",
+ "mat3x77",
"mat3x4",
- "mBet3dd4",
- "55atExcc",
- "txKK",
- "mat3x4R",
- "maDx49",
- "mt3x4f",
+ "matIx4",
+ "matd4",
+ "mt3x4",
+ "mtt4f",
+ "ma3XX3x4f",
+ "Eat34f",
"mat3x4f",
- "aaat3I",
- "m77t3x4f",
- "matIx4f",
- "md3x4h",
- "mat34h",
- "mtt4h",
- "mat3x4h",
- "ma3XX3x4h",
- "Eat34h",
"maXX3x4",
- "mxBt4x2",
- "Wt4x",
- "mat66x2",
+ "matxBx4f",
+ "m3x4f",
+ "mat3x466",
+ "matxv0",
+ "txh",
+ "mat3x4h",
+ "mpt3xh",
+ "at114h",
+ "EaJ3yBBh",
+ "mqIm4x2",
+ "ma4F2",
+ "aY4x2",
"mat4x2",
- "atTv0",
- "kt",
- "mpt4x",
- "at112f",
- "EaJ4yBBf",
- "mqIm4x2f",
+ "matDHh2",
+ "24H2",
+ "m4x2",
+ "matx2f",
+ "matx2f",
+ "matddx2f",
"mat4x2f",
- "ma4xFf",
- "Yt4x2f",
- "mHHtDh2f",
- "Ht22h",
- "matx2",
- "matx2h",
+ "Oat4x2f",
+ "atBbb2",
+ "m004x2f",
+ "mat4xhh",
+ "mgYtx2h",
+ "mat4O2h",
"mat4x2h",
- "matx2h",
- "matddx2h",
- "Oat4x2h",
- "bbtB3",
- "m00tx3",
- "hat4x3",
+ "ah4xh",
+ "fpaEEx2h",
+ "mavx2h",
+ "at4zz3",
+ "mat4x",
+ "OiiJt4",
"mat4x3",
- "matgYx",
- "Oat4x3",
- "mhx3",
- "fpaEEx3f",
- "mavx3f",
- "mzztx3f",
+ "mGt4xf",
+ "mTT224x3",
+ "lat4x3",
+ "bat4x3f",
+ "BBatx3f",
+ "PPIXt4S3f",
"mat4x3f",
- "ma4x3f",
- "OOaJxii",
- "mft4G3f",
- "mat4x322T",
- "datlx3h",
- "bat4x3h",
+ "mjjt4x3f",
+ "_at4xccf",
+ "ax6z4xSSf",
+ "a4xG",
+ "mx44N3v",
+ "atAAx00p",
"mat4x3h",
- "BBatx3h",
- "PPIXt4S3h",
- "mjjt4x3h",
- "macc4_4",
- "SS6zz4xx",
- "mtx",
+ "eeytyh",
+ "mabWWx0h",
+ "ttatMMxmh",
+ "4d4",
+ "mav_x",
+ "mVt4xEE",
"mat4x4",
- "mxxtvN",
- "AA00t44",
- "tyexy",
- "mabWWx0f",
- "ttatMMxmf",
- "madf",
+ "m4t4x4",
+ "mVVtgxX",
+ "oat4V4",
+ "ma4x4f",
+ "KKattxf",
+ "G4xf",
"mat4x4f",
- "mat_4f",
- "Vat4EE4f",
- "mat44f",
- "mRIxah",
- "ma4mmh",
- "at4x4p",
+ "ma4x4",
+ "mad4x4f",
+ "CCat4xPtf",
+ "matx4",
+ "m5t4x4h",
+ "m9jtffx4h",
"mat4x4h",
- "mat4xh",
- "aaxh",
- "mad4x4h",
- "pCPtd",
- "p",
- "5tr",
+ "matRvxXXh",
+ "ctx4h",
+ "XX8t5x4",
+ "t",
+ "ppcc",
+ "vtr",
"ptr",
- "ff99j",
- "YYvXR",
- "r",
- "XX8m5le",
- "mpler",
- "sccmlppr",
+ "EESS",
+ "p",
+ "",
+ "saplwwr",
+ "sa99plddr",
+ "99amplP",
"sampler",
- "sampver",
- "EESSmplr",
- "smplr",
- "samplecomp_risa",
- "sampler_co_prwwson",
- "samplerdd99omparison",
+ "saKKler",
+ "smDDooeM",
+ "smlei",
+ "samler_comparqon",
+ "samplercmparis0LLn",
+ "snvvpler_com66arison",
"sampler_comparison",
- "ampler_o99paPPison",
- "saplerKKcomparison",
- "saMpler_oomDDarison",
- "teiie_1B",
- "txureq1d",
- "txt00rLL_d",
+ "samplen_comparison",
+ "samlercompeerixxon",
+ "sONNpler_comparCCson",
+ "txture_1d",
+ "tex4uae_1d",
+ "extuNNe_1NN",
"texture_1d",
- "tnxture_16vv",
- "trrxtur_nd",
- "xxture_eed",
- "CCNOxture_2d",
- "txture_2d",
- "tex4uae_2d",
+ "texture1d",
+ "tuxtre1d",
+ "textErYYS1A",
+ "tex0ure_2d",
+ "texaaure_2d",
+ "tqqmmtur_d",
"texture_2d",
- "extuNNe_2NN",
- "texture2d",
- "tuxtre2d",
- "teYYtuAe_2d_arESy",
- "texture_2d_0rray",
- "texture_2d_aarray",
- "texture_2d_array",
- "texturmm_2d_arra",
- "texture_2d_aray",
- "teEuUUe_2darray",
+ "textue_2d",
+ "tUUxtureE",
"tKKture_Dd",
- "text__r0_3d",
- "tAtuel3p",
+ "0exture_2d_a__rat",
+ "tpturl_2_Array",
+ "txture_2M_array",
+ "texture_2d_array",
+ "BBexture_2d_array",
+ "nnxtbbre_2_a99ray",
+ "texturEE2d_aAAray",
+ "tex66ur5_3d",
+ "tHxture_3d",
+ "teHHuxe_3d",
"texture_3d",
- "textue_3d",
- "texturBB_3d",
- "nnbb99re_3d",
- "AAEExture_cub",
- "t66Ttu5e_cube",
- "textuHe_cube",
+ "tzxturny_0d",
+ "teture_3d",
+ "Hexture3k",
+ "textur_cubc",
+ "trrxtoorecbe",
+ "textreJJcub",
"texture_cube",
- "textrexxHcub",
- "tzx0uryy_cnbe",
- "texture_cue",
- "texurH_kube_array",
- "exture_cube_array",
- "ooexrrre_cbe_array",
+ "0Cxture_cube",
+ "99eFtureAAcbx",
+ "textcre_cube",
+ "Sexture_cube_array",
+ "txtureBBcobe_arras",
+ "teture_cube_array",
"texture_cube_array",
- "textre_cubJJarray",
- "tCCxtu0e_cube_arry",
- "texturAAcxbe99aFray",
- "textcre_depth_2d",
- "texture_Septh_2d",
- "textureodpthBB2d",
+ "texturemmebe_array",
+ "tQQturPP_cube_arragg",
+ "textr_cubBrray",
+ "teKKNllre_eth_2d",
+ "texture_ephrr2d",
+ "rppture_depth_2d",
"texture_depth_2d",
- "texture_dept_2d",
- "textummedepth_2d",
- "toxture_ggeQQtPP2d",
- "tetur_dptB_2d_rray",
- "texNure_deKKh2d_arrlly",
- "teture_dpth_2d_arrray",
+ "texture_deyPth_2d",
+ "extue_dZZpth_ccd",
+ "texure_depth_2",
+ "textu00e_depth_2d_array",
+ "tPJxture_BBsspth_2d_arry",
+ "teffture_wwepth_2dJJarra",
"texture_depth_2d_array",
- "texture_epth_ppd_array",
- "teyturPP_depth_2d_array",
- "texture_ZZptcc_2d_arry",
- "txtue_depth_cube",
- "texture00depth_cube",
- "texPPuBB_deJth_cusse",
+ "Iextu1e_dpth_2d_arraXX",
+ "extur_depth2_arry",
+ "texture_depth_2_array",
+ "tuxtreKKdepth_cube",
+ "44edture_depmh_ube",
+ "pexture_deoth_cube",
"texture_depth_cube",
- "texJJre_dffpwwh_fube",
- "textIre_depXXh_cub",
- "textur_ph_cue",
- "textue_depth_cube_array",
- "tKKxtue_depth_cube_array",
- "teture_d44ptm_cube_adray",
+ "textre_djphhhNNcHHbe",
+ "textu33e_depth_EuwwUU",
+ "texture_dethuucbe",
+ "excurrr_depddh_cube_array",
+ "2exturePPttpth_cube_array",
+ "texture_depthwwcub1sarray",
"texture_depth_cube_array",
- "pexture_deoth_cube_array",
- "thhHxtureNdepth_cubejarray",
- "texwwuUUe_depthEc33be_array",
- "texture_dept_multiuuampled_2",
- "ddextKre_depth_ultisampcerr_2d",
- "textuPPe_depr_multttsample2_2d",
+ "nnexture_depthcc11be_array",
+ "texture_depthcube_array",
+ "texture_depth_cube_arry",
+ "texture_deIth_multsa66pleaaSS2d",
+ "texture_depth_mDltisamEEld_2d",
+ "texture_Iepth_multiccamRleV_2d",
"texture_depth_multisampled_2d",
- "1exture_depth_wwsltisampled_2d",
- "textuce_depth_mnnltisamp11ed_2d",
- "texture_depth_multisapled_2d",
- "texture_externl",
- "teSS66ue_exaaeInal",
- "textuEEe_extenal",
+ "texture_dephmultisampled92d",
+ "texthraa_depth_multsampled_2d",
+ "texture_depth_SultisaLLped_2d",
+ "txfure_ertermma",
+ "teVturem4xqerna",
+ "textu___extenal",
"texture_external",
- "ccexture_exVerIRl",
- "te9tue_extrnal",
- "taaxture_exterha",
- "texture_multisamLLeS_2d",
- "tefurmm_mutisampled_2d",
- "texture_mul4isampld_qV",
+ "texurQ_eternal",
+ "textureddetRErnal",
+ "text9re_extenal",
+ "t0xtre_multisamCCe_2d",
+ "texure_zulisampled_2d",
+ "texccure_multisampled_2d",
"texture_multisampled_2d",
- "texture_multisa_pled_d",
- "texure_multisampledQd",
- "texRRuremultisampledEd2d",
- "textur_st9rage_1d",
- "tCCx0ure_strag_1",
- "textuezstorae_1d",
+ "tOxture_mu_tisampled2QQ",
+ "exture_multsampledtt2d",
+ "textCCEe_mult33samzzled_ppd",
+ "textudde_storaghh_1d",
+ "_etur77_66torage_1d",
+ "texture_storaPe_1d",
"texture_storage_1d",
- "texccure_storage_1d",
- "textureOQQ_orge_1d",
- "teturettstrage_1d",
- "textCCrepzzstEr33ge_2d",
- "textudde_storaghh_2d",
- "_etur77_66torage_2d",
+ "twxture_storage_1d",
+ "textur_straguu_1",
+ "texture_storaXXe_6d",
+ "textRRr_sorag_2d",
+ "textrestVVrag12d",
+ "texture_HHtorGGge_2d",
"texture_storage_2d",
- "texture_storaPe_2d",
- "twxture_storage_2d",
- "textur_straguu_2",
- "textureXXstorage_6d_array",
- "extuRRestorage_2d_aray",
- "txtre_storage_2dVVarr1",
+ "tFFxture_storMge_7d",
+ "texture_storage_d",
+ "3xTugge_stoage_2d",
+ "text_rP_Qtorage12d_arrKKy",
+ "tExture_strage_2d_array",
+ "extMre_storage_d_array",
"texture_storage_2d_array",
- "GGexture_storHHge_2d_array",
- "MFFxt7re_storage_2d_array",
- "texture_storage_d_array",
- "3xTugge_stoage_3d",
- "texturP_QtKKrag1__d",
- "textre_storageE3d",
+ "texturGGst77ragX_2d_SSrray",
+ "textturFF_storae_2d_arraK",
+ "textuoe_storage_2dssZarrUUy",
+ "texturestorage_3d",
+ "telture_storage_3d",
+ "texture_htorage_3d",
"texture_storage_3d",
- "tMture_storage_d",
- "t77xture_sGGorSSe_3d",
- "txtttre_storage_3FF",
- "uZZss2",
- "u2",
- "u3l",
+ "texturTTKstorage_d",
+ "texturww_storagee3",
+ "textureKsjjragvv_3d",
+ "Y2",
+ "EEI",
+ "u3QQ",
"u32",
- "u3h",
- "uTT",
- "ww2",
- "vKvjj",
- "vYY",
- "EcI2",
+ "P",
+ "H3ff",
+ "u3n",
+ "Fc66",
+ "ssech",
+ "llFec",
"vec2",
- "vecQQ",
- "Pc",
- "veffH",
- "vec2n",
- "g6F2f",
- "vssh8f",
- "vec2f",
- "veFllf",
- "00e2j",
- "gec2f",
- "vece",
- "ffc2h",
+ "jj20",
+ "veg2",
+ "vce",
+ "ffc2f",
"ve",
- "vec2h",
- "ve2h",
- "vqc2h",
+ "ve2f",
+ "vec2f",
+ "vqc2f",
"AAe",
- "ec2i",
+ "ec2f",
"vec2j",
- "ZZec2i",
- "vec2i",
+ "ZZec2h",
"PPecII2",
- "ZZec2i",
- "vnnc2i",
+ "vec2h",
+ "ZZec2h",
+ "vnnc2h",
"HekkZ222",
"ec2",
"RcNQQ",
- "vec2u",
- "eDu",
+ "eDi",
+ "vec2i",
"s3c2cu",
- "vRR2u",
- "vlJJ3",
- "MM",
- "vT63",
- "vec3",
- "QQec3",
- "vuA",
- "e3",
+ "vRR2i",
+ "vc2JJl",
+ "MMu",
+ "v66T7",
+ "vQQcJu",
+ "vec2u",
+ "Auc2",
+ "ve2",
"yeq3",
- "vec3xx",
- "crr",
- "vec3f",
- "v99cf",
- "vecf",
- "ecHl",
- "e_h",
+ "vxxc3",
+ "rr",
+ "e993",
+ "vec3",
+ "ec3",
+ "vlH",
+ "ec",
"uec3",
- "vc3h",
- "vec3h",
- "EEtmec3h",
+ "vc3f",
+ "EEtmec3f",
+ "vec3f",
"vec",
"ec3rr",
- "xc3i",
+ "xc3f",
"vezz",
"vec3e",
- "vec3i",
"uc3Zp",
+ "vec3h",
"00uc7TT",
"vvJJ",
- "vecQu",
+ "vecQh",
"ve3R",
"e",
- "vec3u",
"veprPP",
- "xxeDD88u",
- "lldmYYqqu",
- "FFec4",
- "rGecNN",
- "Mecl",
+ "vec3i",
+ "xxeDD88i",
+ "lldmYYqqi",
+ "vFFc__",
+ "rrNNc3u",
+ "leM3u",
+ "c3",
+ "vec3u",
+ "xlc3u",
+ "ec3u",
+ "ae44u",
+ "WWeG4",
+ "vjjc",
+ "vjjc4",
"vec4",
- "c",
- "qxl4",
+ "vj4",
"ve4",
- "ae44f",
- "vec4WW",
- "vecjj",
- "vec4f",
- "vjjc4f",
- "vj1f",
- "vc4f",
- "vec499",
- "vyVV4h",
+ "99ec4",
+ "vyVV4f",
"ec4xZ",
- "vec4h",
- "v33vvh",
+ "v33vvf",
+ "vec4f",
"vecs9",
"veF4",
- "uec4i",
+ "uec4f",
"eIKK",
"ve4J",
- "vec4i",
- "vSSCCXXi",
+ "vSSCCXXh",
+ "vec4h",
"JecWW6ZZ",
"ecd5",
"vBBcBU",
"JJ0c411",
- "vecttu",
- "vec4u",
+ "vectti",
"vttc",
- "veL4u",
- "v1c4u",
+ "vec4i",
+ "veL4i",
+ "v1c4i",
+ "veww4i",
+ "ece",
+ "vc4u",
+ "vec4NN",
+ "vec4u",
+ "vUlRR__u",
+ "vecHu",
+ "vrCC4u",
};
for (auto _ : state) {
for (auto* str : kStrings) {
diff --git a/src/tint/lang/core/builtin_type_test.cc b/src/tint/lang/core/builtin_type_test.cc
index 8fd8d6a..886a7e3 100644
--- a/src/tint/lang/core/builtin_type_test.cc
+++ b/src/tint/lang/core/builtin_type_test.cc
@@ -90,6 +90,7 @@
{"f16", BuiltinType::kF16},
{"f32", BuiltinType::kF32},
{"i32", BuiltinType::kI32},
+ {"input_attachment", BuiltinType::kInputAttachment},
{"mat2x2", BuiltinType::kMat2X2},
{"mat2x2f", BuiltinType::kMat2X2F},
{"mat2x2h", BuiltinType::kMat2X2H},
@@ -255,195 +256,198 @@
{"0yz2", BuiltinType::kUndefined},
{"iVP", BuiltinType::kUndefined},
{"Cnn", BuiltinType::kUndefined},
- {"AtqqHH2", BuiltinType::kUndefined},
- {"at2x2", BuiltinType::kUndefined},
- {"mafKK", BuiltinType::kUndefined},
- {"ltgg2f", BuiltinType::kUndefined},
- {"mat2xf", BuiltinType::kUndefined},
- {"NTTtcx4f", BuiltinType::kUndefined},
- {"ma7ppl2h", BuiltinType::kUndefined},
+ {"nput_attacAAmeHHt", BuiltinType::kUndefined},
+ {"nput_attachment", BuiltinType::kUndefined},
+ {"input_attKKfmen", BuiltinType::kUndefined},
+ {"Paggx", BuiltinType::kUndefined},
+ {"mat2x", BuiltinType::kUndefined},
+ {"maN2c42", BuiltinType::kUndefined},
+ {"ma7ppl2f", BuiltinType::kUndefined},
{"mNNt2xg", BuiltinType::kUndefined},
- {"uub2XX2h", BuiltinType::kUndefined},
- {"mt2x3", BuiltinType::kUndefined},
- {"m88xK", BuiltinType::kUndefined},
- {"maqx3", BuiltinType::kUndefined},
- {"m11t2x3f", BuiltinType::kUndefined},
- {"22at2iif", BuiltinType::kUndefined},
- {"at2x377", BuiltinType::kUndefined},
- {"m2t2xNh", BuiltinType::kUndefined},
- {"mVVt2x3h", BuiltinType::kUndefined},
- {"FaWW2w11h", BuiltinType::kUndefined},
- {"matww4", BuiltinType::kUndefined},
- {"mat2D4", BuiltinType::kUndefined},
- {"maKx4", BuiltinType::kUndefined},
- {"mat21PPhf", BuiltinType::kUndefined},
- {"mat24f", BuiltinType::kUndefined},
- {"mYYt2x4f", BuiltinType::kUndefined},
+ {"uub2XX2f", BuiltinType::kUndefined},
+ {"matx2h", BuiltinType::kUndefined},
+ {"Qt882h", BuiltinType::kUndefined},
+ {"mt9q2h", BuiltinType::kUndefined},
+ {"mat2113", BuiltinType::kUndefined},
+ {"Ft2xi22", BuiltinType::kUndefined},
+ {"m7t2x3", BuiltinType::kUndefined},
+ {"m2t2xNf", BuiltinType::kUndefined},
+ {"mVVt2x3f", BuiltinType::kUndefined},
+ {"FaWW2w11f", BuiltinType::kUndefined},
+ {"mawwx3h", BuiltinType::kUndefined},
+ {"Dat2x3h", BuiltinType::kUndefined},
+ {"mt2x3K", BuiltinType::kUndefined},
+ {"11at2xPP", BuiltinType::kUndefined},
+ {"mat2x", BuiltinType::kUndefined},
+ {"mat2xYY", BuiltinType::kUndefined},
{"mttHH4kk", BuiltinType::kUndefined},
- {"mat2rr4h", BuiltinType::kUndefined},
- {"WWas2x4h", BuiltinType::kUndefined},
- {"maYx2", BuiltinType::kUndefined},
- {"mq3f2", BuiltinType::kUndefined},
- {"vvafu222", BuiltinType::kUndefined},
- {"t3x2f", BuiltinType::kUndefined},
- {"YYat3f", BuiltinType::kUndefined},
- {"may3x2EYY", BuiltinType::kUndefined},
- {"da3xMoh", BuiltinType::kUndefined},
+ {"mat2rr4f", BuiltinType::kUndefined},
+ {"WWas2x4f", BuiltinType::kUndefined},
+ {"Yt2x4h", BuiltinType::kUndefined},
+ {"mt2qfh", BuiltinType::kUndefined},
+ {"mav222xuh", BuiltinType::kUndefined},
+ {"mt32", BuiltinType::kUndefined},
+ {"maY32", BuiltinType::kUndefined},
+ {"YYa7y3E2", BuiltinType::kUndefined},
+ {"da3xMof", BuiltinType::kUndefined},
{"matMMx2", BuiltinType::kUndefined},
- {"mat3x55h", BuiltinType::kUndefined},
- {"maN3", BuiltinType::kUndefined},
- {"ma33x3", BuiltinType::kUndefined},
- {"mt3x3", BuiltinType::kUndefined},
- {"mm66Issf", BuiltinType::kUndefined},
- {"mat3x1f", BuiltinType::kUndefined},
- {"Xt3x3", BuiltinType::kUndefined},
- {"LatIx3h", BuiltinType::kUndefined},
- {"at3fh", BuiltinType::kUndefined},
+ {"mat3x55f", BuiltinType::kUndefined},
+ {"maN32", BuiltinType::kUndefined},
+ {"ma3Ox33", BuiltinType::kUndefined},
+ {"m3t3x2h", BuiltinType::kUndefined},
+ {"mt3I3", BuiltinType::kUndefined},
+ {"mnnt3xr", BuiltinType::kUndefined},
+ {"mXX", BuiltinType::kUndefined},
+ {"LatIx3f", BuiltinType::kUndefined},
+ {"at3ff", BuiltinType::kUndefined},
{"mYtURD3", BuiltinType::kUndefined},
- {"mah3x4", BuiltinType::kUndefined},
- {"muqII4", BuiltinType::kUndefined},
- {"mat3xH", BuiltinType::kUndefined},
- {"at3QQvv", BuiltinType::kUndefined},
- {"at66ef", BuiltinType::kUndefined},
- {"ma7O4f", BuiltinType::kUndefined},
+ {"mah3x3h", BuiltinType::kUndefined},
+ {"uuIqt3x", BuiltinType::kUndefined},
+ {"maH3x3h", BuiltinType::kUndefined},
+ {"at3Qvv", BuiltinType::kUndefined},
+ {"66ate", BuiltinType::kUndefined},
+ {"mat7x", BuiltinType::kUndefined},
{"m55t3x0DD", BuiltinType::kUndefined},
{"maH3x4II", BuiltinType::kUndefined},
{"at3x4", BuiltinType::kUndefined},
- {"ma994x2", BuiltinType::kUndefined},
- {"mWWt4Gt2", BuiltinType::kUndefined},
- {"ay42", BuiltinType::kUndefined},
- {"mt4x2f", BuiltinType::kUndefined},
- {"IIaBB4x2f", BuiltinType::kUndefined},
- {"TTat4x833", BuiltinType::kUndefined},
- {"ddUUnntYYx2h", BuiltinType::kUndefined},
+ {"rat3x499", BuiltinType::kUndefined},
+ {"mGtt31W4h", BuiltinType::kUndefined},
+ {"yatx4", BuiltinType::kUndefined},
+ {"mt4x2", BuiltinType::kUndefined},
+ {"maBBI4x2", BuiltinType::kUndefined},
+ {"mat8TTx2", BuiltinType::kUndefined},
+ {"ddUUnntYYx2f", BuiltinType::kUndefined},
{"m5CCxxdZ", BuiltinType::kUndefined},
- {"matkkq2h", BuiltinType::kUndefined},
- {"5iitp00", BuiltinType::kUndefined},
- {"mnntIIx3", BuiltinType::kUndefined},
- {"ccaKx", BuiltinType::kUndefined},
- {"m43KK", BuiltinType::kUndefined},
- {"mat66x3f", BuiltinType::kUndefined},
- {"Et4PP3K", BuiltinType::kUndefined},
- {"xxatx3h", BuiltinType::kUndefined},
- {"qat4x3h", BuiltinType::kUndefined},
- {"MMayySrxh", BuiltinType::kUndefined},
- {"uat4", BuiltinType::kUndefined},
- {"tx4", BuiltinType::kUndefined},
- {"ma54FF4", BuiltinType::kUndefined},
- {"rra444z4f", BuiltinType::kUndefined},
- {"matWW", BuiltinType::kUndefined},
- {"CatZJXx4f", BuiltinType::kUndefined},
- {"maPPx4h", BuiltinType::kUndefined},
- {"mat4c4h", BuiltinType::kUndefined},
- {"matPPll6h", BuiltinType::kUndefined},
- {"9tyy", BuiltinType::kUndefined},
- {"ptKK", BuiltinType::kUndefined},
- {"x_", BuiltinType::kUndefined},
- {"ayKer", BuiltinType::kUndefined},
- {"szmpVek", BuiltinType::kUndefined},
- {"sampqeK", BuiltinType::kUndefined},
- {"sampler_comparisn", BuiltinType::kUndefined},
- {"sapler_comparisVVn", BuiltinType::kUndefined},
- {"samplerIcompaAUison", BuiltinType::kUndefined},
- {"jexurbRd", BuiltinType::kUndefined},
- {"exure_YYd", BuiltinType::kUndefined},
- {"exture_1d", BuiltinType::kUndefined},
+ {"matkkq2f", BuiltinType::kUndefined},
+ {"005itpxh", BuiltinType::kUndefined},
+ {"maIInnx2h", BuiltinType::kUndefined},
+ {"Ka4Wcc", BuiltinType::kUndefined},
+ {"mtKK", BuiltinType::kUndefined},
+ {"ma664x3", BuiltinType::kUndefined},
+ {"mKKtPx", BuiltinType::kUndefined},
+ {"xxatx3f", BuiltinType::kUndefined},
+ {"qat4x3f", BuiltinType::kUndefined},
+ {"MMayySrxf", BuiltinType::kUndefined},
+ {"mat3h", BuiltinType::kUndefined},
+ {"tx3h", BuiltinType::kUndefined},
+ {"ma5F4x3h", BuiltinType::kUndefined},
+ {"rraz44x4", BuiltinType::kUndefined},
+ {"aWWx", BuiltinType::kUndefined},
+ {"ZZJJtCxX", BuiltinType::kUndefined},
+ {"maPPx4f", BuiltinType::kUndefined},
+ {"mat4c4f", BuiltinType::kUndefined},
+ {"matPPll6f", BuiltinType::kUndefined},
+ {"mat994yy", BuiltinType::kUndefined},
+ {"mat4JKKh", BuiltinType::kUndefined},
+ {"mat4_h", BuiltinType::kUndefined},
+ {"K", BuiltinType::kUndefined},
+ {"kVz", BuiltinType::kUndefined},
+ {"KtS", BuiltinType::kUndefined},
+ {"ampler", BuiltinType::kUndefined},
+ {"aVVpler", BuiltinType::kUndefined},
+ {"AAamIlUr", BuiltinType::kUndefined},
+ {"jamper_compaRson", BuiltinType::kUndefined},
+ {"amplr44compYYriso", BuiltinType::kUndefined},
+ {"samper_comparison", BuiltinType::kUndefined},
{"texxxur_1d", BuiltinType::kUndefined},
- {"tJxucce_2d", BuiltinType::kUndefined},
+ {"tJxucce_1d", BuiltinType::kUndefined},
{"texure_JJd", BuiltinType::kUndefined},
- {"lDexture_fCC_arraU", BuiltinType::kUndefined},
- {"tegture_2d_array", BuiltinType::kUndefined},
- {"teCCure2d_arra", BuiltinType::kUndefined},
- {"textue_3d", BuiltinType::kUndefined},
- {"tIx__ure_3d", BuiltinType::kUndefined},
- {"texurettPP", BuiltinType::kUndefined},
- {"tddx3ure_cube", BuiltinType::kUndefined},
- {"teKyyur_cube", BuiltinType::kUndefined},
- {"teturecub", BuiltinType::kUndefined},
- {"textinne_c03e_array", BuiltinType::kUndefined},
- {"nextCCruuvcubK_array", BuiltinType::kUndefined},
- {"tXxturellcbe_array", BuiltinType::kUndefined},
- {"tppxture_depth_2d", BuiltinType::kUndefined},
- {"txture_deptww_2d", BuiltinType::kUndefined},
- {"gexturedemmthuu2", BuiltinType::kUndefined},
- {"texmmre_depthaa2daray", BuiltinType::kUndefined},
- {"texture_RRepth_Td_ccZray", BuiltinType::kUndefined},
- {"text88re_depthTOd_array", BuiltinType::kUndefined},
- {"texture_depth_cm00e", BuiltinType::kUndefined},
- {"texture_Bmepth_cube", BuiltinType::kUndefined},
- {"Mextre_ppeph_cube", BuiltinType::kUndefined},
- {"texturOO_depth_cub_array", BuiltinType::kUndefined},
- {"GeGGture_depthcube_array", BuiltinType::kUndefined},
- {"texture11Hdepth_cube_array", BuiltinType::kUndefined},
- {"textu6e_FFepth_multiameeled_2d", BuiltinType::kUndefined},
- {"texture_epth_mltisampled_2d", BuiltinType::kUndefined},
- {"texture_depth_mullKsaiipled_2d", BuiltinType::kUndefined},
- {"texture_extenal", BuiltinType::kUndefined},
- {"IIext99reexvvernal", BuiltinType::kUndefined},
- {"texture_externl", BuiltinType::kUndefined},
- {"texture_mhltisampled_2d", BuiltinType::kUndefined},
- {"texturemPllltisampzzed_2d", BuiltinType::kUndefined},
- {"exture_mltisamed_2d", BuiltinType::kUndefined},
- {"texture_qqtoragff_1", BuiltinType::kUndefined},
- {"textre_JJddorage_1W", BuiltinType::kUndefined},
- {"XXrxture_storae1zz", BuiltinType::kUndefined},
- {"texturestorag2_2d", BuiltinType::kUndefined},
- {"yyNxture_storage_2d", BuiltinType::kUndefined},
- {"etue_storage_2OO", BuiltinType::kUndefined},
- {"reutuPe_storZgeE2d_array", BuiltinType::kUndefined},
- {"texlure_storddeee_d_22rray", BuiltinType::kUndefined},
- {"texture_mtorage_2V_a9ra", BuiltinType::kUndefined},
- {"teII1re_storage_3d", BuiltinType::kUndefined},
- {"texture_storagb_3d", BuiltinType::kUndefined},
- {"texizrestorge73d", BuiltinType::kUndefined},
- {"u3oi", BuiltinType::kUndefined},
- {"3", BuiltinType::kUndefined},
- {"S2", BuiltinType::kUndefined},
- {"e22", BuiltinType::kUndefined},
- {"1eC2", BuiltinType::kUndefined},
- {"vf8c2", BuiltinType::kUndefined},
- {"c2f", BuiltinType::kUndefined},
- {"JJecSSf", BuiltinType::kUndefined},
- {"92f", BuiltinType::kUndefined},
+ {"lextuUe_2fDC", BuiltinType::kUndefined},
+ {"textgre_2d", BuiltinType::kUndefined},
+ {"CCxtue_2", BuiltinType::kUndefined},
+ {"txture_2d_array", BuiltinType::kUndefined},
+ {"textu__e_2d_arraI", BuiltinType::kUndefined},
+ {"texurPtt_2dNrray", BuiltinType::kUndefined},
+ {"tddx3ure_3d", BuiltinType::kUndefined},
+ {"teyytur_Kd", BuiltinType::kUndefined},
+ {"tetuuud", BuiltinType::kUndefined},
+ {"tex0unne_cu3e", BuiltinType::kUndefined},
+ {"uuexnure_cuvCK", BuiltinType::kUndefined},
+ {"tXllure_cube", BuiltinType::kUndefined},
+ {"texture_cppbo_array", BuiltinType::kUndefined},
+ {"teture_wwube_array", BuiltinType::kUndefined},
+ {"texturgm_cuube_aay", BuiltinType::kUndefined},
+ {"texmmre_deaath_", BuiltinType::kUndefined},
+ {"textRRcceTdeptZ_2d", BuiltinType::kUndefined},
+ {"te88tureOdTpth_2d", BuiltinType::kUndefined},
+ {"textume_00epth_2d_array", BuiltinType::kUndefined},
+ {"texturm_depth_BBd_array", BuiltinType::kUndefined},
+ {"texppur_depth_M_array", BuiltinType::kUndefined},
+ {"textre_deptOO_cube", BuiltinType::kUndefined},
+ {"texture_deptG_GGbe", BuiltinType::kUndefined},
+ {"tHHx11ure_depth_cube", BuiltinType::kUndefined},
+ {"texeere_depth_c6bFF_array", BuiltinType::kUndefined},
+ {"texure_depth_cub_array", BuiltinType::kUndefined},
+ {"tKxtiire_depth_cule_array", BuiltinType::kUndefined},
+ {"texture_depth_mulisampled_2d", BuiltinType::kUndefined},
+ {"texture99vdpth_multisIImpled_2d", BuiltinType::kUndefined},
+ {"texture_depth_multisampled_2", BuiltinType::kUndefined},
+ {"texture_hxternal", BuiltinType::kUndefined},
+ {"textullPP_extzzrna", BuiltinType::kUndefined},
+ {"texure_teral", BuiltinType::kUndefined},
+ {"texture_mufftiqqamled_2d", BuiltinType::kUndefined},
+ {"tddtuJJe_multisampled_2d", BuiltinType::kUndefined},
+ {"texuXXe_multisampldzz2d", BuiltinType::kUndefined},
+ {"texturestorag2_1d", BuiltinType::kUndefined},
+ {"yyNxture_storage_1d", BuiltinType::kUndefined},
+ {"etue_storage_1OO", BuiltinType::kUndefined},
+ {"reuEure_storZge_2P", BuiltinType::kUndefined},
+ {"teexture_sl2ddrage_d", BuiltinType::kUndefined},
+ {"tVVxture_9tagm_2d", BuiltinType::kUndefined},
+ {"tIIture_storage_2d_arr1y", BuiltinType::kUndefined},
+ {"texture_storagb_2d_array", BuiltinType::kUndefined},
+ {"texture_stzrage_2dai7a", BuiltinType::kUndefined},
+ {"texoure_storagii_3d", BuiltinType::kUndefined},
+ {"exture_ntor5ge3d", BuiltinType::kUndefined},
+ {"exture_storiSe_3d", BuiltinType::kUndefined},
+ {"22", BuiltinType::kUndefined},
+ {"uGC", BuiltinType::kUndefined},
+ {"f832", BuiltinType::kUndefined},
+ {"e2", BuiltinType::kUndefined},
+ {"SJJec2", BuiltinType::kUndefined},
+ {"9c", BuiltinType::kUndefined},
{"vbbJJ2TT", BuiltinType::kUndefined},
- {"e66h", BuiltinType::kUndefined},
- {"u662h", BuiltinType::kUndefined},
- {"vW2i", BuiltinType::kUndefined},
- {"v2i", BuiltinType::kUndefined},
- {"veci", BuiltinType::kUndefined},
- {"rec2u", BuiltinType::kUndefined},
+ {"e66f", BuiltinType::kUndefined},
+ {"u662f", BuiltinType::kUndefined},
+ {"vW2h", BuiltinType::kUndefined},
+ {"v2h", BuiltinType::kUndefined},
+ {"vech", BuiltinType::kUndefined},
+ {"rec2i", BuiltinType::kUndefined},
{"2ec2B", BuiltinType::kUndefined},
- {"vcBBu", BuiltinType::kUndefined},
- {"veRR", BuiltinType::kUndefined},
- {"VLL0", BuiltinType::kUndefined},
- {"KOe3", BuiltinType::kUndefined},
- {"vgwcf", BuiltinType::kUndefined},
- {"vLphf", BuiltinType::kUndefined},
- {"eiiEf", BuiltinType::kUndefined},
- {"ec3h", BuiltinType::kUndefined},
+ {"vcBBi", BuiltinType::kUndefined},
+ {"vRc2u", BuiltinType::kUndefined},
+ {"v2LL0", BuiltinType::kUndefined},
+ {"vKOOu", BuiltinType::kUndefined},
+ {"gwc3", BuiltinType::kUndefined},
+ {"hpLc", BuiltinType::kUndefined},
+ {"Eiic", BuiltinType::kUndefined},
+ {"ec3f", BuiltinType::kUndefined},
{"UU883", BuiltinType::kUndefined},
- {"rrecvvh", BuiltinType::kUndefined},
+ {"rrecvvf", BuiltinType::kUndefined},
{"ecmm", BuiltinType::kUndefined},
{"vec4j", BuiltinType::kUndefined},
{"vec3X", BuiltinType::kUndefined},
{"vec38", BuiltinType::kUndefined},
{"vecvEE", BuiltinType::kUndefined},
{"z99ci", BuiltinType::kUndefined},
- {"JJGeQQ4", BuiltinType::kUndefined},
- {"ssec4", BuiltinType::kUndefined},
- {"PecK", BuiltinType::kUndefined},
- {"tpc4f", BuiltinType::kUndefined},
- {"vec", BuiltinType::kUndefined},
- {"MMec4f", BuiltinType::kUndefined},
+ {"GGeJJA3u", BuiltinType::kUndefined},
+ {"vess3u", BuiltinType::kUndefined},
+ {"vPcKu", BuiltinType::kUndefined},
+ {"vtc4", BuiltinType::kUndefined},
+ {"e4", BuiltinType::kUndefined},
+ {"veMM4", BuiltinType::kUndefined},
{"vJJc40", BuiltinType::kUndefined},
{"8c", BuiltinType::kUndefined},
{"vecggKh", BuiltinType::kUndefined},
- {"vecfi", BuiltinType::kUndefined},
+ {"vecfh", BuiltinType::kUndefined},
{"vec47Q", BuiltinType::kUndefined},
- {"veY4i", BuiltinType::kUndefined},
- {"keSu", BuiltinType::kUndefined},
+ {"veY4h", BuiltinType::kUndefined},
+ {"keSi", BuiltinType::kUndefined},
{"n422", BuiltinType::kUndefined},
- {"vFFu", BuiltinType::kUndefined},
+ {"vFFi", BuiltinType::kUndefined},
+ {"GGIec4PP", BuiltinType::kUndefined},
+ {"aeEE4", BuiltinType::kUndefined},
+ {"ddBee4u", BuiltinType::kUndefined},
};
using BuiltinTypeParseTest = testing::TestWithParam<Case>;
diff --git a/src/tint/lang/core/core.def b/src/tint/lang/core/core.def
index d60e5b2..175f61c 100644
--- a/src/tint/lang/core/core.def
+++ b/src/tint/lang/core/core.def
@@ -161,6 +161,8 @@
texture_storage_3d
// https://www.w3.org/TR/WGSL/#external-texture-type
texture_external
+ // chromium_internal_input_attachments
+ input_attachment
// Internal types.
__packed_vec3 // note: not core type, but used by legacy MSL writer
diff --git a/src/tint/lang/wgsl/ast/builder.h b/src/tint/lang/wgsl/ast/builder.h
index 705e7db..b643fc4 100644
--- a/src/tint/lang/wgsl/ast/builder.h
+++ b/src/tint/lang/wgsl/ast/builder.h
@@ -46,6 +46,7 @@
#include "src/tint/lang/core/type/f16.h"
#include "src/tint/lang/core/type/f32.h"
#include "src/tint/lang/core/type/i32.h"
+#include "src/tint/lang/core/type/input_attachment.h"
#include "src/tint/lang/core/type/matrix.h"
#include "src/tint/lang/core/type/multisampled_texture.h"
#include "src/tint/lang/core/type/pointer.h"
@@ -1298,6 +1299,12 @@
/// @returns the external texture
ast::Type external_texture() const { return (*this)("texture_external"); }
+ /// @param subtype the texture subtype.
+ /// @returns the input attachment
+ ast::Type input_attachment(ast::Type subtype) const {
+ return (*this)("input_attachment", subtype);
+ }
+
/// @param source the Source of the node
/// @returns the external texture
ast::Type external_texture(const Source& source) const {
diff --git a/src/tint/lang/wgsl/ast/transform/renamer_test.cc b/src/tint/lang/wgsl/ast/transform/renamer_test.cc
index b3aa2ac..6912b2e 100644
--- a/src/tint/lang/wgsl/ast/transform/renamer_test.cc
+++ b/src/tint/lang/wgsl/ast/transform/renamer_test.cc
@@ -1866,7 +1866,8 @@
std::vector<std::string_view> out;
for (auto type : core::kBuiltinTypeStrings) {
if (type != "ptr" && type != "atomic" && !tint::HasPrefix(type, "sampler") &&
- !tint::HasPrefix(type, "texture") && !tint::HasPrefix(type, "__")) {
+ !tint::HasPrefix(type, "texture") && !tint::HasPrefix(type, "__") &&
+ !tint::HasPrefix(type, "input_attachment")) {
out.push_back(type);
}
}
diff --git a/src/tint/lang/wgsl/resolver/resolver.cc b/src/tint/lang/wgsl/resolver/resolver.cc
index 34d3af3..0a17841 100644
--- a/src/tint/lang/wgsl/resolver/resolver.cc
+++ b/src/tint/lang/wgsl/resolver/resolver.cc
@@ -46,6 +46,7 @@
#include "src/tint/lang/core/type/depth_multisampled_texture.h"
#include "src/tint/lang/core/type/depth_texture.h"
#include "src/tint/lang/core/type/external_texture.h"
+#include "src/tint/lang/core/type/input_attachment.h"
#include "src/tint/lang/core/type/memory_view.h"
#include "src/tint/lang/core/type/multisampled_texture.h"
#include "src/tint/lang/core/type/pointer.h"
@@ -2654,6 +2655,8 @@
return StorageTexture(ident, core::type::TextureDimension::k2dArray);
case core::BuiltinType::kTextureStorage3D:
return StorageTexture(ident, core::type::TextureDimension::k3d);
+ case core::BuiltinType::kInputAttachment:
+ return InputAttachment(ident);
case core::BuiltinType::kPackedVec3:
return PackedVec3T(ident);
case core::BuiltinType::kAtomicCompareExchangeResultI32:
@@ -2968,6 +2971,21 @@
return tex;
}
+core::type::InputAttachment* Resolver::InputAttachment(const ast::Identifier* ident) {
+ auto* tmpl_ident = TemplatedIdentifier(ident, 1);
+ if (TINT_UNLIKELY(!tmpl_ident)) {
+ return nullptr;
+ }
+
+ auto* ty_expr = sem_.GetType(tmpl_ident->arguments[0]);
+ if (TINT_UNLIKELY(!ty_expr)) {
+ return nullptr;
+ }
+
+ auto* out = b.create<core::type::InputAttachment>(ty_expr);
+ return validator_.InputAttachment(out, ident->source) ? out : nullptr;
+}
+
core::type::Vector* Resolver::PackedVec3T(const ast::Identifier* ident) {
auto* tmpl_ident = TemplatedIdentifier(ident, 1);
if (TINT_UNLIKELY(!tmpl_ident)) {
diff --git a/src/tint/lang/wgsl/resolver/resolver.h b/src/tint/lang/wgsl/resolver/resolver.h
index 715d62a..df18f91 100644
--- a/src/tint/lang/wgsl/resolver/resolver.h
+++ b/src/tint/lang/wgsl/resolver/resolver.h
@@ -223,6 +223,9 @@
core::type::StorageTexture* StorageTexture(const ast::Identifier* ident,
core::type::TextureDimension dim);
+ /// @returns an input attachment resolved from the templated identifier @p ident
+ core::type::InputAttachment* InputAttachment(const ast::Identifier* ident);
+
/// @returns a packed vec3 resolved from the templated identifier @p ident.
core::type::Vector* PackedVec3T(const ast::Identifier* ident);
diff --git a/src/tint/lang/wgsl/resolver/validator.cc b/src/tint/lang/wgsl/resolver/validator.cc
index 155aaf1..f482497 100644
--- a/src/tint/lang/wgsl/resolver/validator.cc
+++ b/src/tint/lang/wgsl/resolver/validator.cc
@@ -441,6 +441,15 @@
return true;
}
+bool Validator::InputAttachment(const core::type::InputAttachment* t, const Source& source) const {
+ if (!t->type()->UnwrapRef()->IsAnyOf<core::type::F32, core::type::I32, core::type::U32>()) {
+ AddError(source) << "input_attachment<type>: type must be f32, i32 or u32";
+ return false;
+ }
+
+ return true;
+}
+
bool Validator::Materialize(const core::type::Type* to,
const core::type::Type* from,
const Source& source) const {
diff --git a/src/tint/lang/wgsl/resolver/validator.h b/src/tint/lang/wgsl/resolver/validator.h
index 0fa3bd9..6cdbfaf 100644
--- a/src/tint/lang/wgsl/resolver/validator.h
+++ b/src/tint/lang/wgsl/resolver/validator.h
@@ -428,6 +428,12 @@
/// @returns true on success, false otherwise
bool MultisampledTexture(const core::type::MultisampledTexture* t, const Source& source) const;
+ /// Validates a input attachment
+ /// @param t the input attachment to validate
+ /// @param source the source of the input attachment
+ /// @returns true on success, false otherwise
+ bool InputAttachment(const core::type::InputAttachment* t, const Source& source) const;
+
/// Validates a structure
/// @param str the structure to validate
/// @param stage the current pipeline stage