tint/msl: Preserve trailing vec3 padding

In order to preserve padding properly for MSL, we need to use its
packed_vec type for all vec3 types in storage buffers, not just struct
members. This commit includes a complete rewrite of the PackedVec3
transform to achieve this. The key details are:

* An internal `__packed_vec3<>` type was added, which corresponds to a
  `type::Vector` with an additional flag to indicate that it will be
  emitted as packed vector.

* The `PackedVec3` transform replaces all vec3 types used in
  host-shareable address spaces with the internal `__packed_vec3`
  type. This includes vec3 types that appear as the store type of a
  pointer.

* When used as an array element, these `__packed_vec3` types are
  wrapped in a struct that contains a single `__packed_vec3`
  member. This allows us to add an `@align()` attribute that ensures
  that `array<vec3<T>>` still has the correct array element stride.

* When the `vec3<T>` appears as a struct member in the input program,
  we apply the `@align()` to that member to ensure that we do not
  change its offset.

* Matrix types with three rows that are used in memory are replaced
  with an array of columns, where each column uses a `__packed_vec3`
  inside an aligned wrapper structure as above.

* Accesses to host-shareable memory that involve any of these types
  invoke a "pack" or "unpack" helper function to convert them to the
  equivalent type that uses `__packed_vec3` or a regular `vec3` as
  required.

* The `chromium_internal_relaxed_uniform_layout` extension is used to
  avoid issues where modifying a type in the uniform address space
  triggers stricter layout validation rules.

Bug: tint:1571
Fixed: tint:1837
Change-Id: Idaf2da2f5bcb2be00c85ec657edfb614186476bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121200
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
James Price 2023-02-27 20:21:03 +00:00 committed by Dawn LUCI CQ
parent 55183e6c3a
commit 4d3af66bbd
389 changed files with 16692 additions and 3527 deletions

View File

@ -28,6 +28,9 @@ namespace tint::builtin {
/// @param str the string to parse /// @param str the string to parse
/// @returns the parsed enum, or Builtin::kUndefined if the string could not be parsed. /// @returns the parsed enum, or Builtin::kUndefined if the string could not be parsed.
Builtin ParseBuiltin(std::string_view str) { Builtin ParseBuiltin(std::string_view str) {
if (str == "__packed_vec3") {
return Builtin::kPackedVec3;
}
if (str == "array") { if (str == "array") {
return Builtin::kArray; return Builtin::kArray;
} }
@ -242,6 +245,8 @@ std::ostream& operator<<(std::ostream& out, Builtin value) {
switch (value) { switch (value) {
case Builtin::kUndefined: case Builtin::kUndefined:
return out << "undefined"; return out << "undefined";
case Builtin::kPackedVec3:
return out << "__packed_vec3";
case Builtin::kArray: case Builtin::kArray:
return out << "array"; return out << "array";
case Builtin::kAtomic: case Builtin::kAtomic:

View File

@ -30,6 +30,7 @@ namespace tint::builtin {
/// An enumerator of builtin builtin. /// An enumerator of builtin builtin.
enum class Builtin { enum class Builtin {
kUndefined, kUndefined,
kPackedVec3,
kArray, kArray,
kAtomic, kAtomic,
kBool, kBool,
@ -112,6 +113,7 @@ std::ostream& operator<<(std::ostream& out, Builtin value);
Builtin ParseBuiltin(std::string_view str); Builtin ParseBuiltin(std::string_view str);
constexpr const char* kBuiltinStrings[] = { constexpr const char* kBuiltinStrings[] = {
"__packed_vec3",
"array", "array",
"atomic", "atomic",
"bool", "bool",

View File

@ -31,489 +31,496 @@ namespace {
void BuiltinParser(::benchmark::State& state) { void BuiltinParser(::benchmark::State& state) {
const char* kStrings[] = { const char* kStrings[] = {
"arccy", "__acked_veccc",
"3a", "_pac3ed_v3",
"aVray", "__packeV_vec3",
"__packed_vec3",
"__pa1ked_vec3",
"_qqJcked_vec3",
"__pack77d_vllc3",
"arqHapp",
"vy",
"Grby",
"array", "array",
"arra1", "arviay",
"qqrJy", "ar8WWy",
"arrll7y", "Mxxra",
"atppmHHc", "atXggi",
"cto", "Xoic",
"abGmi", "ato3ic",
"atomic", "atomic",
"atvmiii", "aEomic",
"atWWm8c", "toTTiPP",
"xxtomc", "ddtoxxi",
"bXgg", "44ool",
"Xu", "VVSSol",
"b3ol", "RoRl",
"bool", "bool",
"booE", "oFl",
"TTPol", "boo",
"xxool", "ORVHl",
"4416", "y1",
"fSVV6", "l77rrn6",
"RR2", "4016",
"f16", "f16",
"96",
"f1",
"VOR6",
"y3",
"l77rrn2",
"4032",
"f32",
"5", "5",
"u377", "u16",
"kk2", "f",
"ii", "f3kk",
"i3XX", "fi",
"f3XX",
"f32",
"55399II", "55399II",
"i32", "frSSHHa",
"irSSHHa",
"U", "U",
"jV3", "jV3",
"ax2", "",
"t2SGG", "GG",
"q2x2", "i32",
"mat2x2", "2",
"at2", "",
"majjx", "jj",
"a2xrf", "a2xrf",
"mat2xjf", "mat2j2",
"mNNw2x28", "m82wNN2",
"matx2f", "mat2x2",
"mat2x2f", "mt2x2",
"mrrt2x2f", "rrat2x2",
"Gat2x2f", "mGt2x2",
"mat2x2FF", "mat2x2FF",
"at2h", "at2f",
"marrx2h", "marrx2f",
"t2x2h", "mat2x2f",
"mat2x2h", "t2x2f",
"Da2xJJh", "Da2xJJf",
"ma82", "ma82",
"m11k2", "m11k2",
"matx3", "matx2h",
"maJx3", "maJx2h",
"cat2x3", "mat2x2h",
"mat2x3", "mat2c2h",
"mat2O3", "mat2x2O",
"ttKavv2x__", "KK_atvvtt2h",
"5txxx8", "5txxx8",
"__qatF3", "a__xqq",
"matqx3f", "maqq2x",
"33atOx3f", "mat2x3",
"mat2x3f", "ma32x66",
"mtt62x9oQQ", "mttQQo2x3",
"ma2x66f", "mat66x",
"mtOxzz66", "mtOxzz66",
"mat2yy3h", "mat2yy3f",
"ZaHH3Z", "ZaHH3Z",
"4WWt2q3h", "mat2x3f",
"mat2x3h", "4WWt2q3f",
"mOO2x3h", "mOO2x3f",
"oatY3h", "oatY3f",
"matx", "matx",
"ma2x4", "ma2xFh",
"matw4", "at2x3w",
"ma2Gf", "mat2x3h",
"mat2x4", "fGtxKh",
"qatKKx4", "matqKx3h",
"mmmt2x4", "matmmxFh",
"at2x4", "at2x4",
"mt2x4q", "matxq",
"mat2xbb", "mb2bb4",
"mi2x4f", "mat2x4",
"mat2x4f", "it2x4",
"maOO2xq", "mOO2xq",
"matTvvx4f", "mat2Tvv4",
"maFF2x4f", "maFF2x4f",
"Pa00xQh", "Pa00xQf",
"mPt2x4h", "mPt2x4f",
"mat2x4f",
"ma772xss", "ma772xss",
"mat2x4h", "RRCbb2x4f",
"RRCbb2x4h", "mXXt2x4f",
"mXXt2x4h",
"qaCC2xOOh", "qaCC2xOOh",
"mtsuL", "ma2s4L",
"mat3xX", "mXt2x4h",
"mat3x", "mat2x4h",
"mat3x2", "mat24h",
"qqt2", "qa2O4",
"mat3x22", "mat2x22h",
"mzzyt3x", "mzzyt3x",
"matVViP", "atiVP2",
"mannC2f", "mt3Cnn",
"atx2AHHq", "mat3x2",
"AtqqHH2",
"at3x2",
"mafKK",
"ltgg2f",
"mat3xf",
"NTTtcx4f",
"mat3x2f", "mat3x2f",
"may3x2", "ma7ppl2f",
"aOOOZZf",
"Vt12f",
"mff__3x2h",
"qaTMMl4h",
"mNNt3xg", "mNNt3xg",
"mat3x2h", "uub3XX2f",
"uub3XX2h",
"matx2h", "matx2h",
"Qt882h", "Qt882h",
"maqx3", "mt9q2h",
"mat3113", "mat3x2h",
"Ft3xi22", "m11t3x2h",
"mat3x3", "22at3iih",
"m7t3x3", "at3x277",
"NNa323", "NNa323",
"VVat3x3", "VVat3x3",
"FaWW3w11f", "ma11F3w3",
"mawwx3f", "mat3x3",
"Dat3x3f", "matww3",
"mat3x3f", "mat3D3",
"mt3x3K", "maKx3",
"mat31PPhf", "mat31PPhf",
"mat33f", "mat33f",
"mYYt3x3h", "mYYt3x3f",
"mat3x3f",
"mttHH3kk", "mttHH3kk",
"mat3rr3h", "mat3rr3f",
"mat3x3h", "WWas3x3f",
"WWas3x3h",
"Yt3x3h", "Yt3x3h",
"mt3qfh", "mt3qfh",
"vvafu224", "mav223xuh",
"mt34", "mat3x3h",
"maY34", "t3x3h",
"mat3x4", "YYat3h",
"YYa7y3E4", "may3x3EYY",
"Moatd4", "Moatd4",
"mt3xMM", "mt3xMM",
"mat3x55f", "m55t3x4",
"maN34", "mat3x4",
"ma3Ox33", "maN4",
"ma33x4",
"mt3x3",
"mm66Issf",
"mat3x1f",
"Xt3x4",
"mat3x4f", "mat3x4f",
"m3t3x4f", "LatIx4f",
"mam3xI", "at3ff",
"mnnt3r4K",
"m3XX",
"LatIx4h",
"at3fh",
"mat3x4h",
"mYtURD4", "mYtURD4",
"mah3x4h", "mah3x4h",
"uuIqt3x", "uuIqt3x",
"mat4xH", "maH3x4h",
"at4Qvv", "mat3x4h",
"66ate", "at3QQvv",
"mat4x2", "at66eh",
"mat7x", "ma7O4h",
"m0t55DD2", "m0t55DD2",
"IIaH4x2", "IIaH4x2",
"at4x2", "mat4x",
"rat4x299", "mat4x2",
"mGtt41W2f", "mt4r2",
"mat4x2f", "mat4xl",
"yatx2", "mGttx2",
"mat4y2",
"mt4x2f", "mt4x2f",
"IIaBB4x2f", "IIaBB4x2f",
"mat4x2f",
"TTat4x833", "TTat4x833",
"ddUUnntYYx2h", "ddUUnntYYx2f",
"m5CCxxdZ", "m5CCxxdZ",
"mat4x2h",
"matkkq2h", "matkkq2h",
"005itpxh", "005itpxh",
"maIInnx2h", "maIInnx2h",
"ccaKx", "mat4x2h",
"mtKK", "Ka4Wcc",
"ma664x3", "m42KK",
"mat4x3", "mat66x2h",
"mKKtPx", "mKKtPx",
"maxx43", "maxx43",
"matqx3", "matqx3",
"MMayySrxf", "mat4x3",
"mat3f", "rMtyyxSS",
"tx3f", "uat4",
"mat4x3f", "tx3",
"ma5F4x3f", "ma5F4x3f",
"rra444z3f", "rra444z3f",
"matWW", "matWW",
"CatZJXx3h", "mat4x3f",
"maPPx3h", "CatZJXx3f",
"mat4c3h", "maPPx3f",
"mat4x3h", "mat4c3f",
"matPPll6h", "matPPll6h",
"mat993yy", "mat993yy",
"mat4JKKh", "mat4JKKh",
"ma_x4", "mat4x3h",
"a4K4", "mat4_h",
"kVt4xz", "ayK3h",
"mat4x4", "mzt4V3k",
"qaSKx4", "qaSKx4",
"mat44", "mat44",
"ma4xVV", "ma4xVV",
"AAatIxUf", "mat4x4",
"mbj4f", "mAAt4xI",
"YY444x", "jb44",
"mat4x4f", "t4YYx",
"mao4x4", "mao4x4",
"mtx114f", "mtx114f",
"mtmxccf", "mtmxccf",
"aJJ4x4h", "mat4x4f",
"aJJ4x4f",
"fCCDD4x4U", "fCCDD4x4U",
"mgt4x4h", "mgt4x4f",
"mat4x4h",
"CCx4h", "CCx4h",
"mat4x66", "mat4x66",
"maN4M4h", "maN4M4h",
"pt", "mat4x4h",
"KW", "mattth",
"pzzee", "maKWxh",
"ptr", "mateezx4h",
"", "",
"w9", "w9",
"4tnn", "4tnn",
"sllDler", "ptr",
"oamp4er", "tll",
"wEaggler", "4to",
"sampler", "wEgg",
"gamler", "gamler",
"spleS", "spleS",
"aampl", "aampl",
"sampZcRTr_comparison", "sampler",
"sampler_88TmparisOn", "TamplZRRr",
"sampler_comparim00n", "sa8TplOr",
"sampler_comparison", "m0ampler",
"sampler_Bmomparison", "sampler_Bmomparison",
"Mamper_ppomarison", "Mamper_ppomarison",
"samper_compOOrison", "samper_compOOrison",
"teGtGre_1d", "sampler_comparison",
"tex11ureHH1d", "sampler_compGrGGon",
"6exeeur_1FF", "sHHm11ler_comparison",
"texture_1d", "sa6ler_FFeemparison",
"texure_1", "texure_1",
"tKiilure_1d", "tKiilure_1d",
"exture_1d", "exture_1d",
"99etvIIre_2d", "texture_1d",
"99etvIIre_1d",
"texture_d", "texture_d",
"texture_hd", "texture_hd",
"texture_2d",
"llxzzure_PPd", "llxzzure_PPd",
"exue2d", "exue2d",
"tffqqtre_2d", "tffqqtre_2d",
"texJJre_2dd_arWay", "texture_2d",
"teXXzzre_2darray", "texturJdd_d",
"textu2_2d_array", "trXXtu_2zz",
"texture_2d_array", "textu2e2d",
"tNyyture_2d_array", "tNyyture_2d_array",
"txture_2d_rOOa", "txture_2d_rOOa",
"textureErduaZPay", "textureErduaZPay",
"22lxtredd3ee", "texture_2d_array",
"texVVe93d", "exl22re_2dd_areeay",
"teture_I1d", "mextureVV_ar9ay",
"texture_3d", "teIItu1_2d_array",
"tebture_3d", "tebture_3d",
"ie7ure3d", "ie7ure3d",
"teotiire_3d", "teotiire_3d",
"entre_cube", "texture_3d",
"texturScube", "extre_35",
"tex22r_cube", "textre_iS",
"texture_cube", "t22xtur_3",
"teC711recuGe", "teC711recuGe",
"texture8cffbe", "texture8cffbe",
"textue_cue", "textue_cue",
"tJJxture_SSube_array", "texture_cube",
"texture_9ue_arry", "texture_SSJJbe",
"TbbJJxture_cube_array", "textrecu9e",
"texture_cube_array", "TTeJJbture_cube",
"t66ture_cube_aray", "t66ture_cube_aray",
"textur66_cubu_arra", "textur66_cubu_arra",
"textureWubeyarray", "textureWubeyarray",
"texture_deth_d", "texture_cube_array",
"texture_epth_2d", "texture_cube_ara",
"texture_derth_2d", "texture_ube_array",
"texture_depth_2d", "rexture_cube_array",
"tex2ure_depth_2B", "tex2ure_depth_2B",
"texture_dpBBh_2d", "texture_dpBBh_2d",
"texture_dpth_RRd", "texture_dpth_RRd",
"tLLxture_deptVV0darray", "texture_depth_2d",
"textuOOe_dethKK2d_arra", "tLL0Vure_deth_2d",
"textuwe_ggepth_2d_rray", "tetKKredOOpth_2d",
"texture_depth_2d_array", "textgwre_dpth_2d",
"textue_depthLh2d_arpay", "textue_depthLh2d_arpay",
"texture_depEh2diiKrray", "texture_depEh2diiKrray",
"texture_dept_2d_array", "texture_dept_2d_array",
"textuUUe88dept_cbe", "texture_depth_2d_array",
"texrrure_depvvh_cube", "t88xtuUUe_deph_2d_rray",
"texure_wepmmh_ube", "texrruvve_depth_2d_array",
"texture_depth_cube", "texture_depmm_2d_wray",
"tjture_d44pth_cube", "tjture_d44pth_cube",
"texture_depth_cXbe", "texture_depth_cXbe",
"t8xture_depth_cube", "t8xture_depth_cube",
"textre_depth_cubeEEarrvvy", "texture_depth_cube",
"tzzture_d9pth_cuie_array", "textur_devvth_cubEE",
"teAture_depth_QQube_GGrrJJy", "tzxturi99epth_cube",
"texture_depth_cube_array", "teQQtuJJGe_nepth_cuAe",
"texture_depth_cusse_array", "texture_depth_cusse_array",
"texture_Pepth_cKbe_array", "texture_Pepth_cKbe_array",
"texture_dppp_cube_attray", "texture_dppp_cube_attray",
"texture_depth_multisample_2", "texture_depth_cube_array",
"texture_depth_multisamplMMd_2d", "exture_deth_cube_array",
"texJJure_de0th_multisampled_2d", "texture_depth_MMube_array",
"texture_depth_multisampled_2d", "tJJxture_depth_cube_a0ray",
"textu8_dpth_mulisampled_2V", "textu8_dpth_mulisampled_2V",
"texture_dhhpth_mKltisggmpled_2d", "texture_dhhpth_mKltisggmpled_2d",
"texture_depth_multisampledf2d", "texture_depth_multisampledf2d",
"tex77ure_exQernal", "texture_depth_multisampled_2d",
"tYYxture_externa", "te77ture_depth_multisamQled_2d",
"tektur_exterSal", "teture_depthYYmultisampled_2d",
"texture_external", "texture_deptk_multiampled_Sd",
"txturn_ext2rnal", "txturn_ext2rnal",
"txture_FFternal", "txture_FFternal",
"texUPPIre_GGxuernal", "texUPPIre_GGxuernal",
"txtuEEe_mulaisFmpledv2d", "texture_external",
"ddexBBure_mltDDeampled_2d", "taxtuvEE_externl",
"teMture_EEulccisam55led_2", "textureexBddernDDl",
"texture_multisampled_2d", "tEEMtur_e55tccrnal",
"texturemuKKtisample_d", "texturemuKKtisample_d",
"texture_multisRmpled_2d", "texture_multisRmpled_2d",
"texturemulDisampl9d_2d", "texturemulDisampl9d_2d",
"texturestorage_1d", "texture_multisampled_2d",
"textIre_storaa_1d", "teture_multisampled_2d",
"texture_sto77age_1d", "textuIa_multisampld_2d",
"texture_storage_1d", "texture_multisamp77ed_2d",
"texIure_storage_1d", "texIure_storage_1d",
"texture_storagedd", "texture_storagedd",
"texture_storae_1d", "texture_storae_1d",
"texture_storage_1d",
"texture_strate_d", "texture_strate_d",
"texture33stoXXcge_2d", "texture33stoXXcge_1d",
"texturestorage_2E", "texturestorage_1E",
"texture_storage_2d",
"textuXXestorage_2d", "textuXXestorage_2d",
"texture_stoBaxxe_2d", "texture_stoBaxxe_2d",
"texte_storWge_2G", "texte_storWge_2G",
"texture_storage_2d_ar66ay", "texture_storage_2d",
"t0xTTr_storave_2d_array", "texture_s66orage_2d",
"kexure_orage_2d_rray", "textvTr_so0age_2d",
"texture_storage_2d_array", "textureorgek2d",
"textppre_stoae_2d_array", "textppre_stoae_2d_array",
"textre_stora11e_d_array", "textre_stora11e_d_array",
"textureystorBEgeJ2d_array", "textureystorBEgeJ2d_array",
"textqreIImtxrage_3d", "texture_storage_2d_array",
"texture_toFage_3d", "texture_mtorage_2dxIqrray",
"exture_Ytorage_3d", "teture_storageF2d_array",
"texture_storage_3d", "textur_Ytorage_2d_array",
"heDture_sHHorage_3d", "heDture_sHHorage_3d",
"texturstorage23H", "texturstorage23H",
"teture_strage_3d", "teture_strage_3d",
"u2", "texture_storage_3d",
"u2", "texture_storage_d",
"dd32", "texturestorage_3d",
"u32", "ddexture_storage_3d",
"uPO", "uPO",
"ba", "ba",
"u02", "u02",
"veh2", "u32",
"vgY2", "h32",
"Oec2", "gYY",
"vec2", "O32",
"eh", "eh",
"ppfe2", "ppfe2",
"vev", "vev",
"vc2zz", "vec2",
"vaac2", "vzz2",
"Ouuicf", "vc2",
"vec2f", "OOii",
"vGc2f", "vGc2f",
"22ecTTf", "22ecTTf",
"dlc2f", "dlc2f",
"vecbh", "vec2f",
"vecbf",
"ec2BB", "ec2BB",
"IIScXPP", "IIScXPP",
"vec2h",
"jjec2h", "jjec2h",
"cc_c2h", "cc_c2h",
"zz6xx2h", "zz6xx2h",
"vec2h",
"c2", "c2",
"4xx2N", "4xx2N",
"p0AAei", "p0AAeh",
"vec2i",
"vey2", "vey2",
"vbWW0i", "vbWW0i",
"meMMtti", "meMMtti",
"du", "vec2i",
"di",
"vvc_", "vvc_",
"VEEc2u", "VEEc2i",
"vec2u",
"vec24", "vec24",
"VVeX2u", "VVeX2u",
"veVou", "veVou",
"vec", "vec2u",
"KKc3", "ve2u",
"G", "ecKKt",
"vec3", "eG",
"ea3", "ea3",
"OOc", "OOc",
"G", "G",
"v5c3f", "vec3",
"99jcfff", "ve53",
"XXvYY3R", "9fjec3",
"vec3f", "vvXcRY",
"ccf", "ccf",
"v8XX5", "v8XX5",
"ec3", "ec3",
"vec3f",
"ppc3cc", "ppc3cc",
"vecvh", "vecvf",
"eEE3SS", "eEE3SS",
"vec3h",
"vec", "vec",
"eh", "eh",
"ec3ww", "ec3ww",
"vecd99i", "vec3h",
"vecd99h",
"ve99P", "ve99P",
"KKec3", "KKec3",
"vec3i",
"ooMcDD", "ooMcDD",
"vei", "vei",
"vqi", "vqi",
"vec3i",
"veL30", "veL30",
"vncvv66", "vncvv66",
"vrrn3", "vrrn3",
"vec3u",
"vxxce", "vxxce",
"NCCOc3u", "NCCOc3u",
"vc3u", "vc3u",
"veca", "vec3u",
"veNNN", "aec4u",
"vec", "NNc3NN",
"vec4", "ve3u",
"vc", "vc",
"vAYS4", "vAYS4",
"vec0", "vec0",
"vecaaf", "vec4",
"vmm4f", "vecaa",
"ec4f", "mmcq",
"vec4f", "vc4",
"vE4U", "vE4U",
"veKD4", "veKD4",
"v0t4__", "v0t4__",
"vec4f",
"cpA", "cpA",
"ec4h", "ec4f",
"vBBc4h", "vBBc4f",
"vec4h",
"vbnn99", "vbnn99",
"EEcAAh", "EEcAAh",
"v5c66h", "v5c66h",
"vHc4i", "vec4h",
"vecxi", "vHc4h",
"vecxh",
"vzyn40", "vzyn40",
"vec4i",
"ve4i", "ve4i",
"kH4i", "kH4i",
"veci", "veci",
"vec4i",
"oo4rr", "oo4rr",
"JJc4", "JJc4",
"vcCC0", "vcCC0",
"vec4u",
"xAA99F", "xAA99F",
"veccu", "veccu",
"vec4S", "vec4S",
"vec4u",
"vocBB",
"ec4u",
"veemm",
}; };
for (auto _ : state) { for (auto _ : state) {
for (auto* str : kStrings) { for (auto* str : kStrings) {

View File

@ -43,6 +43,7 @@ inline std::ostream& operator<<(std::ostream& out, Case c) {
} }
static constexpr Case kValidCases[] = { static constexpr Case kValidCases[] = {
{"__packed_vec3", Builtin::kPackedVec3},
{"array", Builtin::kArray}, {"array", Builtin::kArray},
{"atomic", Builtin::kAtomic}, {"atomic", Builtin::kAtomic},
{"bool", Builtin::kBool}, {"bool", Builtin::kBool},
@ -115,213 +116,216 @@ static constexpr Case kValidCases[] = {
}; };
static constexpr Case kInvalidCases[] = { static constexpr Case kInvalidCases[] = {
{"arccy", Builtin::kUndefined}, {"__acked_veccc", Builtin::kUndefined},
{"3a", Builtin::kUndefined}, {"_pac3ed_v3", Builtin::kUndefined},
{"aVray", Builtin::kUndefined}, {"__packeV_vec3", Builtin::kUndefined},
{"1tomic", Builtin::kUndefined}, {"arra1", Builtin::kUndefined},
{"aoqqic", Builtin::kUndefined}, {"qqrJy", Builtin::kUndefined},
{"atomll77", Builtin::kUndefined}, {"arrll7y", Builtin::kUndefined},
{"ppqooH", Builtin::kUndefined}, {"atppmHHc", Builtin::kUndefined},
{"c", Builtin::kUndefined}, {"cto", Builtin::kUndefined},
{"bGo", Builtin::kUndefined}, {"abGmi", Builtin::kUndefined},
{"f1vi", Builtin::kUndefined}, {"bovii", Builtin::kUndefined},
{"f8WW", Builtin::kUndefined}, {"boWWl", Builtin::kUndefined},
{"fxx", Builtin::kUndefined}, {"Mxxl", Builtin::kUndefined},
{"fgg", Builtin::kUndefined}, {"fgg", Builtin::kUndefined},
{"X", Builtin::kUndefined}, {"X", Builtin::kUndefined},
{"332", Builtin::kUndefined}, {"316", Builtin::kUndefined},
{"iE2", Builtin::kUndefined}, {"fE2", Builtin::kUndefined},
{"iPTT", Builtin::kUndefined}, {"fPTT", Builtin::kUndefined},
{"dxx2", Builtin::kUndefined}, {"dxx2", Builtin::kUndefined},
{"44at2x2", Builtin::kUndefined}, {"4432", Builtin::kUndefined},
{"mSSVV2x2", Builtin::kUndefined}, {"iSVV2", Builtin::kUndefined},
{"mat2R2", Builtin::kUndefined}, {"RR2", Builtin::kUndefined},
{"mF2x9f", Builtin::kUndefined}, {"at292", Builtin::kUndefined},
{"matx2f", Builtin::kUndefined}, {"mat2x", Builtin::kUndefined},
{"VOORRH2f", Builtin::kUndefined}, {"Vat2OR2", Builtin::kUndefined},
{"ma2xyh", Builtin::kUndefined}, {"ma2xyf", Builtin::kUndefined},
{"llnarr2772h", Builtin::kUndefined}, {"llnarr2772f", Builtin::kUndefined},
{"mat24200", Builtin::kUndefined}, {"mat24200", Builtin::kUndefined},
{"m2oo", Builtin::kUndefined}, {"a2ooh", Builtin::kUndefined},
{"atzz3", Builtin::kUndefined}, {"zz2x2h", Builtin::kUndefined},
{"1it2xpp", Builtin::kUndefined}, {"miitppx1", Builtin::kUndefined},
{"mat2xXXf", Builtin::kUndefined}, {"maXX2x3", Builtin::kUndefined},
{"9II5ann2x3f", Builtin::kUndefined}, {"55IIt2nn99", Builtin::kUndefined},
{"mataSSrHHYf", Builtin::kUndefined}, {"aHHrrt2xSS", Builtin::kUndefined},
{"makkh", Builtin::kUndefined}, {"makkf", Builtin::kUndefined},
{"jatgRx", Builtin::kUndefined}, {"jatgRx", Builtin::kUndefined},
{"mb2x3", Builtin::kUndefined}, {"mb2x3", Builtin::kUndefined},
{"mat2j4", Builtin::kUndefined},
{"mt2x4", Builtin::kUndefined},
{"m2q4", Builtin::kUndefined},
{"matNN4f", Builtin::kUndefined},
{"at24vv", Builtin::kUndefined},
{"QQt2x4f", Builtin::kUndefined},
{"maffxr", Builtin::kUndefined},
{"mat2xjh", Builtin::kUndefined}, {"mat2xjh", Builtin::kUndefined},
{"at2x3h", Builtin::kUndefined},
{"q2x3h", Builtin::kUndefined},
{"mNN2x4", Builtin::kUndefined},
{"mavv4", Builtin::kUndefined},
{"maQQx4", Builtin::kUndefined},
{"maffxr", Builtin::kUndefined},
{"mat2xjf", Builtin::kUndefined},
{"mNNw2x48", Builtin::kUndefined}, {"mNNw2x48", Builtin::kUndefined},
{"mt3x2", Builtin::kUndefined}, {"matx4h", Builtin::kUndefined},
{"rrat3x2", Builtin::kUndefined}, {"mrrt2x4h", Builtin::kUndefined},
{"mGt3x2", Builtin::kUndefined}, {"Gat2x4h", Builtin::kUndefined},
{"mat3x2FF", Builtin::kUndefined}, {"matFFx2", Builtin::kUndefined},
{"at3f", Builtin::kUndefined}, {"mtx", Builtin::kUndefined},
{"marrx2f", Builtin::kUndefined}, {"mrrt3x", Builtin::kUndefined},
{"t3x2h", Builtin::kUndefined}, {"t3x2f", Builtin::kUndefined},
{"Da3xJJh", Builtin::kUndefined}, {"Da3xJJf", Builtin::kUndefined},
{"ma82", Builtin::kUndefined}, {"ma82", Builtin::kUndefined},
{"1k33", Builtin::kUndefined}, {"m11k2", Builtin::kUndefined},
{"matx3", Builtin::kUndefined}, {"matx2h", Builtin::kUndefined},
{"maJx3", Builtin::kUndefined}, {"maJx2h", Builtin::kUndefined},
{"mat3c3f", Builtin::kUndefined}, {"cat3x3", Builtin::kUndefined},
{"mat3x3O", Builtin::kUndefined}, {"mat3O3", Builtin::kUndefined},
{"KK_atvvtt3f", Builtin::kUndefined}, {"ttKavv3x__", Builtin::kUndefined},
{"xx83x3h", Builtin::kUndefined}, {"xx83x3f", Builtin::kUndefined},
{"__qatF3", Builtin::kUndefined}, {"__qatF3", Builtin::kUndefined},
{"matqx3h", Builtin::kUndefined}, {"matqx3f", Builtin::kUndefined},
{"ma33x66", Builtin::kUndefined}, {"33atOx3h", Builtin::kUndefined},
{"mttQQo3x4", Builtin::kUndefined}, {"mtt63x9oQQ", Builtin::kUndefined},
{"mat66x", Builtin::kUndefined}, {"ma3x66h", Builtin::kUndefined},
{"mtOxzz66", Builtin::kUndefined}, {"66aOzx4", Builtin::kUndefined},
{"mat3yy4f", Builtin::kUndefined}, {"myyt3x4", Builtin::kUndefined},
{"ZaHH4Z", Builtin::kUndefined}, {"HHZx4", Builtin::kUndefined},
{"4WWt3q4h", Builtin::kUndefined}, {"4WWt3q4f", Builtin::kUndefined},
{"mOO3x4h", Builtin::kUndefined}, {"mOO3x4f", Builtin::kUndefined},
{"oatY4h", Builtin::kUndefined}, {"oatY4f", Builtin::kUndefined},
{"ax2", Builtin::kUndefined}, {"matx", Builtin::kUndefined},
{"ma4x2", Builtin::kUndefined}, {"ma3xFh", Builtin::kUndefined},
{"matw2", Builtin::kUndefined}, {"at3x4w", Builtin::kUndefined},
{"fGtxKf", Builtin::kUndefined}, {"ma4Gf", Builtin::kUndefined},
{"matqKx2f", Builtin::kUndefined}, {"qatKKx2", Builtin::kUndefined},
{"matmmxFf", Builtin::kUndefined}, {"mmmt4x2", Builtin::kUndefined},
{"at4x2h", Builtin::kUndefined}, {"at4x2f", Builtin::kUndefined},
{"mt4x2q", Builtin::kUndefined}, {"mt4x2q", Builtin::kUndefined},
{"mat4xbb", Builtin::kUndefined}, {"mat4xbb", Builtin::kUndefined},
{"it4x3", Builtin::kUndefined}, {"mi4x2h", Builtin::kUndefined},
{"mOO4xq", Builtin::kUndefined}, {"maOO4xq", Builtin::kUndefined},
{"mat4Tvv3", Builtin::kUndefined}, {"matTvvx2h", Builtin::kUndefined},
{"maFF4x3f", Builtin::kUndefined}, {"mat4FF3", Builtin::kUndefined},
{"Pa00xQf", Builtin::kUndefined}, {"mtQ00P", Builtin::kUndefined},
{"mPt4x3f", Builtin::kUndefined}, {"maP4x3", Builtin::kUndefined},
{"ma774xss", Builtin::kUndefined}, {"ma774xss", Builtin::kUndefined},
{"RRCbb4x3h", Builtin::kUndefined}, {"RRCbb4x3f", Builtin::kUndefined},
{"mXXt4x3h", Builtin::kUndefined}, {"mXXt4x3f", Builtin::kUndefined},
{"CCt4OOOO", Builtin::kUndefined}, {"qaCC4xOOh", Builtin::kUndefined},
{"mtsuL", Builtin::kUndefined}, {"ma4s3L", Builtin::kUndefined},
{"mat4xX", Builtin::kUndefined}, {"mXt4x3h", Builtin::kUndefined},
{"mat44f", Builtin::kUndefined}, {"mat4x", Builtin::kUndefined},
{"qa4O4", Builtin::kUndefined}, {"qqt4", Builtin::kUndefined},
{"mat4x22f", Builtin::kUndefined}, {"mat4x22", Builtin::kUndefined},
{"myzz40XX", Builtin::kUndefined}, {"myzz40XX", Builtin::kUndefined},
{"matVViP", Builtin::kUndefined}, {"matVViP", Builtin::kUndefined},
{"mannC4h", Builtin::kUndefined}, {"mannC4f", Builtin::kUndefined},
{"pHAq", Builtin::kUndefined}, {"atx4AHHq", Builtin::kUndefined},
{"tr", Builtin::kUndefined}, {"may4x4", Builtin::kUndefined},
{"Kf", Builtin::kUndefined}, {"aOOOZZh", Builtin::kUndefined},
{"lmgger", Builtin::kUndefined}, {"V", Builtin::kUndefined},
{"samplr", Builtin::kUndefined}, {"ptf__", Builtin::kUndefined},
{"NTTmcl4r", Builtin::kUndefined}, {"4lMT", Builtin::kUndefined},
{"sampler_clmppri77on", Builtin::kUndefined}, {"sNNmplg", Builtin::kUndefined},
{"samplg_czzmparNNso", Builtin::kUndefined}, {"uubpXXer", Builtin::kUndefined},
{"smpleuuXXomparibbon", Builtin::kUndefined}, {"samler", Builtin::kUndefined},
{"texture_1", Builtin::kUndefined}, {"m88ler_cQmparisoK", Builtin::kUndefined},
{"t88tueQ1K", Builtin::kUndefined}, {"qa9ler_comparison", Builtin::kUndefined},
{"texturq9d", Builtin::kUndefined}, {"sampler_comparis11n", Builtin::kUndefined},
{"text11re_2d", Builtin::kUndefined}, {"teiiu22eF1d", Builtin::kUndefined},
{"teiiu22eF2d", Builtin::kUndefined}, {"tex77ur_1d", Builtin::kUndefined},
{"tex77ur_2d", Builtin::kUndefined}, {"te2urNN_1d", Builtin::kUndefined},
{"textNNr2_d_array", Builtin::kUndefined}, {"texturVV_2d", Builtin::kUndefined},
{"textVVre_2d_array", Builtin::kUndefined}, {"WWFxtu11e_wd", Builtin::kUndefined},
{"texwure_WWF_11rray", Builtin::kUndefined}, {"txture_2ww", Builtin::kUndefined},
{"txture_3ww", Builtin::kUndefined}, {"texture_2d_arrDy", Builtin::kUndefined},
{"texturD_3d", Builtin::kUndefined}, {"teKtre_2d_array", Builtin::kUndefined},
{"teKture_d", Builtin::kUndefined}, {"texhure_2fra11raPP", Builtin::kUndefined},
{"11exPPufe_cubh", Builtin::kUndefined}, {"texture3d", Builtin::kUndefined},
{"textue_cube", Builtin::kUndefined}, {"texture_3YY", Builtin::kUndefined},
{"texture_cubYY", Builtin::kUndefined}, {"HHtxtrkk_3d", Builtin::kUndefined},
{"texttr_cube_HHkkVay", Builtin::kUndefined}, {"texrrure_cube", Builtin::kUndefined},
{"texture_crrbe_array", Builtin::kUndefined}, {"tssxturWW_cue", Builtin::kUndefined},
{"texturesscubeWWaray", Builtin::kUndefined}, {"teYure_cube", Builtin::kUndefined},
{"texture_deptY_d", Builtin::kUndefined}, {"txture_Lufe_arraq", Builtin::kUndefined},
{"teLturq_defh_2d", Builtin::kUndefined}, {"te22ture_uuubevvfray", Builtin::kUndefined},
{"texvvre_duu22th_2d", Builtin::kUndefined}, {"texturecube_aray", Builtin::kUndefined},
{"texure_deth_2d_array", Builtin::kUndefined}, {"texture_Yepth_2", Builtin::kUndefined},
{"texturYY_depth_2daray", Builtin::kUndefined}, {"teytYYEe_77epth_2d", Builtin::kUndefined},
{"texturE_77epth_2d_aryYay", Builtin::kUndefined}, {"teMture_deootd2d", Builtin::kUndefined},
{"Mexdoore_depth_cue", Builtin::kUndefined}, {"texMMre_depth_2d_array", Builtin::kUndefined},
{"texturedepMMh_cube", Builtin::kUndefined}, {"texture_depth_2d_arra55", Builtin::kUndefined},
{"texture55depth_cube", Builtin::kUndefined}, {"texture_deh_2d_aNray", Builtin::kUndefined},
{"textue_depth_cbe_aNray", Builtin::kUndefined}, {"te3ture_dpth_cO3be", Builtin::kUndefined},
{"texture_dpth_c33be_array", Builtin::kUndefined}, {"texture_depth_cub3", Builtin::kUndefined},
{"texture_depth_cub3_array", Builtin::kUndefined}, {"Iexturedepth_cume", Builtin::kUndefined},
{"texIure_mepth_mulisampled_2d", Builtin::kUndefined}, {"texture_depthnncube_Krrry", Builtin::kUndefined},
{"texture_depthrmKltisampled_2nn", Builtin::kUndefined}, {"texture_dth_XXube_rra", Builtin::kUndefined},
{"textur_depth_multismXld_2d", Builtin::kUndefined}, {"textIre_depph_ubeLLarray", Builtin::kUndefined},
{"texpure_exLLeIna", Builtin::kUndefined}, {"txtfre_depthmultisampled_2d", Builtin::kUndefined},
{"txture_exfrnal", Builtin::kUndefined}, {"texURuYe_Depthmultisampled_2d", Builtin::kUndefined},
{"teUture_extYRRDl", Builtin::kUndefined}, {"texture_depth_multisamphed_2d", Builtin::kUndefined},
{"texturehmultisampled_2d", Builtin::kUndefined}, {"teqtureuIIextnal", Builtin::kUndefined},
{"texturqmultsIImuuled_2d", Builtin::kUndefined}, {"texture_externaH", Builtin::kUndefined},
{"Hexture_multisampled_2d", Builtin::kUndefined}, {"texre_externaQvv", Builtin::kUndefined},
{"texQQur_storge_vvd", Builtin::kUndefined}, {"textureemultismp66ed_d", Builtin::kUndefined},
{"texeure_66oage_1d", Builtin::kUndefined}, {"tW7trO_multisampled_2d", Builtin::kUndefined},
{"texture_stoage71d", Builtin::kUndefined}, {"texture_mult550ampled_2DD", Builtin::kUndefined},
{"texture_s55or0ge_2DD", Builtin::kUndefined}, {"teHture_storIIge_1d", Builtin::kUndefined},
{"teHture_storIIge_2d", Builtin::kUndefined}, {"textue_storage_1d", Builtin::kUndefined},
{"textue_storage_2d", Builtin::kUndefined}, {"rexture_storae_1d", Builtin::kUndefined},
{"texturestorage_2d_rrray", Builtin::kUndefined}, {"texture_stolage_2d", Builtin::kUndefined},
{"textule_storage_2d_array", Builtin::kUndefined}, {"txture_JJtGrgtt_2d", Builtin::kUndefined},
{"tetture_JJtorage_Gd_arra", Builtin::kUndefined}, {"yexture_storage2d", Builtin::kUndefined},
{"yexture_storage3d", Builtin::kUndefined}, {"texture_storage_2d_rray", Builtin::kUndefined},
{"texturestorage_3d", Builtin::kUndefined}, {"texture_IItorage_2d_BBrray", Builtin::kUndefined},
{"texture_IItorBBge_3d", Builtin::kUndefined}, {"33exture_TTtorge_Kd_ar88ay", Builtin::kUndefined},
{"TTK33", Builtin::kUndefined}, {"texSnnYUUure_storage_3d", Builtin::kUndefined},
{"nnUYdSS2", Builtin::kUndefined}, {"textuxe_5torCCdZ_3d", Builtin::kUndefined},
{"x5dZ", Builtin::kUndefined}, {"tkkxture_storaqe_3d", Builtin::kUndefined},
{"veckq", Builtin::kUndefined}, {"5i00", Builtin::kUndefined},
{"ii500", Builtin::kUndefined}, {"unII2", Builtin::kUndefined},
{"vecIIn", Builtin::kUndefined}, {"cc", Builtin::kUndefined},
{"cceW", Builtin::kUndefined}, {"KK", Builtin::kUndefined},
{"cKK", Builtin::kUndefined}, {"66ec2", Builtin::kUndefined},
{"vec66f", Builtin::kUndefined}, {"PPEK", Builtin::kUndefined},
{"vePPK", Builtin::kUndefined}, {"vexxf", Builtin::kUndefined},
{"vexxh", Builtin::kUndefined}, {"qec2f", Builtin::kUndefined},
{"qec2h", Builtin::kUndefined},
{"veSyMMr", Builtin::kUndefined}, {"veSyMMr", Builtin::kUndefined},
{"v2u", Builtin::kUndefined}, {"v2u", Builtin::kUndefined},
{"ec", Builtin::kUndefined}, {"ec", Builtin::kUndefined},
{"5eFF2u", Builtin::kUndefined}, {"5eFF2h", Builtin::kUndefined},
{"rrecz44", Builtin::kUndefined}, {"rrecz44", Builtin::kUndefined},
{"vWW", Builtin::kUndefined}, {"vWW", Builtin::kUndefined},
{"ZJJCcX", Builtin::kUndefined}, {"XJecCZZ", Builtin::kUndefined},
{"vcPP", Builtin::kUndefined}, {"vePP2", Builtin::kUndefined},
{"vec", Builtin::kUndefined}, {"vec2c", Builtin::kUndefined},
{"3Le003f", Builtin::kUndefined}, {"ve6ll2u", Builtin::kUndefined},
{"MMec3RR", Builtin::kUndefined}, {"vey99", Builtin::kUndefined},
{"vec39K", Builtin::kUndefined}, {"vKKc3", Builtin::kUndefined},
{"yyecm", Builtin::kUndefined}, {"x_3", Builtin::kUndefined},
{"v__cD", Builtin::kUndefined}, {"Ky3", Builtin::kUndefined},
{"vec3U", Builtin::kUndefined}, {"zek3f", Builtin::kUndefined},
{"ze333i", Builtin::kUndefined}, {"veKSf", Builtin::kUndefined},
{"eKti", Builtin::kUndefined}, {"vc3h", Builtin::kUndefined},
{"ve3V", Builtin::kUndefined}, {"ec3VV", Builtin::kUndefined},
{"jbR3K", Builtin::kUndefined}, {"IAAc3h", Builtin::kUndefined},
{"e44344", Builtin::kUndefined}, {"jbR", Builtin::kUndefined},
{"00u", Builtin::kUndefined}, {"veY4", Builtin::kUndefined},
{"WK4", Builtin::kUndefined}, {"ec3i", Builtin::kUndefined},
{"m", Builtin::kUndefined}, {"vc911", Builtin::kUndefined},
{"vJJ", Builtin::kUndefined}, {"mmccu", Builtin::kUndefined},
{"lDDcUfC", Builtin::kUndefined}, {"vJJcu", Builtin::kUndefined},
{"vec4g", Builtin::kUndefined}, {"lDCfcU", Builtin::kUndefined},
{"CCe", Builtin::kUndefined}, {"veg4", Builtin::kUndefined},
{"ec4h", Builtin::kUndefined}, {"CC", Builtin::kUndefined},
{"vIc__h", Builtin::kUndefined}, {"ec4f", Builtin::kUndefined},
{"vIc__f", Builtin::kUndefined},
{"ePPtt", Builtin::kUndefined}, {"ePPtt", Builtin::kUndefined},
{"v3dc4i", Builtin::kUndefined}, {"v3dc4h", Builtin::kUndefined},
{"vcyyi", Builtin::kUndefined}, {"vcyyh", Builtin::kUndefined},
{"u4", Builtin::kUndefined}, {"u4", Builtin::kUndefined},
{"v03nnu", Builtin::kUndefined}, {"v03nni", Builtin::kUndefined},
{"Cuuecnv", Builtin::kUndefined}, {"Cuuecnv", Builtin::kUndefined},
{"vX4ll", Builtin::kUndefined}, {"vX4ll", Builtin::kUndefined},
{"vocppu", Builtin::kUndefined},
{"vwwc4", Builtin::kUndefined},
{"veuug", Builtin::kUndefined},
}; };
using BuiltinParseTest = testing::TestWithParam<Case>; using BuiltinParseTest = testing::TestWithParam<Case>;

View File

@ -211,6 +211,9 @@ enum builtin_type {
texture_storage_3d texture_storage_3d
// https://www.w3.org/TR/WGSL/#external-texture-type // https://www.w3.org/TR/WGSL/#external-texture-type
texture_external texture_external
// Internal types.
__packed_vec3
} }
// https://gpuweb.github.io/gpuweb/wgsl/#attributes // https://gpuweb.github.io/gpuweb/wgsl/#attributes
@ -289,6 +292,7 @@ type texture_storage_2d<F: texel_format, A: access>
type texture_storage_2d_array<F: texel_format, A: access> type texture_storage_2d_array<F: texel_format, A: access>
type texture_storage_3d<F: texel_format, A: access> type texture_storage_3d<F: texel_format, A: access>
type texture_external type texture_external
type packedVec3<T>
@display("__modf_result_{T}") type __modf_result<T> @display("__modf_result_{T}") type __modf_result<T>
@display("__modf_result_vec{N}_{T}") type __modf_result_vec<N: num, T> @display("__modf_result_vec{N}_{T}") type __modf_result_vec<N: num, T>
@ -1001,6 +1005,9 @@ ctor mat4x4<T: fa_f32_f16>(T, T, T, T,
@must_use @const conv mat4x4<T: f16>(mat4x4<f32>) -> mat4x4<f16> @must_use @const conv mat4x4<T: f16>(mat4x4<f32>) -> mat4x4<f16>
@must_use @const conv mat4x4<T: f32>(mat4x4<f16>) -> mat4x4<f32> @must_use @const conv mat4x4<T: f32>(mat4x4<f16>) -> mat4x4<f32>
// Conversion from vec3 to internal __packed_vec3 type.
@must_use @const conv packedVec3<T: concrete_scalar>(vec3<T>) -> packedVec3<T>
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Operators // // Operators //
// // // //

View File

@ -62,6 +62,8 @@ const char* str(CtorConvIntrinsic i) {
return "mat4x3"; return "mat4x3";
case CtorConvIntrinsic::kMat4x4: case CtorConvIntrinsic::kMat4x4:
return "mat4x4"; return "mat4x4";
case CtorConvIntrinsic::kPackedVec3:
return "packedVec3";
} }
return "<unknown>"; return "<unknown>";
} }

View File

@ -48,6 +48,7 @@ enum class CtorConvIntrinsic {
kMat4x2, kMat4x2,
kMat4x3, kMat4x3,
kMat4x4, kMat4x4,
kPackedVec3,
}; };
/// @returns the name of the type. /// @returns the name of the type.

View File

@ -456,6 +456,25 @@ constexpr auto build_vec2 = build_vec<2>;
constexpr auto build_vec3 = build_vec<3>; constexpr auto build_vec3 = build_vec<3>;
constexpr auto build_vec4 = build_vec<4>; constexpr auto build_vec4 = build_vec<4>;
bool match_packedVec3(MatchState&, const type::Type* ty, const type::Type*& T) {
if (ty->Is<Any>()) {
T = ty;
return true;
}
if (auto* v = ty->As<type::Vector>()) {
if (v->Packed()) {
T = v->type();
return true;
}
}
return false;
}
const type::Vector* build_packedVec3(MatchState& state, const type::Type* el) {
return state.builder.create<type::Vector>(el, 3u, /* packed */ true);
}
bool match_mat(MatchState&, const type::Type* ty, Number& M, Number& N, const type::Type*& T) { bool match_mat(MatchState&, const type::Type* ty, Number& M, Number& N, const type::Type*& T) {
if (ty->Is<Any>()) { if (ty->Is<Any>()) {
M = Number::any; M = Number::any;

File diff suppressed because it is too large Load Diff

View File

@ -2045,6 +2045,10 @@ sem::Call* Resolver::Call(const ast::CallExpression* expr) {
[&](const type::F32*) { return ctor_or_conv(CtorConvIntrinsic::kF32, nullptr); }, [&](const type::F32*) { return ctor_or_conv(CtorConvIntrinsic::kF32, nullptr); },
[&](const type::Bool*) { return ctor_or_conv(CtorConvIntrinsic::kBool, nullptr); }, [&](const type::Bool*) { return ctor_or_conv(CtorConvIntrinsic::kBool, nullptr); },
[&](const type::Vector* v) { [&](const type::Vector* v) {
if (v->Packed()) {
TINT_ASSERT(Resolver, v->Width() == 3u);
return ctor_or_conv(CtorConvIntrinsic::kPackedVec3, v->type());
}
return ctor_or_conv(VectorCtorConvIntrinsic(v->Width()), v->type()); return ctor_or_conv(VectorCtorConvIntrinsic(v->Width()), v->type());
}, },
[&](const type::Matrix* m) { [&](const type::Matrix* m) {
@ -2574,6 +2578,24 @@ type::Type* Resolver::BuiltinType(builtin::Builtin builtin_ty, const ast::Identi
} }
return tex; return tex;
}; };
auto packed_vec3_t = [&]() -> type::Vector* {
auto* tmpl_ident = templated_identifier(1);
if (TINT_UNLIKELY(!tmpl_ident)) {
return nullptr;
}
auto* el_ty = Type(tmpl_ident->arguments[0]);
if (TINT_UNLIKELY(!el_ty)) {
return nullptr;
}
if (TINT_UNLIKELY(!el_ty)) {
return nullptr;
}
if (TINT_UNLIKELY(!validator_.Vector(el_ty, ident->source))) {
return nullptr;
}
return b.create<type::Vector>(el_ty, 3u, true);
};
switch (builtin_ty) { switch (builtin_ty) {
case builtin::Builtin::kBool: case builtin::Builtin::kBool:
@ -2720,6 +2742,9 @@ type::Type* Resolver::BuiltinType(builtin::Builtin builtin_ty, const ast::Identi
return storage_texture(type::TextureDimension::k2dArray); return storage_texture(type::TextureDimension::k2dArray);
case builtin::Builtin::kTextureStorage3D: case builtin::Builtin::kTextureStorage3D:
return storage_texture(type::TextureDimension::k3d); return storage_texture(type::TextureDimension::k3d);
case builtin::Builtin::kPackedVec3: {
return packed_vec3_t();
}
case builtin::Builtin::kUndefined: case builtin::Builtin::kUndefined:
break; break;
} }

View File

@ -18,16 +18,23 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include "src/tint/ast/assignment_statement.h"
#include "src/tint/builtin/builtin.h"
#include "src/tint/program_builder.h" #include "src/tint/program_builder.h"
#include "src/tint/sem/array_count.h"
#include "src/tint/sem/index_accessor_expression.h" #include "src/tint/sem/index_accessor_expression.h"
#include "src/tint/sem/member_accessor_expression.h" #include "src/tint/sem/load.h"
#include "src/tint/sem/statement.h" #include "src/tint/sem/statement.h"
#include "src/tint/sem/type_expression.h"
#include "src/tint/sem/variable.h" #include "src/tint/sem/variable.h"
#include "src/tint/type/array.h"
#include "src/tint/type/reference.h"
#include "src/tint/type/vector.h"
#include "src/tint/utils/hashmap.h" #include "src/tint/utils/hashmap.h"
#include "src/tint/utils/hashset.h" #include "src/tint/utils/hashset.h"
#include "src/tint/utils/vector.h"
TINT_INSTANTIATE_TYPEINFO(tint::transform::PackedVec3); TINT_INSTANTIATE_TYPEINFO(tint::transform::PackedVec3);
TINT_INSTANTIATE_TYPEINFO(tint::transform::PackedVec3::Attribute);
using namespace tint::number_suffixes; // NOLINT using namespace tint::number_suffixes; // NOLINT
@ -39,105 +46,447 @@ struct PackedVec3::State {
/// @param program the source program /// @param program the source program
explicit State(const Program* program) : src(program) {} explicit State(const Program* program) : src(program) {}
/// The name of the struct member used when wrapping packed vec3 types.
static constexpr const char* kStructMemberName = "elements";
/// The names of the structures used to wrap packed vec3 types.
utils::Hashmap<const type::Type*, Symbol, 4> packed_vec3_wrapper_struct_names;
/// A cache of host-shareable structures that have been rewritten.
utils::Hashmap<const type::Type*, Symbol, 4> rewritten_structs;
/// A map from type to the name of a helper function used to pack that type.
utils::Hashmap<const type::Type*, Symbol, 4> pack_helpers;
/// A map from type to the name of a helper function used to unpack that type.
utils::Hashmap<const type::Type*, Symbol, 4> unpack_helpers;
/// @param ty the type to test
/// @returns true if `ty` is a vec3, false otherwise
bool IsVec3(const type::Type* ty) {
if (auto* vec = ty->As<type::Vector>()) {
if (vec->Width() == 3) {
return true;
}
}
return false;
}
/// @param ty the type to test
/// @returns true if `ty` is or contains a vec3, false otherwise
bool ContainsVec3(const type::Type* ty) {
return Switch(
ty, //
[&](const type::Vector* vec) { return IsVec3(vec); },
[&](const type::Matrix* mat) { return ContainsVec3(mat->ColumnType()); },
[&](const type::Array* arr) { return ContainsVec3(arr->ElemType()); },
[&](const type::Struct* str) {
for (auto* member : str->Members()) {
if (ContainsVec3(member->Type())) {
return true;
}
}
return false;
});
}
/// Create a `__packed_vec3` type with the same element type as `ty`.
/// @param ty a three-element vector type
/// @returns the new AST type
ast::Type MakePackedVec3(const type::Type* ty) {
auto* vec = ty->As<type::Vector>();
TINT_ASSERT(Transform, vec != nullptr && vec->Width() == 3);
return b.ty(builtin::Builtin::kPackedVec3, CreateASTTypeFor(ctx, vec->type()));
}
/// Recursively rewrite a type using `__packed_vec3`, if needed.
/// When used as an array element type, the `__packed_vec3` type will be wrapped in a structure
/// and given an `@align()` attribute to give it alignment it needs to yield the correct array
/// element stride. For vec3 types used in structures directly, the `@align()` attribute is
/// placed on the containing structure instead. Matrices with three rows become arrays of
/// columns, and used the aligned wrapper struct for the column type.
/// @param ty the type to rewrite
/// @param array_element `true` if this is being called for the element of an array
/// @returns the new AST type, or nullptr if rewriting was not necessary
ast::Type RewriteType(const type::Type* ty, bool array_element = false) {
return Switch(
ty,
[&](const type::Vector* vec) -> ast::Type {
if (IsVec3(vec)) {
if (array_element) {
// Create a struct with a single `__packed_vec3` member.
// Give the struct member the same alignment as the original unpacked vec3
// type, to avoid changing the array element stride.
return b.ty(packed_vec3_wrapper_struct_names.GetOrCreate(vec, [&]() {
auto name = b.Symbols().New(
"tint_packed_vec3_" + vec->type()->FriendlyName(src->Symbols()) +
(array_element ? "_array_element" : "_struct_member"));
auto* member =
b.Member(kStructMemberName, MakePackedVec3(vec),
utils::Vector{b.MemberAlign(AInt(vec->Align()))});
b.Structure(b.Ident(name), utils::Vector{member}, utils::Empty);
return name;
}));
} else {
return MakePackedVec3(vec);
}
}
return {};
},
[&](const type::Matrix* mat) -> ast::Type {
// Rewrite the matrix as an array of columns that use the aligned wrapper struct.
auto new_col_type = RewriteType(mat->ColumnType(), /* array_element */ true);
if (new_col_type) {
return b.ty.array(new_col_type, u32(mat->columns()));
}
return {};
},
[&](const type::Array* arr) -> ast::Type {
// Rewrite the array with the modified element type.
auto new_type = RewriteType(arr->ElemType(), /* array_element */ true);
if (new_type) {
utils::Vector<const ast::Attribute*, 1> attrs;
if (arr->Count()->Is<type::RuntimeArrayCount>()) {
return b.ty.array(new_type, std::move(attrs));
} else if (auto count = arr->ConstantCount()) {
return b.ty.array(new_type, u32(count.value()), std::move(attrs));
} else {
TINT_ICE(Transform, b.Diagnostics())
<< type::Array::kErrExpectedConstantCount;
return {};
}
}
return {};
},
[&](const sem::Struct* str) -> ast::Type {
if (ContainsVec3(str)) {
auto name = rewritten_structs.GetOrCreate(str, [&]() {
utils::Vector<const ast::StructMember*, 4> members;
for (auto* member : str->Members()) {
// If the member type contains a vec3, rewrite it.
auto new_type = RewriteType(member->Type());
if (new_type) {
// Copy the member attributes.
bool needs_align = true;
utils::Vector<const ast::Attribute*, 4> attributes;
for (auto* attr : member->Declaration()->attributes) {
if (attr->IsAnyOf<ast::StructMemberAlignAttribute,
ast::StructMemberOffsetAttribute>()) {
needs_align = false;
}
attributes.Push(ctx.Clone(attr));
}
// If the alignment wasn't already specified, add an attribute to
// make sure that we don't alter the alignment when using the packed
// vector type.
if (needs_align) {
attributes.Push(b.MemberAlign(AInt(member->Align())));
}
members.Push(b.Member(ctx.Clone(member->Name()), new_type,
std::move(attributes)));
} else {
// No vec3s, just clone the member as is.
members.Push(ctx.Clone(member->Declaration()));
}
}
// Create the new structure.
auto struct_name = b.Symbols().New(
src->Symbols().NameFor(str->Declaration()->name->symbol) +
"_tint_packed_vec3");
b.Structure(struct_name, std::move(members));
return struct_name;
});
return b.ty(name);
}
return {};
});
}
/// Create a helper function to recursively pack or unpack a composite that contains vec3 types.
/// @param name_prefix the name of the helper function
/// @param ty the composite type to pack or unpack
/// @param pack_or_unpack_element a function that packs or unpacks an element with a given type
/// @param in_type a function that create an AST type for the input type
/// @param out_type a function that create an AST type for the output type
/// @returns the name of the helper function
Symbol MakePackUnpackHelper(
const char* name_prefix,
const type::Type* ty,
const std::function<const ast::Expression*(const ast::Expression*, const type::Type*)>&
pack_or_unpack_element,
const std::function<ast::Type()>& in_type,
const std::function<ast::Type()>& out_type) {
// Allocate a variable to hold the return value of the function.
utils::Vector<const ast::Statement*, 4> statements;
statements.Push(b.Decl(b.Var("result", out_type())));
// Helper that generates a loop to copy and pack/unpack elements of an array to the result:
// for (var i = 0u; i < num_elements; i = i + 1) {
// result[i] = pack_or_unpack_element(in[i]);
// }
auto copy_array_elements = [&](uint32_t num_elements, const type::Type* element_type) {
// Generate an expression for packing or unpacking an element of the array.
auto* element = pack_or_unpack_element(b.IndexAccessor("in", "i"), element_type);
statements.Push(b.For( //
b.Decl(b.Var("i", b.ty.u32())), //
b.LessThan("i", u32(num_elements)), //
b.Assign("i", b.Add("i", 1_a)), //
b.Block(utils::Vector{
b.Assign(b.IndexAccessor("result", "i"), element),
})));
};
// Copy the elements of the value over to the result.
Switch(
ty,
[&](const type::Array* arr) {
TINT_ASSERT(Transform, arr->ConstantCount());
copy_array_elements(arr->ConstantCount().value(), arr->ElemType());
},
[&](const type::Matrix* mat) {
copy_array_elements(mat->columns(), mat->ColumnType());
},
[&](const sem::Struct* str) {
// Copy the struct members over one at a time, packing/unpacking as necessary.
for (auto* member : str->Members()) {
const ast::Expression* element =
b.MemberAccessor("in", b.Ident(ctx.Clone(member->Name())));
if (ContainsVec3(member->Type())) {
element = pack_or_unpack_element(element, member->Type());
}
statements.Push(b.Assign(
b.MemberAccessor("result", b.Ident(ctx.Clone(member->Name()))), element));
}
});
// Return the result.
statements.Push(b.Return("result"));
// Create the function and return its name.
auto name = b.Symbols().New(name_prefix);
b.Func(name, utils::Vector{b.Param("in", in_type())}, out_type(), std::move(statements));
return name;
}
/// Unpack the composite value `expr` to the unpacked type `ty`. If `ty` is a matrix, this will
/// produce a regular matNx3 value from an array of packed column vectors.
/// @param expr the composite value expression to unpack
/// @param ty the unpacked type
/// @returns an expression that holds the unpacked value
const ast::Expression* UnpackComposite(const ast::Expression* expr, const type::Type* ty) {
auto helper = unpack_helpers.GetOrCreate(ty, [&]() {
return MakePackUnpackHelper(
"tint_unpack_vec3_in_composite", ty,
[&](const ast::Expression* element,
const type::Type* element_type) -> const ast::Expression* {
if (element_type->Is<type::Vector>()) {
// Unpack a `__packed_vec3` by casting it to a regular vec3.
// If it is an array element, extract the vector from the wrapper struct.
if (element->Is<ast::IndexAccessorExpression>()) {
element = b.MemberAccessor(element, kStructMemberName);
}
return b.Call(CreateASTTypeFor(ctx, element_type), element);
} else {
return UnpackComposite(element, element_type);
}
},
[&]() { return RewriteType(ty); }, //
[&]() { return CreateASTTypeFor(ctx, ty); });
});
return b.Call(helper, expr);
}
/// Pack the composite value `expr` from the unpacked type `ty`. If `ty` is a matrix, this will
/// produce an array of packed column vectors.
/// @param expr the composite value expression to pack
/// @param ty the unpacked type
/// @returns an expression that holds the packed value
const ast::Expression* PackComposite(const ast::Expression* expr, const type::Type* ty) {
auto helper = pack_helpers.GetOrCreate(ty, [&]() {
return MakePackUnpackHelper(
"tint_pack_vec3_in_composite", ty,
[&](const ast::Expression* element,
const type::Type* element_type) -> const ast::Expression* {
if (element_type->Is<type::Vector>()) {
// Pack a vector element by casting it to a packed_vec3.
// If it is an array element, construct a wrapper struct.
auto* packed = b.Call(MakePackedVec3(element_type), element);
if (element->Is<ast::IndexAccessorExpression>()) {
packed = b.Call(RewriteType(element_type, true), packed);
}
return packed;
} else {
return PackComposite(element, element_type);
}
},
[&]() { return CreateASTTypeFor(ctx, ty); }, //
[&]() { return RewriteType(ty); });
});
return b.Call(helper, expr);
}
/// @returns true if there are host-shareable vec3's that need transforming
bool ShouldRun() {
// Check for vec3s in the types of all uniform and storage buffer variables to determine
// if the transform is necessary.
for (auto* decl : src->AST().GlobalVariables()) {
auto* var = sem.Get<sem::GlobalVariable>(decl);
if (var && builtin::IsHostShareable(var->AddressSpace()) &&
ContainsVec3(var->Type()->UnwrapRef())) {
return true;
}
}
return false;
}
/// Runs the transform /// Runs the transform
/// @returns the new program or SkipTransform if the transform is not required /// @returns the new program or SkipTransform if the transform is not required
ApplyResult Run() { ApplyResult Run() {
// Packed vec3<T> struct members if (!ShouldRun()) {
utils::Hashset<const sem::StructMember*, 8> members;
// Find all the packed vector struct members, and apply the @internal(packed_vector)
// attribute.
for (auto* decl : ctx.src->AST().GlobalDeclarations()) {
if (auto* str = sem.Get<sem::Struct>(decl)) {
if (str->IsHostShareable()) {
for (auto* member : str->Members()) {
if (auto* vec = member->Type()->As<type::Vector>()) {
if (vec->Width() == 3) {
members.Add(member);
// Apply the PackedVec3::Attribute to the member
ctx.InsertFront(
member->Declaration()->attributes,
b.ASTNodes().Create<Attribute>(b.ID(), b.AllocateNodeID()));
}
}
}
}
}
}
if (members.IsEmpty()) {
return SkipTransform; return SkipTransform;
} }
// Walk the nodes, starting with the most deeply nested, finding all the AST expressions // Changing the types of certain structure members can trigger stricter layout validation
// that load a whole packed vector (not a scalar / swizzle of the vector). // rules for the uniform address space. In particular, replacing 16-bit matrices with arrays
utils::Hashset<const sem::ValueExpression*, 16> refs; // violates the requirement that the array element stride is a multiple of 16 bytes, and
// replacing vec3s with a structure violates the requirement that there must be at least 16
// bytes from the start of a structure to the start of the next member.
// Disable these validation rules using an internal extension, as MSL does not have these
// restrictions.
b.Enable(builtin::Extension::kChromiumInternalRelaxedUniformLayout);
// Track expressions that need to be packed or unpacked.
utils::Hashset<const sem::ValueExpression*, 8> to_pack;
utils::Hashset<const sem::ValueExpression*, 8> to_unpack;
// Replace vec3 types in host-shareable address spaces with `__packed_vec3` types, and
// collect expressions that need to be converted to or from values that use the
// `__packed_vec3` type.
for (auto* node : ctx.src->ASTNodes().Objects()) { for (auto* node : ctx.src->ASTNodes().Objects()) {
auto* sem_node = sem.Get(node);
if (sem_node) {
if (auto* expr = sem_node->As<sem::ValueExpression>()) {
sem_node = expr->UnwrapLoad();
}
}
Switch( Switch(
sem_node, // sem.Get(node),
[&](const sem::StructMemberAccess* access) { [&](const sem::TypeExpression* type) {
if (members.Contains(access->Member())) { // Rewrite pointers to types that contain vec3s.
// Access to a packed vector member. Seed the expression tracking. auto* ptr = type->Type()->As<type::Pointer>();
refs.Add(access); if (ptr && builtin::IsHostShareable(ptr->AddressSpace())) {
} auto new_store_type = RewriteType(ptr->StoreType());
}, if (new_store_type) {
[&](const sem::IndexAccessorExpression* access) { auto access = ptr->AddressSpace() == builtin::AddressSpace::kStorage
// Not loading a whole packed vector. Ignore. ? ptr->Access()
refs.Remove(access->Object()->UnwrapLoad()); : builtin::Access::kUndefined;
}, auto new_ptr_type =
[&](const sem::Swizzle* access) { b.ty.pointer(new_store_type, ptr->AddressSpace(), access);
// Not loading a whole packed vector. Ignore. ctx.Replace(node, new_ptr_type.expr);
refs.Remove(access->Object()->UnwrapLoad());
},
[&](const sem::VariableUser* user) {
auto* v = user->Variable();
if (v->Declaration()->Is<ast::Let>() && // if variable is let...
v->Type()->Is<type::Pointer>() && // and let is a pointer...
refs.Contains(v->Initializer())) { // and pointer is to a packed vector...
refs.Add(user); // then propagate tracking to pointer usage
}
},
[&](const sem::ValueExpression* expr) {
if (auto* unary = expr->Declaration()->As<ast::UnaryOpExpression>()) {
if (unary->op == ast::UnaryOp::kAddressOf ||
unary->op == ast::UnaryOp::kIndirection) {
// Memory access on the packed vector. Track these.
auto* inner = sem.GetVal(unary->expr);
if (refs.Remove(inner)) {
refs.Add(expr);
} }
} }
// Note: non-memory ops (e.g. '-') are ignored, leaving any tracked },
// reference at the inner expression, so we'd cast, then apply the unary op. [&](const sem::Variable* var) {
if (!builtin::IsHostShareable(var->AddressSpace())) {
return;
}
// Rewrite the var type, if it contains vec3s.
auto new_store_type = RewriteType(var->Type()->UnwrapRef());
if (new_store_type) {
ctx.Replace(var->Declaration()->type.expr, new_store_type.expr);
} }
}, },
[&](const sem::Statement* e) { [&](const sem::Statement* stmt) {
if (auto* assign = e->Declaration()->As<ast::AssignmentStatement>()) { // Pack the RHS of assignment statements that are writing to packed types.
// We don't want to cast packed_vectors if they're being assigned to. if (auto* assign = stmt->Declaration()->As<ast::AssignmentStatement>()) {
refs.Remove(sem.GetVal(assign->lhs)); auto* lhs = sem.GetVal(assign->lhs);
auto* rhs = sem.GetVal(assign->rhs);
if (!ContainsVec3(rhs->Type()) ||
!builtin::IsHostShareable(
lhs->Type()->As<type::Reference>()->AddressSpace())) {
// Skip assignments to address spaces that are not host-shareable, or
// that do not contain vec3 types.
return;
}
// Pack the RHS expression.
if (to_unpack.Contains(rhs)) {
// The expression will already be packed, so skip the pending unpack.
to_unpack.Remove(rhs);
// If the expression produces a vec3 from an array element, extract
// the packed vector from the wrapper struct.
if (IsVec3(rhs->Type()) &&
rhs->UnwrapLoad()->Is<sem::IndexAccessorExpression>()) {
ctx.Replace(rhs->Declaration(),
b.MemberAccessor(ctx.Clone(rhs->Declaration()),
kStructMemberName));
}
} else if (rhs) {
to_pack.Add(rhs);
}
}
},
[&](const sem::Load* load) {
// Unpack loads of types that contain vec3s in host-shareable address spaces.
if (ContainsVec3(load->Type()) &&
builtin::IsHostShareable(load->ReferenceType()->AddressSpace())) {
to_unpack.Add(load);
}
},
[&](const sem::IndexAccessorExpression* accessor) {
// If the expression produces a reference to a vec3 in a host-shareable address
// space from an array element, extract the packed vector from the wrapper
// struct.
if (auto* ref = accessor->Type()->As<type::Reference>()) {
if (IsVec3(ref->StoreType()) &&
builtin::IsHostShareable(ref->AddressSpace())) {
ctx.Replace(node, b.MemberAccessor(ctx.Clone(accessor->Declaration()),
kStructMemberName));
}
} }
}); });
} }
// Wrap the load expressions with a cast to the unpacked type. // Sort the pending pack/unpack operations by AST node ID to make the order deterministic.
utils::Hashmap<const type::Vector*, Symbol, 3> unpack_fns; auto to_unpack_sorted = to_unpack.Vector();
for (auto* ref : refs) { auto to_pack_sorted = to_pack.Vector();
// ref is either a packed vec3 that needs casting, or a pointer to a vec3 which we just auto pred = [&](auto* expr_a, auto* expr_b) {
// leave alone. return expr_a->Declaration()->node_id < expr_b->Declaration()->node_id;
if (auto* vec_ty = ref->Type()->UnwrapRef()->As<type::Vector>()) { };
auto* expr = ref->Declaration(); to_unpack_sorted.Sort(pred);
ctx.Replace(expr, [this, vec_ty, expr] { // to_pack_sorted.Sort(pred);
auto* packed = ctx.CloneWithoutTransform(expr);
return b.Call(CreateASTTypeFor(ctx, vec_ty), packed); // Apply all of the pending unpack operations that we have collected.
}); for (auto* expr : to_unpack_sorted) {
TINT_ASSERT(Transform, ContainsVec3(expr->Type()));
auto* packed = ctx.Clone(expr->Declaration());
const ast::Expression* unpacked = nullptr;
if (IsVec3(expr->Type())) {
if (expr->UnwrapLoad()->Is<sem::IndexAccessorExpression>()) {
// If we are unpacking a vec3 from an array element, extract the vector from the
// wrapper struct.
packed = b.MemberAccessor(packed, kStructMemberName);
} }
// Cast the packed vector to a regular vec3.
unpacked = b.Call(CreateASTTypeFor(ctx, expr->Type()), packed);
} else {
// Use a helper function to unpack an array or matrix.
unpacked = UnpackComposite(packed, expr->Type());
}
TINT_ASSERT(Transform, unpacked != nullptr);
ctx.Replace(expr->Declaration(), unpacked);
}
// Apply all of the pending pack operations that we have collected.
for (auto* expr : to_pack_sorted) {
TINT_ASSERT(Transform, ContainsVec3(expr->Type()));
auto* unpacked = ctx.Clone(expr->Declaration());
const ast::Expression* packed = nullptr;
if (IsVec3(expr->Type())) {
// Cast the regular vec3 to a packed vector type.
packed = b.Call(MakePackedVec3(expr->Type()), unpacked);
} else {
// Use a helper function to pack an array or matrix.
packed = PackComposite(unpacked, expr->Type());
}
TINT_ASSERT(Transform, packed != nullptr);
ctx.Replace(expr->Declaration(), packed);
} }
ctx.Clone(); ctx.Clone();
@ -153,21 +502,8 @@ struct PackedVec3::State {
CloneContext ctx = {&b, src, /* auto_clone_symbols */ true}; CloneContext ctx = {&b, src, /* auto_clone_symbols */ true};
/// Alias to the semantic info in ctx.src /// Alias to the semantic info in ctx.src
const sem::Info& sem = ctx.src->Sem(); const sem::Info& sem = ctx.src->Sem();
/// Alias to the symbols in ctx.src
const SymbolTable& sym = ctx.src->Symbols();
}; };
PackedVec3::Attribute::Attribute(ProgramID pid, ast::NodeID nid) : Base(pid, nid) {}
PackedVec3::Attribute::~Attribute() = default;
const PackedVec3::Attribute* PackedVec3::Attribute::Clone(CloneContext* ctx) const {
return ctx->dst->ASTNodes().Create<Attribute>(ctx->dst->ID(), ctx->dst->AllocateNodeID());
}
std::string PackedVec3::Attribute::InternalName() const {
return "packed_vector";
}
PackedVec3::PackedVec3() = default; PackedVec3::PackedVec3() = default;
PackedVec3::~PackedVec3() = default; PackedVec3::~PackedVec3() = default;

View File

@ -15,42 +15,31 @@
#ifndef SRC_TINT_TRANSFORM_PACKED_VEC3_H_ #ifndef SRC_TINT_TRANSFORM_PACKED_VEC3_H_
#define SRC_TINT_TRANSFORM_PACKED_VEC3_H_ #define SRC_TINT_TRANSFORM_PACKED_VEC3_H_
#include <string>
#include "src/tint/ast/internal_attribute.h"
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint::transform { namespace tint::transform {
/// A transform to be used by the MSL backend which will: /// A transform to be used by the MSL backend which will:
/// * Apply the `@internal('packed_vector')` attribute (PackedVec3::Attribute) to all host-sharable /// * Replace `vec3<T>` types with an internal `__packed_vec3` type when they are used in
/// structure members that have a vec3<T> type. /// host-shareable address spaces.
/// * Wrap generated `__packed_vec3` types in a structure when they are used in arrays, so that we
/// ensure that the array has the correct element stride.
/// * Multi-version structures that contain `vec3<T>` types when they are used in host-shareable
/// memory, to avoid modifying uses in other address spaces.
/// * Rewrite matrix types that have three rows into arrays of column vectors.
/// * Insert calls to helper functions to convert expressions that use these types to or from the
/// regular vec3 types when accessing host-shareable memory.
/// * Cast all direct (not sub-accessed) loads of these packed vectors to the 'unpacked' vec3<T> /// * Cast all direct (not sub-accessed) loads of these packed vectors to the 'unpacked' vec3<T>
/// type before usage. /// type before usage.
/// ///
/// This transform papers over overload holes in the MSL standard library where an MSL /// This transform is necessary in order to emit vec3 types with the correct size (so that scalars
/// `packed_vector` type cannot be interchangable used as a regular `vec` type. /// can follow them in structures), and also to ensure that padding bytes are preserved when writing
/// to a vec3, an array of vec3 elements, or a matrix with vec3 column type.
///
/// @note Depends on the following transforms to have been run first:
/// * ExpandCompoundAssignment
class PackedVec3 final : public Castable<PackedVec3, Transform> { class PackedVec3 final : public Castable<PackedVec3, Transform> {
public: public:
/// Attribute is the attribute applied to padded vector structure members.
class Attribute final : public Castable<Attribute, ast::InternalAttribute> {
public:
/// Constructor
/// @param pid the identifier of the program that owns this node
/// @param nid the unique node identifier
Attribute(ProgramID pid, ast::NodeID nid);
/// Destructor
~Attribute() override;
/// @returns "packed_vector".
std::string InternalName() const override;
/// Performs a deep clone of this object using the CloneContext `ctx`.
/// @param ctx the clone context
/// @return the newly cloned object
const Attribute* Clone(CloneContext* ctx) const override;
};
/// Constructor /// Constructor
PackedVec3(); PackedVec3();
/// Destructor /// Destructor

File diff suppressed because it is too large Load Diff

View File

@ -1714,7 +1714,7 @@ std::vector<const char*> ConstructableTypes() {
for (auto* ty : builtin::kBuiltinStrings) { for (auto* ty : builtin::kBuiltinStrings) {
std::string_view type(ty); std::string_view type(ty);
if (type != "ptr" && type != "atomic" && !utils::HasPrefix(type, "sampler") && if (type != "ptr" && type != "atomic" && !utils::HasPrefix(type, "sampler") &&
!utils::HasPrefix(type, "texture")) { !utils::HasPrefix(type, "texture") && !utils::HasPrefix(type, "__")) {
out.push_back(ty); out.push_back(ty);
} }
} }
@ -1924,8 +1924,10 @@ INSTANTIATE_TEST_SUITE_P(RenamerBuiltinTypeTest,
std::vector<const char*> Identifiers() { std::vector<const char*> Identifiers() {
std::vector<const char*> out; std::vector<const char*> out;
for (auto* ident : builtin::kBuiltinStrings) { for (auto* ident : builtin::kBuiltinStrings) {
if (!utils::HasPrefix(ident, "__")) {
out.push_back(ident); out.push_back(ident);
} }
}
for (auto* ident : builtin::kAddressSpaceStrings) { for (auto* ident : builtin::kAddressSpaceStrings) {
if (!utils::HasPrefix(ident, "_")) { if (!utils::HasPrefix(ident, "_")) {
out.push_back(ident); out.push_back(ident);

View File

@ -17,6 +17,7 @@
#include <algorithm> #include <algorithm>
#include <string> #include <string>
#include "src/tint/builtin/builtin.h"
#include "src/tint/program_builder.h" #include "src/tint/program_builder.h"
#include "src/tint/sem/block_statement.h" #include "src/tint/sem/block_statement.h"
#include "src/tint/sem/for_loop_statement.h" #include "src/tint/sem/for_loop_statement.h"
@ -98,8 +99,13 @@ ast::Type Transform::CreateASTTypeFor(CloneContext& ctx, const type::Type* ty) {
} }
if (auto* v = ty->As<type::Vector>()) { if (auto* v = ty->As<type::Vector>()) {
auto el = CreateASTTypeFor(ctx, v->type()); auto el = CreateASTTypeFor(ctx, v->type());
if (v->Packed()) {
TINT_ASSERT(Transform, v->Width() == 3u);
return ctx.dst->ty(builtin::Builtin::kPackedVec3, el);
} else {
return ctx.dst->ty.vec(el, v->Width()); return ctx.dst->ty.vec(el, v->Width());
} }
}
if (auto* a = ty->As<type::Array>()) { if (auto* a = ty->As<type::Array>()) {
auto el = CreateASTTypeFor(ctx, a->ElemType()); auto el = CreateASTTypeFor(ctx, a->ElemType());
utils::Vector<const ast::Attribute*, 1> attrs; utils::Vector<const ast::Attribute*, 1> attrs;

View File

@ -23,15 +23,16 @@ TINT_INSTANTIATE_TYPEINFO(tint::type::Vector);
namespace tint::type { namespace tint::type {
Vector::Vector(Type const* subtype, uint32_t width) Vector::Vector(Type const* subtype, uint32_t width, bool packed /* = false */)
: Base(utils::Hash(TypeInfo::Of<Vector>().full_hashcode, width, subtype), : Base(utils::Hash(TypeInfo::Of<Vector>().full_hashcode, width, subtype, packed),
type::Flags{ type::Flags{
Flag::kConstructable, Flag::kConstructable,
Flag::kCreationFixedFootprint, Flag::kCreationFixedFootprint,
Flag::kFixedFootprint, Flag::kFixedFootprint,
}), }),
subtype_(subtype), subtype_(subtype),
width_(width) { width_(width),
packed_(packed) {
TINT_ASSERT(Type, width_ > 1); TINT_ASSERT(Type, width_ > 1);
TINT_ASSERT(Type, width_ < 5); TINT_ASSERT(Type, width_ < 5);
} }
@ -40,13 +41,16 @@ Vector::~Vector() = default;
bool Vector::Equals(const UniqueNode& other) const { bool Vector::Equals(const UniqueNode& other) const {
if (auto* v = other.As<Vector>()) { if (auto* v = other.As<Vector>()) {
return v->width_ == width_ && v->subtype_ == subtype_; return v->width_ == width_ && v->subtype_ == subtype_ && v->packed_ == packed_;
} }
return false; return false;
} }
std::string Vector::FriendlyName(const SymbolTable& symbols) const { std::string Vector::FriendlyName(const SymbolTable& symbols) const {
std::ostringstream out; std::ostringstream out;
if (packed_) {
out << "__packed_";
}
out << "vec" << width_ << "<" << subtype_->FriendlyName(symbols) << ">"; out << "vec" << width_ << "<" << subtype_->FriendlyName(symbols) << ">";
return out.str(); return out.str();
} }
@ -60,7 +64,7 @@ uint32_t Vector::Align() const {
case 2: case 2:
return subtype_->Size() * 2; return subtype_->Size() * 2;
case 3: case 3:
return subtype_->Size() * 4; return subtype_->Size() * (packed_ ? 1 : 4);
case 4: case 4:
return subtype_->Size() * 4; return subtype_->Size() * 4;
} }
@ -69,7 +73,7 @@ uint32_t Vector::Align() const {
Vector* Vector::Clone(CloneContext& ctx) const { Vector* Vector::Clone(CloneContext& ctx) const {
auto* subtype = subtype_->Clone(ctx); auto* subtype = subtype_->Clone(ctx);
return ctx.dst.mgr->Get<Vector>(subtype, width_); return ctx.dst.mgr->Get<Vector>(subtype, width_, packed_);
} }
} // namespace tint::type } // namespace tint::type

View File

@ -22,12 +22,13 @@
namespace tint::type { namespace tint::type {
/// A vector type. /// A vector type.
class Vector final : public Castable<Vector, Type> { class Vector : public Castable<Vector, Type> {
public: public:
/// Constructor /// Constructor
/// @param subtype the vector element type /// @param subtype the vector element type
/// @param size the number of elements in the vector /// @param size the number of elements in the vector
Vector(Type const* subtype, uint32_t size); /// @param packed the optional 'packed' modifier
Vector(Type const* subtype, uint32_t size, bool packed = false);
/// Destructor /// Destructor
~Vector() override; ~Vector() override;
@ -50,10 +51,12 @@ class Vector final : public Castable<Vector, Type> {
/// @returns the size in bytes of the type. This may include tail padding. /// @returns the size in bytes of the type. This may include tail padding.
uint32_t Size() const override; uint32_t Size() const override;
/// @returns the alignment in bytes of the type. This may include tail /// @returns the alignment in bytes of the type. This may include tail padding.
/// padding.
uint32_t Align() const override; uint32_t Align() const override;
/// @returns `true` if this vector is packed, false otherwise
bool Packed() const { return packed_; }
/// @param width the width of the vector /// @param width the width of the vector
/// @returns the size in bytes of a vector of the given width. /// @returns the size in bytes of a vector of the given width.
static uint32_t SizeOf(uint32_t width); static uint32_t SizeOf(uint32_t width);
@ -69,6 +72,7 @@ class Vector final : public Castable<Vector, Type> {
private: private:
Type const* const subtype_; Type const* const subtype_;
const uint32_t width_; const uint32_t width_;
const bool packed_;
}; };
} // namespace tint::type } // namespace tint::type

View File

@ -34,6 +34,21 @@ TEST_F(VectorTest, Creation) {
EXPECT_NE(a, d); EXPECT_NE(a, d);
} }
TEST_F(VectorTest, Creation_Packed) {
auto* v = create<Vector>(create<F32>(), 3u);
auto* p1 = create<Vector>(create<F32>(), 3u, true);
auto* p2 = create<Vector>(create<F32>(), 3u, true);
EXPECT_FALSE(v->Packed());
EXPECT_EQ(p1->type(), create<F32>());
EXPECT_EQ(p1->Width(), 3u);
EXPECT_TRUE(p1->Packed());
EXPECT_NE(v, p1);
EXPECT_EQ(p1, p2);
}
TEST_F(VectorTest, Hash) { TEST_F(VectorTest, Hash) {
auto* a = create<Vector>(create<I32>(), 2u); auto* a = create<Vector>(create<I32>(), 2u);
auto* b = create<Vector>(create<I32>(), 2u); auto* b = create<Vector>(create<I32>(), 2u);
@ -59,6 +74,12 @@ TEST_F(VectorTest, FriendlyName) {
EXPECT_EQ(v->FriendlyName(Symbols()), "vec3<f32>"); EXPECT_EQ(v->FriendlyName(Symbols()), "vec3<f32>");
} }
TEST_F(VectorTest, FriendlyName_Packed) {
auto* f32 = create<F32>();
auto* v = create<Vector>(f32, 3u, true);
EXPECT_EQ(v->FriendlyName(Symbols()), "__packed_vec3<f32>");
}
TEST_F(VectorTest, Clone) { TEST_F(VectorTest, Clone) {
auto* a = create<Vector>(create<I32>(), 2u); auto* a = create<Vector>(create<I32>(), 2u);
@ -68,6 +89,19 @@ TEST_F(VectorTest, Clone) {
auto* vec = a->Clone(ctx); auto* vec = a->Clone(ctx);
EXPECT_TRUE(vec->type()->Is<I32>()); EXPECT_TRUE(vec->type()->Is<I32>());
EXPECT_EQ(vec->Width(), 2u); EXPECT_EQ(vec->Width(), 2u);
EXPECT_FALSE(vec->Packed());
}
TEST_F(VectorTest, Clone_Packed) {
auto* a = create<Vector>(create<I32>(), 3u, true);
type::Manager mgr;
type::CloneContext ctx{{nullptr}, {nullptr, &mgr}};
auto* vec = a->Clone(ctx);
EXPECT_TRUE(vec->type()->Is<I32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TRUE(vec->Packed());
} }
} // namespace } // namespace

View File

@ -245,8 +245,9 @@ SanitizedResult Sanitize(const Program* in, const Options& options) {
// ArrayLengthFromUniform must come after SimplifyPointers, as // ArrayLengthFromUniform must come after SimplifyPointers, as
// it assumes that the form of the array length argument is &var.array. // it assumes that the form of the array length argument is &var.array.
manager.Add<transform::ArrayLengthFromUniform>(); manager.Add<transform::ArrayLengthFromUniform>();
manager.Add<transform::ModuleScopeVarToEntryPointParam>(); // PackedVec3 must come after ExpandCompoundAssignment.
manager.Add<transform::PackedVec3>(); manager.Add<transform::PackedVec3>();
manager.Add<transform::ModuleScopeVarToEntryPointParam>();
data.Add<transform::ArrayLengthFromUniform::Config>(std::move(array_length_from_uniform_cfg)); data.Add<transform::ArrayLengthFromUniform::Config>(std::move(array_length_from_uniform_cfg));
data.Add<transform::CanonicalizeEntryPointIO::Config>(std::move(entry_point_io_cfg)); data.Add<transform::CanonicalizeEntryPointIO::Config>(std::move(entry_point_io_cfg));
auto out = manager.Run(in, data); auto out = manager.Run(in, data);
@ -273,6 +274,7 @@ bool GeneratorImpl::Generate() {
builtin::Extension::kChromiumDisableUniformityAnalysis, builtin::Extension::kChromiumDisableUniformityAnalysis,
builtin::Extension::kChromiumExperimentalFullPtrParameters, builtin::Extension::kChromiumExperimentalFullPtrParameters,
builtin::Extension::kChromiumExperimentalPushConstant, builtin::Extension::kChromiumExperimentalPushConstant,
builtin::Extension::kChromiumInternalRelaxedUniformLayout,
builtin::Extension::kF16, builtin::Extension::kF16,
})) { })) {
return false; return false;
@ -2374,25 +2376,20 @@ bool GeneratorImpl::EmitMemberAccessor(std::ostream& out,
return Switch( return Switch(
sem, sem,
[&](const sem::Swizzle* swizzle) { [&](const sem::Swizzle* swizzle) {
// Metal 1.x does not support swizzling of packed vector types. // Metal did not add support for swizzle syntax with packed vector types until
// For single element swizzles, we can use the index operator. // Metal 2.1, so we need to use the index operator for single-element selection instead.
// For multi-element swizzles, we need to cast to a regular vector type // For multi-component swizzles, the PackedVec3 transform will have inserted casts to
// first. Note that we do not currently allow assignments to swizzles, so // the non-packed types, so we can safely use swizzle syntax here.
// the casting which will convert the l-value to r-value is fine.
if (swizzle->Indices().Length() == 1) { if (swizzle->Indices().Length() == 1) {
if (!write_lhs()) { if (!write_lhs()) {
return false; return false;
} }
out << "[" << swizzle->Indices()[0] << "]"; out << "[" << swizzle->Indices()[0] << "]";
} else { } else {
if (!EmitType(out, swizzle->Object()->Type()->UnwrapRef(), "")) {
return false;
}
out << "(";
if (!write_lhs()) { if (!write_lhs()) {
return false; return false;
} }
out << ")." << program_->Symbols().NameFor(expr->member->symbol); out << "." << program_->Symbols().NameFor(expr->member->symbol);
} }
return true; return true;
}, },
@ -2731,6 +2728,9 @@ bool GeneratorImpl::EmitType(std::ostream& out,
return true; return true;
}, },
[&](const type::Vector* vec) { [&](const type::Vector* vec) {
if (vec->Packed()) {
out << "packed_";
}
if (!EmitType(out, vec->type(), "")) { if (!EmitType(out, vec->type(), "")) {
return false; return false;
} }
@ -2838,11 +2838,6 @@ bool GeneratorImpl::EmitStructType(TextBuffer* b, const sem::Struct* str) {
add_byte_offset_comment(out, msl_offset); add_byte_offset_comment(out, msl_offset);
} }
if (auto* decl = mem->Declaration()) {
if (ast::HasAttribute<transform::PackedVec3::Attribute>(decl->attributes)) {
out << "packed_";
}
}
if (!EmitType(out, mem->Type(), mem_name)) { if (!EmitType(out, mem->Type(), mem_name)) {
return false; return false;
} }
@ -2924,7 +2919,6 @@ bool GeneratorImpl::EmitStructType(TextBuffer* b, const sem::Struct* str) {
[&](const ast::StructMemberOffsetAttribute*) { return true; }, [&](const ast::StructMemberOffsetAttribute*) { return true; },
[&](const ast::StructMemberAlignAttribute*) { return true; }, [&](const ast::StructMemberAlignAttribute*) { return true; },
[&](const ast::StructMemberSizeAttribute*) { return true; }, [&](const ast::StructMemberSizeAttribute*) { return true; },
[&](const transform::PackedVec3::Attribute*) { return true; },
[&](Default) { [&](Default) {
TINT_ICE(Writer, diagnostics_) TINT_ICE(Writer, diagnostics_)
<< "unhandled struct member attribute: " << attr->Name(); << "unhandled struct member attribute: " << attr->Name();

View File

@ -41,7 +41,7 @@ TEST_F(MslGeneratorImplTest, EmitExpression_MemberAccessor_Swizzle_xyz) {
GeneratorImpl& gen = Build(); GeneratorImpl& gen = Build();
std::stringstream out; std::stringstream out;
ASSERT_TRUE(gen.EmitExpression(out, expr)) << gen.error(); ASSERT_TRUE(gen.EmitExpression(out, expr)) << gen.error();
EXPECT_EQ(out.str(), "float4(my_vec).xyz"); EXPECT_EQ(out.str(), "my_vec.xyz");
} }
TEST_F(MslGeneratorImplTest, EmitExpression_MemberAccessor_Swizzle_gbr) { TEST_F(MslGeneratorImplTest, EmitExpression_MemberAccessor_Swizzle_gbr) {
@ -53,7 +53,7 @@ TEST_F(MslGeneratorImplTest, EmitExpression_MemberAccessor_Swizzle_gbr) {
GeneratorImpl& gen = Build(); GeneratorImpl& gen = Build();
std::stringstream out; std::stringstream out;
ASSERT_TRUE(gen.EmitExpression(out, expr)) << gen.error(); ASSERT_TRUE(gen.EmitExpression(out, expr)) << gen.error();
EXPECT_EQ(out.str(), "float4(my_vec).gbr"); EXPECT_EQ(out.str(), "my_vec.gbr");
} }
} // namespace } // namespace

View File

@ -4,8 +4,8 @@ using namespace metal;
kernel void tint_symbol() { kernel void tint_symbol() {
float3 const v = float3(1.0f, 2.0f, 3.0f); float3 const v = float3(1.0f, 2.0f, 3.0f);
float const scalar = v[1]; float const scalar = v[1];
float2 const swizzle2 = float3(v).xz; float2 const swizzle2 = v.xz;
float3 const swizzle3 = float3(v).xzy; float3 const swizzle3 = v.xzy;
return; return;
} }

View File

@ -4,8 +4,8 @@ using namespace metal;
kernel void tint_symbol() { kernel void tint_symbol() {
float3 v = 0.0f; float3 v = 0.0f;
float const scalar = v[1]; float const scalar = v[1];
float2 const swizzle2 = float3(v).xz; float2 const swizzle2 = v.xz;
float3 const swizzle3 = float3(v).xzy; float3 const swizzle3 = v.xzy;
return; return;
} }

View File

@ -14,42 +14,108 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct Inner { struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
struct Inner_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ int scalar_i32; /* 0x0004 */ int scalar_i32;
/* 0x0008 */ uint scalar_u32; /* 0x0008 */ uint scalar_u32;
/* 0x000c */ tint_array<int8_t, 4> tint_pad; /* 0x000c */ tint_array<int8_t, 4> tint_pad_1;
/* 0x0010 */ float2 vec2_f32; /* 0x0010 */ float2 vec2_f32;
/* 0x0018 */ int2 vec2_i32; /* 0x0018 */ int2 vec2_i32;
/* 0x0020 */ uint2 vec2_u32; /* 0x0020 */ uint2 vec2_u32;
/* 0x0028 */ tint_array<int8_t, 8> tint_pad_1; /* 0x0028 */ tint_array<int8_t, 8> tint_pad_2;
/* 0x0030 */ packed_float3 vec3_f32; /* 0x0030 */ packed_float3 vec3_f32;
/* 0x003c */ tint_array<int8_t, 4> tint_pad_2; /* 0x003c */ tint_array<int8_t, 4> tint_pad_3;
/* 0x0040 */ packed_int3 vec3_i32; /* 0x0040 */ packed_int3 vec3_i32;
/* 0x004c */ tint_array<int8_t, 4> tint_pad_3; /* 0x004c */ tint_array<int8_t, 4> tint_pad_4;
/* 0x0050 */ packed_uint3 vec3_u32; /* 0x0050 */ packed_uint3 vec3_u32;
/* 0x005c */ tint_array<int8_t, 4> tint_pad_4; /* 0x005c */ tint_array<int8_t, 4> tint_pad_5;
/* 0x0060 */ float4 vec4_f32; /* 0x0060 */ float4 vec4_f32;
/* 0x0070 */ int4 vec4_i32; /* 0x0070 */ int4 vec4_i32;
/* 0x0080 */ uint4 vec4_u32; /* 0x0080 */ uint4 vec4_u32;
/* 0x0090 */ float2x2 mat2x2_f32; /* 0x0090 */ float2x2 mat2x2_f32;
/* 0x00a0 */ float2x3 mat2x3_f32; /* 0x00a0 */ tint_array<tint_packed_vec3_f32_array_element, 2> mat2x3_f32;
/* 0x00c0 */ float2x4 mat2x4_f32; /* 0x00c0 */ float2x4 mat2x4_f32;
/* 0x00e0 */ float3x2 mat3x2_f32; /* 0x00e0 */ float3x2 mat3x2_f32;
/* 0x00f8 */ tint_array<int8_t, 8> tint_pad_5; /* 0x00f8 */ tint_array<int8_t, 8> tint_pad_6;
/* 0x0100 */ float3x3 mat3x3_f32; /* 0x0100 */ tint_array<tint_packed_vec3_f32_array_element, 3> mat3x3_f32;
/* 0x0130 */ float3x4 mat3x4_f32; /* 0x0130 */ float3x4 mat3x4_f32;
/* 0x0160 */ float4x2 mat4x2_f32; /* 0x0160 */ float4x2 mat4x2_f32;
/* 0x0180 */ float4x3 mat4x3_f32; /* 0x0180 */ tint_array<tint_packed_vec3_f32_array_element, 4> mat4x3_f32;
/* 0x01c0 */ float4x4 mat4x4_f32; /* 0x01c0 */ float4x4 mat4x4_f32;
/* 0x0200 */ tint_array<float3, 2> arr2_vec3_f32; /* 0x0200 */ tint_array<tint_packed_vec3_f32_array_element, 2> arr2_vec3_f32;
};
struct S_tint_packed_vec3 {
/* 0x0000 */ tint_array<Inner_tint_packed_vec3, 1> arr;
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
float4x3 result = float4x3(0.0f);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
tint_array<float3, 2> result = {};
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
struct Inner {
float scalar_f32;
int scalar_i32;
uint scalar_u32;
float2 vec2_f32;
int2 vec2_i32;
uint2 vec2_u32;
float3 vec3_f32;
int3 vec3_i32;
uint3 vec3_u32;
float4 vec4_f32;
int4 vec4_i32;
uint4 vec4_u32;
float2x2 mat2x2_f32;
float2x3 mat2x3_f32;
float2x4 mat2x4_f32;
float3x2 mat3x2_f32;
float3x3 mat3x3_f32;
float3x4 mat3x4_f32;
float4x2 mat4x2_f32;
float4x3 mat4x3_f32;
float4x4 mat4x4_f32;
tint_array<float3, 2> arr2_vec3_f32;
}; };
struct S { struct S {
/* 0x0000 */ tint_array<Inner, 1> arr; tint_array<Inner, 1> arr;
}; };
void tint_symbol_inner(uint idx, const device S* const tint_symbol_1) { void tint_symbol_inner(uint idx, const device S_tint_packed_vec3* const tint_symbol_1) {
float const scalar_f32 = (*(tint_symbol_1)).arr[idx].scalar_f32; float const scalar_f32 = (*(tint_symbol_1)).arr[idx].scalar_f32;
int const scalar_i32 = (*(tint_symbol_1)).arr[idx].scalar_i32; int const scalar_i32 = (*(tint_symbol_1)).arr[idx].scalar_i32;
uint const scalar_u32 = (*(tint_symbol_1)).arr[idx].scalar_u32; uint const scalar_u32 = (*(tint_symbol_1)).arr[idx].scalar_u32;
@ -63,18 +129,18 @@ void tint_symbol_inner(uint idx, const device S* const tint_symbol_1) {
int4 const vec4_i32 = (*(tint_symbol_1)).arr[idx].vec4_i32; int4 const vec4_i32 = (*(tint_symbol_1)).arr[idx].vec4_i32;
uint4 const vec4_u32 = (*(tint_symbol_1)).arr[idx].vec4_u32; uint4 const vec4_u32 = (*(tint_symbol_1)).arr[idx].vec4_u32;
float2x2 const mat2x2_f32 = (*(tint_symbol_1)).arr[idx].mat2x2_f32; float2x2 const mat2x2_f32 = (*(tint_symbol_1)).arr[idx].mat2x2_f32;
float2x3 const mat2x3_f32 = (*(tint_symbol_1)).arr[idx].mat2x3_f32; float2x3 const mat2x3_f32 = tint_unpack_vec3_in_composite((*(tint_symbol_1)).arr[idx].mat2x3_f32);
float2x4 const mat2x4_f32 = (*(tint_symbol_1)).arr[idx].mat2x4_f32; float2x4 const mat2x4_f32 = (*(tint_symbol_1)).arr[idx].mat2x4_f32;
float3x2 const mat3x2_f32 = (*(tint_symbol_1)).arr[idx].mat3x2_f32; float3x2 const mat3x2_f32 = (*(tint_symbol_1)).arr[idx].mat3x2_f32;
float3x3 const mat3x3_f32 = (*(tint_symbol_1)).arr[idx].mat3x3_f32; float3x3 const mat3x3_f32 = tint_unpack_vec3_in_composite_1((*(tint_symbol_1)).arr[idx].mat3x3_f32);
float3x4 const mat3x4_f32 = (*(tint_symbol_1)).arr[idx].mat3x4_f32; float3x4 const mat3x4_f32 = (*(tint_symbol_1)).arr[idx].mat3x4_f32;
float4x2 const mat4x2_f32 = (*(tint_symbol_1)).arr[idx].mat4x2_f32; float4x2 const mat4x2_f32 = (*(tint_symbol_1)).arr[idx].mat4x2_f32;
float4x3 const mat4x3_f32 = (*(tint_symbol_1)).arr[idx].mat4x3_f32; float4x3 const mat4x3_f32 = tint_unpack_vec3_in_composite_2((*(tint_symbol_1)).arr[idx].mat4x3_f32);
float4x4 const mat4x4_f32 = (*(tint_symbol_1)).arr[idx].mat4x4_f32; float4x4 const mat4x4_f32 = (*(tint_symbol_1)).arr[idx].mat4x4_f32;
tint_array<float3, 2> const arr2_vec3_f32 = (*(tint_symbol_1)).arr[idx].arr2_vec3_f32; tint_array<float3, 2> const arr2_vec3_f32 = tint_unpack_vec3_in_composite_3((*(tint_symbol_1)).arr[idx].arr2_vec3_f32);
} }
kernel void tint_symbol(const device S* tint_symbol_2 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) { kernel void tint_symbol(const device S_tint_packed_vec3* tint_symbol_2 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) {
tint_symbol_inner(idx, tint_symbol_2); tint_symbol_inner(idx, tint_symbol_2);
return; return;
} }

View File

@ -14,60 +14,169 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct Inner { struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad_1;
};
struct Inner_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ int scalar_i32; /* 0x0004 */ int scalar_i32;
/* 0x0008 */ uint scalar_u32; /* 0x0008 */ uint scalar_u32;
/* 0x000c */ half scalar_f16; /* 0x000c */ half scalar_f16;
/* 0x000e */ tint_array<int8_t, 2> tint_pad; /* 0x000e */ tint_array<int8_t, 2> tint_pad_2;
/* 0x0010 */ float2 vec2_f32; /* 0x0010 */ float2 vec2_f32;
/* 0x0018 */ int2 vec2_i32; /* 0x0018 */ int2 vec2_i32;
/* 0x0020 */ uint2 vec2_u32; /* 0x0020 */ uint2 vec2_u32;
/* 0x0028 */ half2 vec2_f16; /* 0x0028 */ half2 vec2_f16;
/* 0x002c */ tint_array<int8_t, 4> tint_pad_1; /* 0x002c */ tint_array<int8_t, 4> tint_pad_3;
/* 0x0030 */ packed_float3 vec3_f32; /* 0x0030 */ packed_float3 vec3_f32;
/* 0x003c */ tint_array<int8_t, 4> tint_pad_2; /* 0x003c */ tint_array<int8_t, 4> tint_pad_4;
/* 0x0040 */ packed_int3 vec3_i32; /* 0x0040 */ packed_int3 vec3_i32;
/* 0x004c */ tint_array<int8_t, 4> tint_pad_3; /* 0x004c */ tint_array<int8_t, 4> tint_pad_5;
/* 0x0050 */ packed_uint3 vec3_u32; /* 0x0050 */ packed_uint3 vec3_u32;
/* 0x005c */ tint_array<int8_t, 4> tint_pad_4; /* 0x005c */ tint_array<int8_t, 4> tint_pad_6;
/* 0x0060 */ packed_half3 vec3_f16; /* 0x0060 */ packed_half3 vec3_f16;
/* 0x0066 */ tint_array<int8_t, 10> tint_pad_5; /* 0x0066 */ tint_array<int8_t, 10> tint_pad_7;
/* 0x0070 */ float4 vec4_f32; /* 0x0070 */ float4 vec4_f32;
/* 0x0080 */ int4 vec4_i32; /* 0x0080 */ int4 vec4_i32;
/* 0x0090 */ uint4 vec4_u32; /* 0x0090 */ uint4 vec4_u32;
/* 0x00a0 */ half4 vec4_f16; /* 0x00a0 */ half4 vec4_f16;
/* 0x00a8 */ float2x2 mat2x2_f32; /* 0x00a8 */ float2x2 mat2x2_f32;
/* 0x00b8 */ tint_array<int8_t, 8> tint_pad_6; /* 0x00b8 */ tint_array<int8_t, 8> tint_pad_8;
/* 0x00c0 */ float2x3 mat2x3_f32; /* 0x00c0 */ tint_array<tint_packed_vec3_f32_array_element, 2> mat2x3_f32;
/* 0x00e0 */ float2x4 mat2x4_f32; /* 0x00e0 */ float2x4 mat2x4_f32;
/* 0x0100 */ float3x2 mat3x2_f32; /* 0x0100 */ float3x2 mat3x2_f32;
/* 0x0118 */ tint_array<int8_t, 8> tint_pad_7; /* 0x0118 */ tint_array<int8_t, 8> tint_pad_9;
/* 0x0120 */ float3x3 mat3x3_f32; /* 0x0120 */ tint_array<tint_packed_vec3_f32_array_element, 3> mat3x3_f32;
/* 0x0150 */ float3x4 mat3x4_f32; /* 0x0150 */ float3x4 mat3x4_f32;
/* 0x0180 */ float4x2 mat4x2_f32; /* 0x0180 */ float4x2 mat4x2_f32;
/* 0x01a0 */ float4x3 mat4x3_f32; /* 0x01a0 */ tint_array<tint_packed_vec3_f32_array_element, 4> mat4x3_f32;
/* 0x01e0 */ float4x4 mat4x4_f32; /* 0x01e0 */ float4x4 mat4x4_f32;
/* 0x0220 */ half2x2 mat2x2_f16; /* 0x0220 */ half2x2 mat2x2_f16;
/* 0x0228 */ half2x3 mat2x3_f16; /* 0x0228 */ tint_array<tint_packed_vec3_f16_array_element, 2> mat2x3_f16;
/* 0x0238 */ half2x4 mat2x4_f16; /* 0x0238 */ half2x4 mat2x4_f16;
/* 0x0248 */ half3x2 mat3x2_f16; /* 0x0248 */ half3x2 mat3x2_f16;
/* 0x0254 */ tint_array<int8_t, 4> tint_pad_8; /* 0x0254 */ tint_array<int8_t, 4> tint_pad_10;
/* 0x0258 */ half3x3 mat3x3_f16; /* 0x0258 */ tint_array<tint_packed_vec3_f16_array_element, 3> mat3x3_f16;
/* 0x0270 */ half3x4 mat3x4_f16; /* 0x0270 */ half3x4 mat3x4_f16;
/* 0x0288 */ half4x2 mat4x2_f16; /* 0x0288 */ half4x2 mat4x2_f16;
/* 0x0298 */ half4x3 mat4x3_f16; /* 0x0298 */ tint_array<tint_packed_vec3_f16_array_element, 4> mat4x3_f16;
/* 0x02b8 */ half4x4 mat4x4_f16; /* 0x02b8 */ half4x4 mat4x4_f16;
/* 0x02d8 */ tint_array<int8_t, 8> tint_pad_9; /* 0x02d8 */ tint_array<int8_t, 8> tint_pad_11;
/* 0x02e0 */ tint_array<float3, 2> arr2_vec3_f32; /* 0x02e0 */ tint_array<tint_packed_vec3_f32_array_element, 2> arr2_vec3_f32;
/* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16; /* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16;
}; };
struct S { struct S_tint_packed_vec3 {
/* 0x0000 */ tint_array<Inner, 1> arr; /* 0x0000 */ tint_array<Inner_tint_packed_vec3, 1> arr;
}; };
void tint_symbol_inner(uint idx, const device S* const tint_symbol_1) { float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
float4x3 result = float4x3(0.0f);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
half2x3 tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
half2x3 result = half2x3(0.0h);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
half3x3 tint_unpack_vec3_in_composite_4(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
half3x3 result = half3x3(0.0h);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
half4x3 tint_unpack_vec3_in_composite_5(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
half4x3 result = half4x3(0.0h);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_6(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
tint_array<float3, 2> result = {};
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
struct Inner {
float scalar_f32;
int scalar_i32;
uint scalar_u32;
half scalar_f16;
float2 vec2_f32;
int2 vec2_i32;
uint2 vec2_u32;
half2 vec2_f16;
float3 vec3_f32;
int3 vec3_i32;
uint3 vec3_u32;
half3 vec3_f16;
float4 vec4_f32;
int4 vec4_i32;
uint4 vec4_u32;
half4 vec4_f16;
float2x2 mat2x2_f32;
float2x3 mat2x3_f32;
float2x4 mat2x4_f32;
float3x2 mat3x2_f32;
float3x3 mat3x3_f32;
float3x4 mat3x4_f32;
float4x2 mat4x2_f32;
float4x3 mat4x3_f32;
float4x4 mat4x4_f32;
half2x2 mat2x2_f16;
half2x3 mat2x3_f16;
half2x4 mat2x4_f16;
half3x2 mat3x2_f16;
half3x3 mat3x3_f16;
half3x4 mat3x4_f16;
half4x2 mat4x2_f16;
half4x3 mat4x3_f16;
half4x4 mat4x4_f16;
tint_array<float3, 2> arr2_vec3_f32;
tint_array<half4x2, 2> arr2_mat4x2_f16;
};
struct S {
tint_array<Inner, 1> arr;
};
void tint_symbol_inner(uint idx, const device S_tint_packed_vec3* const tint_symbol_1) {
float const scalar_f32 = (*(tint_symbol_1)).arr[idx].scalar_f32; float const scalar_f32 = (*(tint_symbol_1)).arr[idx].scalar_f32;
int const scalar_i32 = (*(tint_symbol_1)).arr[idx].scalar_i32; int const scalar_i32 = (*(tint_symbol_1)).arr[idx].scalar_i32;
uint const scalar_u32 = (*(tint_symbol_1)).arr[idx].scalar_u32; uint const scalar_u32 = (*(tint_symbol_1)).arr[idx].scalar_u32;
@ -85,28 +194,28 @@ void tint_symbol_inner(uint idx, const device S* const tint_symbol_1) {
uint4 const vec4_u32 = (*(tint_symbol_1)).arr[idx].vec4_u32; uint4 const vec4_u32 = (*(tint_symbol_1)).arr[idx].vec4_u32;
half4 const vec4_f16 = (*(tint_symbol_1)).arr[idx].vec4_f16; half4 const vec4_f16 = (*(tint_symbol_1)).arr[idx].vec4_f16;
float2x2 const mat2x2_f32 = (*(tint_symbol_1)).arr[idx].mat2x2_f32; float2x2 const mat2x2_f32 = (*(tint_symbol_1)).arr[idx].mat2x2_f32;
float2x3 const mat2x3_f32 = (*(tint_symbol_1)).arr[idx].mat2x3_f32; float2x3 const mat2x3_f32 = tint_unpack_vec3_in_composite((*(tint_symbol_1)).arr[idx].mat2x3_f32);
float2x4 const mat2x4_f32 = (*(tint_symbol_1)).arr[idx].mat2x4_f32; float2x4 const mat2x4_f32 = (*(tint_symbol_1)).arr[idx].mat2x4_f32;
float3x2 const mat3x2_f32 = (*(tint_symbol_1)).arr[idx].mat3x2_f32; float3x2 const mat3x2_f32 = (*(tint_symbol_1)).arr[idx].mat3x2_f32;
float3x3 const mat3x3_f32 = (*(tint_symbol_1)).arr[idx].mat3x3_f32; float3x3 const mat3x3_f32 = tint_unpack_vec3_in_composite_1((*(tint_symbol_1)).arr[idx].mat3x3_f32);
float3x4 const mat3x4_f32 = (*(tint_symbol_1)).arr[idx].mat3x4_f32; float3x4 const mat3x4_f32 = (*(tint_symbol_1)).arr[idx].mat3x4_f32;
float4x2 const mat4x2_f32 = (*(tint_symbol_1)).arr[idx].mat4x2_f32; float4x2 const mat4x2_f32 = (*(tint_symbol_1)).arr[idx].mat4x2_f32;
float4x3 const mat4x3_f32 = (*(tint_symbol_1)).arr[idx].mat4x3_f32; float4x3 const mat4x3_f32 = tint_unpack_vec3_in_composite_2((*(tint_symbol_1)).arr[idx].mat4x3_f32);
float4x4 const mat4x4_f32 = (*(tint_symbol_1)).arr[idx].mat4x4_f32; float4x4 const mat4x4_f32 = (*(tint_symbol_1)).arr[idx].mat4x4_f32;
half2x2 const mat2x2_f16 = (*(tint_symbol_1)).arr[idx].mat2x2_f16; half2x2 const mat2x2_f16 = (*(tint_symbol_1)).arr[idx].mat2x2_f16;
half2x3 const mat2x3_f16 = (*(tint_symbol_1)).arr[idx].mat2x3_f16; half2x3 const mat2x3_f16 = tint_unpack_vec3_in_composite_3((*(tint_symbol_1)).arr[idx].mat2x3_f16);
half2x4 const mat2x4_f16 = (*(tint_symbol_1)).arr[idx].mat2x4_f16; half2x4 const mat2x4_f16 = (*(tint_symbol_1)).arr[idx].mat2x4_f16;
half3x2 const mat3x2_f16 = (*(tint_symbol_1)).arr[idx].mat3x2_f16; half3x2 const mat3x2_f16 = (*(tint_symbol_1)).arr[idx].mat3x2_f16;
half3x3 const mat3x3_f16 = (*(tint_symbol_1)).arr[idx].mat3x3_f16; half3x3 const mat3x3_f16 = tint_unpack_vec3_in_composite_4((*(tint_symbol_1)).arr[idx].mat3x3_f16);
half3x4 const mat3x4_f16 = (*(tint_symbol_1)).arr[idx].mat3x4_f16; half3x4 const mat3x4_f16 = (*(tint_symbol_1)).arr[idx].mat3x4_f16;
half4x2 const mat4x2_f16 = (*(tint_symbol_1)).arr[idx].mat4x2_f16; half4x2 const mat4x2_f16 = (*(tint_symbol_1)).arr[idx].mat4x2_f16;
half4x3 const mat4x3_f16 = (*(tint_symbol_1)).arr[idx].mat4x3_f16; half4x3 const mat4x3_f16 = tint_unpack_vec3_in_composite_5((*(tint_symbol_1)).arr[idx].mat4x3_f16);
half4x4 const mat4x4_f16 = (*(tint_symbol_1)).arr[idx].mat4x4_f16; half4x4 const mat4x4_f16 = (*(tint_symbol_1)).arr[idx].mat4x4_f16;
tint_array<float3, 2> const arr2_vec3_f32 = (*(tint_symbol_1)).arr[idx].arr2_vec3_f32; tint_array<float3, 2> const arr2_vec3_f32 = tint_unpack_vec3_in_composite_6((*(tint_symbol_1)).arr[idx].arr2_vec3_f32);
tint_array<half4x2, 2> const arr2_mat4x2_f16 = (*(tint_symbol_1)).arr[idx].arr2_mat4x2_f16; tint_array<half4x2, 2> const arr2_mat4x2_f16 = (*(tint_symbol_1)).arr[idx].arr2_mat4x2_f16;
} }
kernel void tint_symbol(const device S* tint_symbol_2 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) { kernel void tint_symbol(const device S_tint_packed_vec3* tint_symbol_2 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) {
tint_symbol_inner(idx, tint_symbol_2); tint_symbol_inner(idx, tint_symbol_2);
return; return;
} }

View File

@ -14,75 +14,109 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct Inner { struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
struct Inner_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ int scalar_i32; /* 0x0004 */ int scalar_i32;
/* 0x0008 */ uint scalar_u32; /* 0x0008 */ uint scalar_u32;
/* 0x000c */ tint_array<int8_t, 4> tint_pad; /* 0x000c */ tint_array<int8_t, 4> tint_pad_1;
/* 0x0010 */ float2 vec2_f32; /* 0x0010 */ float2 vec2_f32;
/* 0x0018 */ int2 vec2_i32; /* 0x0018 */ int2 vec2_i32;
/* 0x0020 */ uint2 vec2_u32; /* 0x0020 */ uint2 vec2_u32;
/* 0x0028 */ tint_array<int8_t, 8> tint_pad_1; /* 0x0028 */ tint_array<int8_t, 8> tint_pad_2;
/* 0x0030 */ packed_float3 vec3_f32; /* 0x0030 */ packed_float3 vec3_f32;
/* 0x003c */ tint_array<int8_t, 4> tint_pad_2; /* 0x003c */ tint_array<int8_t, 4> tint_pad_3;
/* 0x0040 */ packed_int3 vec3_i32; /* 0x0040 */ packed_int3 vec3_i32;
/* 0x004c */ tint_array<int8_t, 4> tint_pad_3; /* 0x004c */ tint_array<int8_t, 4> tint_pad_4;
/* 0x0050 */ packed_uint3 vec3_u32; /* 0x0050 */ packed_uint3 vec3_u32;
/* 0x005c */ tint_array<int8_t, 4> tint_pad_4; /* 0x005c */ tint_array<int8_t, 4> tint_pad_5;
/* 0x0060 */ float4 vec4_f32; /* 0x0060 */ float4 vec4_f32;
/* 0x0070 */ int4 vec4_i32; /* 0x0070 */ int4 vec4_i32;
/* 0x0080 */ uint4 vec4_u32; /* 0x0080 */ uint4 vec4_u32;
/* 0x0090 */ float2x2 mat2x2_f32; /* 0x0090 */ float2x2 mat2x2_f32;
/* 0x00a0 */ float2x3 mat2x3_f32; /* 0x00a0 */ tint_array<tint_packed_vec3_f32_array_element, 2> mat2x3_f32;
/* 0x00c0 */ float2x4 mat2x4_f32; /* 0x00c0 */ float2x4 mat2x4_f32;
/* 0x00e0 */ float3x2 mat3x2_f32; /* 0x00e0 */ float3x2 mat3x2_f32;
/* 0x00f8 */ tint_array<int8_t, 8> tint_pad_5; /* 0x00f8 */ tint_array<int8_t, 8> tint_pad_6;
/* 0x0100 */ float3x3 mat3x3_f32; /* 0x0100 */ tint_array<tint_packed_vec3_f32_array_element, 3> mat3x3_f32;
/* 0x0130 */ float3x4 mat3x4_f32; /* 0x0130 */ float3x4 mat3x4_f32;
/* 0x0160 */ float4x2 mat4x2_f32; /* 0x0160 */ float4x2 mat4x2_f32;
/* 0x0180 */ float4x3 mat4x3_f32; /* 0x0180 */ tint_array<tint_packed_vec3_f32_array_element, 4> mat4x3_f32;
/* 0x01c0 */ float4x4 mat4x4_f32; /* 0x01c0 */ float4x4 mat4x4_f32;
/* 0x0200 */ tint_array<float3, 2> arr2_vec3_f32; /* 0x0200 */ tint_array<tint_packed_vec3_f32_array_element, 2> arr2_vec3_f32;
};
struct S_tint_packed_vec3 {
/* 0x0000 */ tint_array<Inner_tint_packed_vec3, 1> arr;
};
struct Inner {
float scalar_f32;
int scalar_i32;
uint scalar_u32;
float2 vec2_f32;
int2 vec2_i32;
uint2 vec2_u32;
float3 vec3_f32;
int3 vec3_i32;
uint3 vec3_u32;
float4 vec4_f32;
int4 vec4_i32;
uint4 vec4_u32;
float2x2 mat2x2_f32;
float2x3 mat2x3_f32;
float2x4 mat2x4_f32;
float3x2 mat3x2_f32;
float3x3 mat3x3_f32;
float3x4 mat3x4_f32;
float4x2 mat4x2_f32;
float4x3 mat4x3_f32;
float4x4 mat4x4_f32;
tint_array<float3, 2> arr2_vec3_f32;
}; };
struct S { struct S {
/* 0x0000 */ tint_array<Inner, 1> arr; tint_array<Inner, 1> arr;
}; };
void assign_and_preserve_padding(device float2x3* const dest, float2x3 value) { void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, float2x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_float3(value[1u]);
} }
void assign_and_preserve_padding_1(device float3x3* const dest, float3x3 value) { void assign_and_preserve_padding_1(device tint_array<tint_packed_vec3_f32_array_element, 3>* const dest, float3x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_float3(value[1u]);
(*(dest))[2u] = value[2u]; (*(dest))[2u].elements = packed_float3(value[2u]);
} }
void assign_and_preserve_padding_2(device float4x3* const dest, float4x3 value) { void assign_and_preserve_padding_2(device tint_array<tint_packed_vec3_f32_array_element, 4>* const dest, float4x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_float3(value[1u]);
(*(dest))[2u] = value[2u]; (*(dest))[2u].elements = packed_float3(value[2u]);
(*(dest))[3u] = value[3u]; (*(dest))[3u].elements = packed_float3(value[3u]);
} }
void assign_and_preserve_padding_3(device tint_array<float3, 2>* const dest, tint_array<float3, 2> value) { void assign_and_preserve_padding_3(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
for(uint i = 0u; (i < 2u); i = (i + 1u)) { for(uint i = 0u; (i < 2u); i = (i + 1u)) {
(*(dest))[i] = value[i]; (*(dest))[i].elements = packed_float3(value[i]);
} }
} }
void tint_symbol_inner(uint idx, device S* const tint_symbol_2) { void tint_symbol_inner(uint idx, device S_tint_packed_vec3* const tint_symbol_2) {
(*(tint_symbol_2)).arr[idx].scalar_f32 = 0.0f; (*(tint_symbol_2)).arr[idx].scalar_f32 = 0.0f;
(*(tint_symbol_2)).arr[idx].scalar_i32 = 0; (*(tint_symbol_2)).arr[idx].scalar_i32 = 0;
(*(tint_symbol_2)).arr[idx].scalar_u32 = 0u; (*(tint_symbol_2)).arr[idx].scalar_u32 = 0u;
(*(tint_symbol_2)).arr[idx].vec2_f32 = float2(0.0f); (*(tint_symbol_2)).arr[idx].vec2_f32 = float2(0.0f);
(*(tint_symbol_2)).arr[idx].vec2_i32 = int2(0); (*(tint_symbol_2)).arr[idx].vec2_i32 = int2(0);
(*(tint_symbol_2)).arr[idx].vec2_u32 = uint2(0u); (*(tint_symbol_2)).arr[idx].vec2_u32 = uint2(0u);
(*(tint_symbol_2)).arr[idx].vec3_f32 = float3(0.0f); (*(tint_symbol_2)).arr[idx].vec3_f32 = packed_float3(0.0f);
(*(tint_symbol_2)).arr[idx].vec3_i32 = int3(0); (*(tint_symbol_2)).arr[idx].vec3_i32 = packed_int3(0);
(*(tint_symbol_2)).arr[idx].vec3_u32 = uint3(0u); (*(tint_symbol_2)).arr[idx].vec3_u32 = packed_uint3(0u);
(*(tint_symbol_2)).arr[idx].vec4_f32 = float4(0.0f); (*(tint_symbol_2)).arr[idx].vec4_f32 = float4(0.0f);
(*(tint_symbol_2)).arr[idx].vec4_i32 = int4(0); (*(tint_symbol_2)).arr[idx].vec4_i32 = int4(0);
(*(tint_symbol_2)).arr[idx].vec4_u32 = uint4(0u); (*(tint_symbol_2)).arr[idx].vec4_u32 = uint4(0u);
@ -99,7 +133,7 @@ void tint_symbol_inner(uint idx, device S* const tint_symbol_2) {
assign_and_preserve_padding_3(&((*(tint_symbol_2)).arr[idx].arr2_vec3_f32), tint_symbol_1); assign_and_preserve_padding_3(&((*(tint_symbol_2)).arr[idx].arr2_vec3_f32), tint_symbol_1);
} }
kernel void tint_symbol(device S* tint_symbol_3 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) { kernel void tint_symbol(device S_tint_packed_vec3* tint_symbol_3 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) {
tint_symbol_inner(idx, tint_symbol_3); tint_symbol_inner(idx, tint_symbol_3);
return; return;
} }

View File

@ -14,102 +14,155 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct Inner { struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad_1;
};
struct Inner_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ int scalar_i32; /* 0x0004 */ int scalar_i32;
/* 0x0008 */ uint scalar_u32; /* 0x0008 */ uint scalar_u32;
/* 0x000c */ half scalar_f16; /* 0x000c */ half scalar_f16;
/* 0x000e */ tint_array<int8_t, 2> tint_pad; /* 0x000e */ tint_array<int8_t, 2> tint_pad_2;
/* 0x0010 */ float2 vec2_f32; /* 0x0010 */ float2 vec2_f32;
/* 0x0018 */ int2 vec2_i32; /* 0x0018 */ int2 vec2_i32;
/* 0x0020 */ uint2 vec2_u32; /* 0x0020 */ uint2 vec2_u32;
/* 0x0028 */ half2 vec2_f16; /* 0x0028 */ half2 vec2_f16;
/* 0x002c */ tint_array<int8_t, 4> tint_pad_1; /* 0x002c */ tint_array<int8_t, 4> tint_pad_3;
/* 0x0030 */ packed_float3 vec3_f32; /* 0x0030 */ packed_float3 vec3_f32;
/* 0x003c */ tint_array<int8_t, 4> tint_pad_2; /* 0x003c */ tint_array<int8_t, 4> tint_pad_4;
/* 0x0040 */ packed_int3 vec3_i32; /* 0x0040 */ packed_int3 vec3_i32;
/* 0x004c */ tint_array<int8_t, 4> tint_pad_3; /* 0x004c */ tint_array<int8_t, 4> tint_pad_5;
/* 0x0050 */ packed_uint3 vec3_u32; /* 0x0050 */ packed_uint3 vec3_u32;
/* 0x005c */ tint_array<int8_t, 4> tint_pad_4; /* 0x005c */ tint_array<int8_t, 4> tint_pad_6;
/* 0x0060 */ packed_half3 vec3_f16; /* 0x0060 */ packed_half3 vec3_f16;
/* 0x0066 */ tint_array<int8_t, 10> tint_pad_5; /* 0x0066 */ tint_array<int8_t, 10> tint_pad_7;
/* 0x0070 */ float4 vec4_f32; /* 0x0070 */ float4 vec4_f32;
/* 0x0080 */ int4 vec4_i32; /* 0x0080 */ int4 vec4_i32;
/* 0x0090 */ uint4 vec4_u32; /* 0x0090 */ uint4 vec4_u32;
/* 0x00a0 */ half4 vec4_f16; /* 0x00a0 */ half4 vec4_f16;
/* 0x00a8 */ float2x2 mat2x2_f32; /* 0x00a8 */ float2x2 mat2x2_f32;
/* 0x00b8 */ tint_array<int8_t, 8> tint_pad_6; /* 0x00b8 */ tint_array<int8_t, 8> tint_pad_8;
/* 0x00c0 */ float2x3 mat2x3_f32; /* 0x00c0 */ tint_array<tint_packed_vec3_f32_array_element, 2> mat2x3_f32;
/* 0x00e0 */ float2x4 mat2x4_f32; /* 0x00e0 */ float2x4 mat2x4_f32;
/* 0x0100 */ float3x2 mat3x2_f32; /* 0x0100 */ float3x2 mat3x2_f32;
/* 0x0118 */ tint_array<int8_t, 8> tint_pad_7; /* 0x0118 */ tint_array<int8_t, 8> tint_pad_9;
/* 0x0120 */ float3x3 mat3x3_f32; /* 0x0120 */ tint_array<tint_packed_vec3_f32_array_element, 3> mat3x3_f32;
/* 0x0150 */ float3x4 mat3x4_f32; /* 0x0150 */ float3x4 mat3x4_f32;
/* 0x0180 */ float4x2 mat4x2_f32; /* 0x0180 */ float4x2 mat4x2_f32;
/* 0x01a0 */ float4x3 mat4x3_f32; /* 0x01a0 */ tint_array<tint_packed_vec3_f32_array_element, 4> mat4x3_f32;
/* 0x01e0 */ float4x4 mat4x4_f32; /* 0x01e0 */ float4x4 mat4x4_f32;
/* 0x0220 */ half2x2 mat2x2_f16; /* 0x0220 */ half2x2 mat2x2_f16;
/* 0x0228 */ half2x3 mat2x3_f16; /* 0x0228 */ tint_array<tint_packed_vec3_f16_array_element, 2> mat2x3_f16;
/* 0x0238 */ half2x4 mat2x4_f16; /* 0x0238 */ half2x4 mat2x4_f16;
/* 0x0248 */ half3x2 mat3x2_f16; /* 0x0248 */ half3x2 mat3x2_f16;
/* 0x0254 */ tint_array<int8_t, 4> tint_pad_8; /* 0x0254 */ tint_array<int8_t, 4> tint_pad_10;
/* 0x0258 */ half3x3 mat3x3_f16; /* 0x0258 */ tint_array<tint_packed_vec3_f16_array_element, 3> mat3x3_f16;
/* 0x0270 */ half3x4 mat3x4_f16; /* 0x0270 */ half3x4 mat3x4_f16;
/* 0x0288 */ half4x2 mat4x2_f16; /* 0x0288 */ half4x2 mat4x2_f16;
/* 0x0298 */ half4x3 mat4x3_f16; /* 0x0298 */ tint_array<tint_packed_vec3_f16_array_element, 4> mat4x3_f16;
/* 0x02b8 */ half4x4 mat4x4_f16; /* 0x02b8 */ half4x4 mat4x4_f16;
/* 0x02d8 */ tint_array<int8_t, 8> tint_pad_9; /* 0x02d8 */ tint_array<int8_t, 8> tint_pad_11;
/* 0x02e0 */ tint_array<float3, 2> arr2_vec3_f32; /* 0x02e0 */ tint_array<tint_packed_vec3_f32_array_element, 2> arr2_vec3_f32;
/* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16; /* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16;
}; };
struct S { struct S_tint_packed_vec3 {
/* 0x0000 */ tint_array<Inner, 1> arr; /* 0x0000 */ tint_array<Inner_tint_packed_vec3, 1> arr;
}; };
void assign_and_preserve_padding(device float2x3* const dest, float2x3 value) { struct Inner {
(*(dest))[0u] = value[0u]; float scalar_f32;
(*(dest))[1u] = value[1u]; int scalar_i32;
uint scalar_u32;
half scalar_f16;
float2 vec2_f32;
int2 vec2_i32;
uint2 vec2_u32;
half2 vec2_f16;
float3 vec3_f32;
int3 vec3_i32;
uint3 vec3_u32;
half3 vec3_f16;
float4 vec4_f32;
int4 vec4_i32;
uint4 vec4_u32;
half4 vec4_f16;
float2x2 mat2x2_f32;
float2x3 mat2x3_f32;
float2x4 mat2x4_f32;
float3x2 mat3x2_f32;
float3x3 mat3x3_f32;
float3x4 mat3x4_f32;
float4x2 mat4x2_f32;
float4x3 mat4x3_f32;
float4x4 mat4x4_f32;
half2x2 mat2x2_f16;
half2x3 mat2x3_f16;
half2x4 mat2x4_f16;
half3x2 mat3x2_f16;
half3x3 mat3x3_f16;
half3x4 mat3x4_f16;
half4x2 mat4x2_f16;
half4x3 mat4x3_f16;
half4x4 mat4x4_f16;
tint_array<float3, 2> arr2_vec3_f32;
tint_array<half4x2, 2> arr2_mat4x2_f16;
};
struct S {
tint_array<Inner, 1> arr;
};
void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, float2x3 value) {
(*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u].elements = packed_float3(value[1u]);
} }
void assign_and_preserve_padding_1(device float3x3* const dest, float3x3 value) { void assign_and_preserve_padding_1(device tint_array<tint_packed_vec3_f32_array_element, 3>* const dest, float3x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_float3(value[1u]);
(*(dest))[2u] = value[2u]; (*(dest))[2u].elements = packed_float3(value[2u]);
} }
void assign_and_preserve_padding_2(device float4x3* const dest, float4x3 value) { void assign_and_preserve_padding_2(device tint_array<tint_packed_vec3_f32_array_element, 4>* const dest, float4x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_float3(value[1u]);
(*(dest))[2u] = value[2u]; (*(dest))[2u].elements = packed_float3(value[2u]);
(*(dest))[3u] = value[3u]; (*(dest))[3u].elements = packed_float3(value[3u]);
} }
void assign_and_preserve_padding_3(device half2x3* const dest, half2x3 value) { void assign_and_preserve_padding_3(device tint_array<tint_packed_vec3_f16_array_element, 2>* const dest, half2x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_half3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_half3(value[1u]);
} }
void assign_and_preserve_padding_4(device half3x3* const dest, half3x3 value) { void assign_and_preserve_padding_4(device tint_array<tint_packed_vec3_f16_array_element, 3>* const dest, half3x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_half3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_half3(value[1u]);
(*(dest))[2u] = value[2u]; (*(dest))[2u].elements = packed_half3(value[2u]);
} }
void assign_and_preserve_padding_5(device half4x3* const dest, half4x3 value) { void assign_and_preserve_padding_5(device tint_array<tint_packed_vec3_f16_array_element, 4>* const dest, half4x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_half3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_half3(value[1u]);
(*(dest))[2u] = value[2u]; (*(dest))[2u].elements = packed_half3(value[2u]);
(*(dest))[3u] = value[3u]; (*(dest))[3u].elements = packed_half3(value[3u]);
} }
void assign_and_preserve_padding_6(device tint_array<float3, 2>* const dest, tint_array<float3, 2> value) { void assign_and_preserve_padding_6(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
for(uint i = 0u; (i < 2u); i = (i + 1u)) { for(uint i = 0u; (i < 2u); i = (i + 1u)) {
(*(dest))[i] = value[i]; (*(dest))[i].elements = packed_float3(value[i]);
} }
} }
void tint_symbol_inner(uint idx, device S* const tint_symbol_3) { void tint_symbol_inner(uint idx, device S_tint_packed_vec3* const tint_symbol_3) {
(*(tint_symbol_3)).arr[idx].scalar_f32 = 0.0f; (*(tint_symbol_3)).arr[idx].scalar_f32 = 0.0f;
(*(tint_symbol_3)).arr[idx].scalar_i32 = 0; (*(tint_symbol_3)).arr[idx].scalar_i32 = 0;
(*(tint_symbol_3)).arr[idx].scalar_u32 = 0u; (*(tint_symbol_3)).arr[idx].scalar_u32 = 0u;
@ -118,10 +171,10 @@ void tint_symbol_inner(uint idx, device S* const tint_symbol_3) {
(*(tint_symbol_3)).arr[idx].vec2_i32 = int2(0); (*(tint_symbol_3)).arr[idx].vec2_i32 = int2(0);
(*(tint_symbol_3)).arr[idx].vec2_u32 = uint2(0u); (*(tint_symbol_3)).arr[idx].vec2_u32 = uint2(0u);
(*(tint_symbol_3)).arr[idx].vec2_f16 = half2(0.0h); (*(tint_symbol_3)).arr[idx].vec2_f16 = half2(0.0h);
(*(tint_symbol_3)).arr[idx].vec3_f32 = float3(0.0f); (*(tint_symbol_3)).arr[idx].vec3_f32 = packed_float3(0.0f);
(*(tint_symbol_3)).arr[idx].vec3_i32 = int3(0); (*(tint_symbol_3)).arr[idx].vec3_i32 = packed_int3(0);
(*(tint_symbol_3)).arr[idx].vec3_u32 = uint3(0u); (*(tint_symbol_3)).arr[idx].vec3_u32 = packed_uint3(0u);
(*(tint_symbol_3)).arr[idx].vec3_f16 = half3(0.0h); (*(tint_symbol_3)).arr[idx].vec3_f16 = packed_half3(0.0h);
(*(tint_symbol_3)).arr[idx].vec4_f32 = float4(0.0f); (*(tint_symbol_3)).arr[idx].vec4_f32 = float4(0.0f);
(*(tint_symbol_3)).arr[idx].vec4_i32 = int4(0); (*(tint_symbol_3)).arr[idx].vec4_i32 = int4(0);
(*(tint_symbol_3)).arr[idx].vec4_u32 = uint4(0u); (*(tint_symbol_3)).arr[idx].vec4_u32 = uint4(0u);
@ -150,7 +203,7 @@ void tint_symbol_inner(uint idx, device S* const tint_symbol_3) {
(*(tint_symbol_3)).arr[idx].arr2_mat4x2_f16 = tint_symbol_2; (*(tint_symbol_3)).arr[idx].arr2_mat4x2_f16 = tint_symbol_2;
} }
kernel void tint_symbol(device S* tint_symbol_4 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) { kernel void tint_symbol(device S_tint_packed_vec3* tint_symbol_4 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) {
tint_symbol_inner(idx, tint_symbol_4); tint_symbol_inner(idx, tint_symbol_4);
return; return;
} }

View File

@ -14,46 +14,110 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
struct Inner { struct Inner {
/* 0x0000 */ int scalar_i32; /* 0x0000 */ int scalar_i32;
/* 0x0004 */ float scalar_f32; /* 0x0004 */ float scalar_f32;
}; };
struct S { struct S_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ int scalar_i32; /* 0x0004 */ int scalar_i32;
/* 0x0008 */ uint scalar_u32; /* 0x0008 */ uint scalar_u32;
/* 0x000c */ tint_array<int8_t, 4> tint_pad; /* 0x000c */ tint_array<int8_t, 4> tint_pad_1;
/* 0x0010 */ float2 vec2_f32; /* 0x0010 */ float2 vec2_f32;
/* 0x0018 */ int2 vec2_i32; /* 0x0018 */ int2 vec2_i32;
/* 0x0020 */ uint2 vec2_u32; /* 0x0020 */ uint2 vec2_u32;
/* 0x0028 */ tint_array<int8_t, 8> tint_pad_1; /* 0x0028 */ tint_array<int8_t, 8> tint_pad_2;
/* 0x0030 */ packed_float3 vec3_f32; /* 0x0030 */ packed_float3 vec3_f32;
/* 0x003c */ tint_array<int8_t, 4> tint_pad_2; /* 0x003c */ tint_array<int8_t, 4> tint_pad_3;
/* 0x0040 */ packed_int3 vec3_i32; /* 0x0040 */ packed_int3 vec3_i32;
/* 0x004c */ tint_array<int8_t, 4> tint_pad_3; /* 0x004c */ tint_array<int8_t, 4> tint_pad_4;
/* 0x0050 */ packed_uint3 vec3_u32; /* 0x0050 */ packed_uint3 vec3_u32;
/* 0x005c */ tint_array<int8_t, 4> tint_pad_4; /* 0x005c */ tint_array<int8_t, 4> tint_pad_5;
/* 0x0060 */ float4 vec4_f32; /* 0x0060 */ float4 vec4_f32;
/* 0x0070 */ int4 vec4_i32; /* 0x0070 */ int4 vec4_i32;
/* 0x0080 */ uint4 vec4_u32; /* 0x0080 */ uint4 vec4_u32;
/* 0x0090 */ float2x2 mat2x2_f32; /* 0x0090 */ float2x2 mat2x2_f32;
/* 0x00a0 */ float2x3 mat2x3_f32; /* 0x00a0 */ tint_array<tint_packed_vec3_f32_array_element, 2> mat2x3_f32;
/* 0x00c0 */ float2x4 mat2x4_f32; /* 0x00c0 */ float2x4 mat2x4_f32;
/* 0x00e0 */ float3x2 mat3x2_f32; /* 0x00e0 */ float3x2 mat3x2_f32;
/* 0x00f8 */ tint_array<int8_t, 8> tint_pad_5; /* 0x00f8 */ tint_array<int8_t, 8> tint_pad_6;
/* 0x0100 */ float3x3 mat3x3_f32; /* 0x0100 */ tint_array<tint_packed_vec3_f32_array_element, 3> mat3x3_f32;
/* 0x0130 */ float3x4 mat3x4_f32; /* 0x0130 */ float3x4 mat3x4_f32;
/* 0x0160 */ float4x2 mat4x2_f32; /* 0x0160 */ float4x2 mat4x2_f32;
/* 0x0180 */ float4x3 mat4x3_f32; /* 0x0180 */ tint_array<tint_packed_vec3_f32_array_element, 4> mat4x3_f32;
/* 0x01c0 */ float4x4 mat4x4_f32; /* 0x01c0 */ float4x4 mat4x4_f32;
/* 0x0200 */ tint_array<float3, 2> arr2_vec3_f32; /* 0x0200 */ tint_array<tint_packed_vec3_f32_array_element, 2> arr2_vec3_f32;
/* 0x0220 */ Inner struct_inner; /* 0x0220 */ Inner struct_inner;
/* 0x0228 */ tint_array<Inner, 4> array_struct_inner; /* 0x0228 */ tint_array<Inner, 4> array_struct_inner;
/* 0x0248 */ tint_array<int8_t, 8> tint_pad_6; /* 0x0248 */ tint_array<int8_t, 8> tint_pad_7;
}; };
kernel void tint_symbol(const device S* tint_symbol_1 [[buffer(0)]]) { float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
float4x3 result = float4x3(0.0f);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
tint_array<float3, 2> result = {};
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
struct S {
float scalar_f32;
int scalar_i32;
uint scalar_u32;
float2 vec2_f32;
int2 vec2_i32;
uint2 vec2_u32;
float3 vec3_f32;
int3 vec3_i32;
uint3 vec3_u32;
float4 vec4_f32;
int4 vec4_i32;
uint4 vec4_u32;
float2x2 mat2x2_f32;
float2x3 mat2x3_f32;
float2x4 mat2x4_f32;
float3x2 mat3x2_f32;
float3x3 mat3x3_f32;
float3x4 mat3x4_f32;
float4x2 mat4x2_f32;
float4x3 mat4x3_f32;
float4x4 mat4x4_f32;
tint_array<float3, 2> arr2_vec3_f32;
Inner struct_inner;
tint_array<Inner, 4> array_struct_inner;
};
kernel void tint_symbol(const device S_tint_packed_vec3* tint_symbol_1 [[buffer(0)]]) {
float const scalar_f32 = (*(tint_symbol_1)).scalar_f32; float const scalar_f32 = (*(tint_symbol_1)).scalar_f32;
int const scalar_i32 = (*(tint_symbol_1)).scalar_i32; int const scalar_i32 = (*(tint_symbol_1)).scalar_i32;
uint const scalar_u32 = (*(tint_symbol_1)).scalar_u32; uint const scalar_u32 = (*(tint_symbol_1)).scalar_u32;
@ -67,15 +131,15 @@ kernel void tint_symbol(const device S* tint_symbol_1 [[buffer(0)]]) {
int4 const vec4_i32 = (*(tint_symbol_1)).vec4_i32; int4 const vec4_i32 = (*(tint_symbol_1)).vec4_i32;
uint4 const vec4_u32 = (*(tint_symbol_1)).vec4_u32; uint4 const vec4_u32 = (*(tint_symbol_1)).vec4_u32;
float2x2 const mat2x2_f32 = (*(tint_symbol_1)).mat2x2_f32; float2x2 const mat2x2_f32 = (*(tint_symbol_1)).mat2x2_f32;
float2x3 const mat2x3_f32 = (*(tint_symbol_1)).mat2x3_f32; float2x3 const mat2x3_f32 = tint_unpack_vec3_in_composite((*(tint_symbol_1)).mat2x3_f32);
float2x4 const mat2x4_f32 = (*(tint_symbol_1)).mat2x4_f32; float2x4 const mat2x4_f32 = (*(tint_symbol_1)).mat2x4_f32;
float3x2 const mat3x2_f32 = (*(tint_symbol_1)).mat3x2_f32; float3x2 const mat3x2_f32 = (*(tint_symbol_1)).mat3x2_f32;
float3x3 const mat3x3_f32 = (*(tint_symbol_1)).mat3x3_f32; float3x3 const mat3x3_f32 = tint_unpack_vec3_in_composite_1((*(tint_symbol_1)).mat3x3_f32);
float3x4 const mat3x4_f32 = (*(tint_symbol_1)).mat3x4_f32; float3x4 const mat3x4_f32 = (*(tint_symbol_1)).mat3x4_f32;
float4x2 const mat4x2_f32 = (*(tint_symbol_1)).mat4x2_f32; float4x2 const mat4x2_f32 = (*(tint_symbol_1)).mat4x2_f32;
float4x3 const mat4x3_f32 = (*(tint_symbol_1)).mat4x3_f32; float4x3 const mat4x3_f32 = tint_unpack_vec3_in_composite_2((*(tint_symbol_1)).mat4x3_f32);
float4x4 const mat4x4_f32 = (*(tint_symbol_1)).mat4x4_f32; float4x4 const mat4x4_f32 = (*(tint_symbol_1)).mat4x4_f32;
tint_array<float3, 2> const arr2_vec3_f32 = (*(tint_symbol_1)).arr2_vec3_f32; tint_array<float3, 2> const arr2_vec3_f32 = tint_unpack_vec3_in_composite_3((*(tint_symbol_1)).arr2_vec3_f32);
Inner const struct_inner = (*(tint_symbol_1)).struct_inner; Inner const struct_inner = (*(tint_symbol_1)).struct_inner;
tint_array<Inner, 4> const array_struct_inner = (*(tint_symbol_1)).array_struct_inner; tint_array<Inner, 4> const array_struct_inner = (*(tint_symbol_1)).array_struct_inner;
return; return;

View File

@ -14,66 +14,173 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad_1;
};
struct Inner { struct Inner {
/* 0x0000 */ int scalar_i32; /* 0x0000 */ int scalar_i32;
/* 0x0004 */ float scalar_f32; /* 0x0004 */ float scalar_f32;
/* 0x0008 */ half scalar_f16; /* 0x0008 */ half scalar_f16;
/* 0x000a */ tint_array<int8_t, 2> tint_pad; /* 0x000a */ tint_array<int8_t, 2> tint_pad_2;
}; };
struct S { struct S_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ int scalar_i32; /* 0x0004 */ int scalar_i32;
/* 0x0008 */ uint scalar_u32; /* 0x0008 */ uint scalar_u32;
/* 0x000c */ half scalar_f16; /* 0x000c */ half scalar_f16;
/* 0x000e */ tint_array<int8_t, 2> tint_pad_1; /* 0x000e */ tint_array<int8_t, 2> tint_pad_3;
/* 0x0010 */ float2 vec2_f32; /* 0x0010 */ float2 vec2_f32;
/* 0x0018 */ int2 vec2_i32; /* 0x0018 */ int2 vec2_i32;
/* 0x0020 */ uint2 vec2_u32; /* 0x0020 */ uint2 vec2_u32;
/* 0x0028 */ half2 vec2_f16; /* 0x0028 */ half2 vec2_f16;
/* 0x002c */ tint_array<int8_t, 4> tint_pad_2; /* 0x002c */ tint_array<int8_t, 4> tint_pad_4;
/* 0x0030 */ packed_float3 vec3_f32; /* 0x0030 */ packed_float3 vec3_f32;
/* 0x003c */ tint_array<int8_t, 4> tint_pad_3; /* 0x003c */ tint_array<int8_t, 4> tint_pad_5;
/* 0x0040 */ packed_int3 vec3_i32; /* 0x0040 */ packed_int3 vec3_i32;
/* 0x004c */ tint_array<int8_t, 4> tint_pad_4; /* 0x004c */ tint_array<int8_t, 4> tint_pad_6;
/* 0x0050 */ packed_uint3 vec3_u32; /* 0x0050 */ packed_uint3 vec3_u32;
/* 0x005c */ tint_array<int8_t, 4> tint_pad_5; /* 0x005c */ tint_array<int8_t, 4> tint_pad_7;
/* 0x0060 */ packed_half3 vec3_f16; /* 0x0060 */ packed_half3 vec3_f16;
/* 0x0066 */ tint_array<int8_t, 10> tint_pad_6; /* 0x0066 */ tint_array<int8_t, 10> tint_pad_8;
/* 0x0070 */ float4 vec4_f32; /* 0x0070 */ float4 vec4_f32;
/* 0x0080 */ int4 vec4_i32; /* 0x0080 */ int4 vec4_i32;
/* 0x0090 */ uint4 vec4_u32; /* 0x0090 */ uint4 vec4_u32;
/* 0x00a0 */ half4 vec4_f16; /* 0x00a0 */ half4 vec4_f16;
/* 0x00a8 */ float2x2 mat2x2_f32; /* 0x00a8 */ float2x2 mat2x2_f32;
/* 0x00b8 */ tint_array<int8_t, 8> tint_pad_7; /* 0x00b8 */ tint_array<int8_t, 8> tint_pad_9;
/* 0x00c0 */ float2x3 mat2x3_f32; /* 0x00c0 */ tint_array<tint_packed_vec3_f32_array_element, 2> mat2x3_f32;
/* 0x00e0 */ float2x4 mat2x4_f32; /* 0x00e0 */ float2x4 mat2x4_f32;
/* 0x0100 */ float3x2 mat3x2_f32; /* 0x0100 */ float3x2 mat3x2_f32;
/* 0x0118 */ tint_array<int8_t, 8> tint_pad_8; /* 0x0118 */ tint_array<int8_t, 8> tint_pad_10;
/* 0x0120 */ float3x3 mat3x3_f32; /* 0x0120 */ tint_array<tint_packed_vec3_f32_array_element, 3> mat3x3_f32;
/* 0x0150 */ float3x4 mat3x4_f32; /* 0x0150 */ float3x4 mat3x4_f32;
/* 0x0180 */ float4x2 mat4x2_f32; /* 0x0180 */ float4x2 mat4x2_f32;
/* 0x01a0 */ float4x3 mat4x3_f32; /* 0x01a0 */ tint_array<tint_packed_vec3_f32_array_element, 4> mat4x3_f32;
/* 0x01e0 */ float4x4 mat4x4_f32; /* 0x01e0 */ float4x4 mat4x4_f32;
/* 0x0220 */ half2x2 mat2x2_f16; /* 0x0220 */ half2x2 mat2x2_f16;
/* 0x0228 */ half2x3 mat2x3_f16; /* 0x0228 */ tint_array<tint_packed_vec3_f16_array_element, 2> mat2x3_f16;
/* 0x0238 */ half2x4 mat2x4_f16; /* 0x0238 */ half2x4 mat2x4_f16;
/* 0x0248 */ half3x2 mat3x2_f16; /* 0x0248 */ half3x2 mat3x2_f16;
/* 0x0254 */ tint_array<int8_t, 4> tint_pad_9; /* 0x0254 */ tint_array<int8_t, 4> tint_pad_11;
/* 0x0258 */ half3x3 mat3x3_f16; /* 0x0258 */ tint_array<tint_packed_vec3_f16_array_element, 3> mat3x3_f16;
/* 0x0270 */ half3x4 mat3x4_f16; /* 0x0270 */ half3x4 mat3x4_f16;
/* 0x0288 */ half4x2 mat4x2_f16; /* 0x0288 */ half4x2 mat4x2_f16;
/* 0x0298 */ half4x3 mat4x3_f16; /* 0x0298 */ tint_array<tint_packed_vec3_f16_array_element, 4> mat4x3_f16;
/* 0x02b8 */ half4x4 mat4x4_f16; /* 0x02b8 */ half4x4 mat4x4_f16;
/* 0x02d8 */ tint_array<int8_t, 8> tint_pad_10; /* 0x02d8 */ tint_array<int8_t, 8> tint_pad_12;
/* 0x02e0 */ tint_array<float3, 2> arr2_vec3_f32; /* 0x02e0 */ tint_array<tint_packed_vec3_f32_array_element, 2> arr2_vec3_f32;
/* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16; /* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16;
/* 0x0320 */ Inner struct_inner; /* 0x0320 */ Inner struct_inner;
/* 0x032c */ tint_array<Inner, 4> array_struct_inner; /* 0x032c */ tint_array<Inner, 4> array_struct_inner;
/* 0x035c */ tint_array<int8_t, 4> tint_pad_11; /* 0x035c */ tint_array<int8_t, 4> tint_pad_13;
}; };
kernel void tint_symbol(const device S* tint_symbol_1 [[buffer(0)]]) { float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
float4x3 result = float4x3(0.0f);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
half2x3 tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
half2x3 result = half2x3(0.0h);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
half3x3 tint_unpack_vec3_in_composite_4(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
half3x3 result = half3x3(0.0h);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
half4x3 tint_unpack_vec3_in_composite_5(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
half4x3 result = half4x3(0.0h);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_6(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
tint_array<float3, 2> result = {};
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
struct S {
float scalar_f32;
int scalar_i32;
uint scalar_u32;
half scalar_f16;
float2 vec2_f32;
int2 vec2_i32;
uint2 vec2_u32;
half2 vec2_f16;
float3 vec3_f32;
int3 vec3_i32;
uint3 vec3_u32;
half3 vec3_f16;
float4 vec4_f32;
int4 vec4_i32;
uint4 vec4_u32;
half4 vec4_f16;
float2x2 mat2x2_f32;
float2x3 mat2x3_f32;
float2x4 mat2x4_f32;
float3x2 mat3x2_f32;
float3x3 mat3x3_f32;
float3x4 mat3x4_f32;
float4x2 mat4x2_f32;
float4x3 mat4x3_f32;
float4x4 mat4x4_f32;
half2x2 mat2x2_f16;
half2x3 mat2x3_f16;
half2x4 mat2x4_f16;
half3x2 mat3x2_f16;
half3x3 mat3x3_f16;
half3x4 mat3x4_f16;
half4x2 mat4x2_f16;
half4x3 mat4x3_f16;
half4x4 mat4x4_f16;
tint_array<float3, 2> arr2_vec3_f32;
tint_array<half4x2, 2> arr2_mat4x2_f16;
Inner struct_inner;
tint_array<Inner, 4> array_struct_inner;
};
kernel void tint_symbol(const device S_tint_packed_vec3* tint_symbol_1 [[buffer(0)]]) {
float const scalar_f32 = (*(tint_symbol_1)).scalar_f32; float const scalar_f32 = (*(tint_symbol_1)).scalar_f32;
int const scalar_i32 = (*(tint_symbol_1)).scalar_i32; int const scalar_i32 = (*(tint_symbol_1)).scalar_i32;
uint const scalar_u32 = (*(tint_symbol_1)).scalar_u32; uint const scalar_u32 = (*(tint_symbol_1)).scalar_u32;
@ -91,24 +198,24 @@ kernel void tint_symbol(const device S* tint_symbol_1 [[buffer(0)]]) {
uint4 const vec4_u32 = (*(tint_symbol_1)).vec4_u32; uint4 const vec4_u32 = (*(tint_symbol_1)).vec4_u32;
half4 const vec4_f16 = (*(tint_symbol_1)).vec4_f16; half4 const vec4_f16 = (*(tint_symbol_1)).vec4_f16;
float2x2 const mat2x2_f32 = (*(tint_symbol_1)).mat2x2_f32; float2x2 const mat2x2_f32 = (*(tint_symbol_1)).mat2x2_f32;
float2x3 const mat2x3_f32 = (*(tint_symbol_1)).mat2x3_f32; float2x3 const mat2x3_f32 = tint_unpack_vec3_in_composite((*(tint_symbol_1)).mat2x3_f32);
float2x4 const mat2x4_f32 = (*(tint_symbol_1)).mat2x4_f32; float2x4 const mat2x4_f32 = (*(tint_symbol_1)).mat2x4_f32;
float3x2 const mat3x2_f32 = (*(tint_symbol_1)).mat3x2_f32; float3x2 const mat3x2_f32 = (*(tint_symbol_1)).mat3x2_f32;
float3x3 const mat3x3_f32 = (*(tint_symbol_1)).mat3x3_f32; float3x3 const mat3x3_f32 = tint_unpack_vec3_in_composite_1((*(tint_symbol_1)).mat3x3_f32);
float3x4 const mat3x4_f32 = (*(tint_symbol_1)).mat3x4_f32; float3x4 const mat3x4_f32 = (*(tint_symbol_1)).mat3x4_f32;
float4x2 const mat4x2_f32 = (*(tint_symbol_1)).mat4x2_f32; float4x2 const mat4x2_f32 = (*(tint_symbol_1)).mat4x2_f32;
float4x3 const mat4x3_f32 = (*(tint_symbol_1)).mat4x3_f32; float4x3 const mat4x3_f32 = tint_unpack_vec3_in_composite_2((*(tint_symbol_1)).mat4x3_f32);
float4x4 const mat4x4_f32 = (*(tint_symbol_1)).mat4x4_f32; float4x4 const mat4x4_f32 = (*(tint_symbol_1)).mat4x4_f32;
half2x2 const mat2x2_f16 = (*(tint_symbol_1)).mat2x2_f16; half2x2 const mat2x2_f16 = (*(tint_symbol_1)).mat2x2_f16;
half2x3 const mat2x3_f16 = (*(tint_symbol_1)).mat2x3_f16; half2x3 const mat2x3_f16 = tint_unpack_vec3_in_composite_3((*(tint_symbol_1)).mat2x3_f16);
half2x4 const mat2x4_f16 = (*(tint_symbol_1)).mat2x4_f16; half2x4 const mat2x4_f16 = (*(tint_symbol_1)).mat2x4_f16;
half3x2 const mat3x2_f16 = (*(tint_symbol_1)).mat3x2_f16; half3x2 const mat3x2_f16 = (*(tint_symbol_1)).mat3x2_f16;
half3x3 const mat3x3_f16 = (*(tint_symbol_1)).mat3x3_f16; half3x3 const mat3x3_f16 = tint_unpack_vec3_in_composite_4((*(tint_symbol_1)).mat3x3_f16);
half3x4 const mat3x4_f16 = (*(tint_symbol_1)).mat3x4_f16; half3x4 const mat3x4_f16 = (*(tint_symbol_1)).mat3x4_f16;
half4x2 const mat4x2_f16 = (*(tint_symbol_1)).mat4x2_f16; half4x2 const mat4x2_f16 = (*(tint_symbol_1)).mat4x2_f16;
half4x3 const mat4x3_f16 = (*(tint_symbol_1)).mat4x3_f16; half4x3 const mat4x3_f16 = tint_unpack_vec3_in_composite_5((*(tint_symbol_1)).mat4x3_f16);
half4x4 const mat4x4_f16 = (*(tint_symbol_1)).mat4x4_f16; half4x4 const mat4x4_f16 = (*(tint_symbol_1)).mat4x4_f16;
tint_array<float3, 2> const arr2_vec3_f32 = (*(tint_symbol_1)).arr2_vec3_f32; tint_array<float3, 2> const arr2_vec3_f32 = tint_unpack_vec3_in_composite_6((*(tint_symbol_1)).arr2_vec3_f32);
tint_array<half4x2, 2> const arr2_mat4x2_f16 = (*(tint_symbol_1)).arr2_mat4x2_f16; tint_array<half4x2, 2> const arr2_mat4x2_f16 = (*(tint_symbol_1)).arr2_mat4x2_f16;
Inner const struct_inner = (*(tint_symbol_1)).struct_inner; Inner const struct_inner = (*(tint_symbol_1)).struct_inner;
tint_array<Inner, 4> const array_struct_inner = (*(tint_symbol_1)).array_struct_inner; tint_array<Inner, 4> const array_struct_inner = (*(tint_symbol_1)).array_struct_inner;

View File

@ -14,79 +14,111 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
struct Inner { struct Inner {
/* 0x0000 */ int scalar_i32; /* 0x0000 */ int scalar_i32;
/* 0x0004 */ float scalar_f32; /* 0x0004 */ float scalar_f32;
}; };
struct S { struct S_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ int scalar_i32; /* 0x0004 */ int scalar_i32;
/* 0x0008 */ uint scalar_u32; /* 0x0008 */ uint scalar_u32;
/* 0x000c */ tint_array<int8_t, 4> tint_pad; /* 0x000c */ tint_array<int8_t, 4> tint_pad_1;
/* 0x0010 */ float2 vec2_f32; /* 0x0010 */ float2 vec2_f32;
/* 0x0018 */ int2 vec2_i32; /* 0x0018 */ int2 vec2_i32;
/* 0x0020 */ uint2 vec2_u32; /* 0x0020 */ uint2 vec2_u32;
/* 0x0028 */ tint_array<int8_t, 8> tint_pad_1; /* 0x0028 */ tint_array<int8_t, 8> tint_pad_2;
/* 0x0030 */ packed_float3 vec3_f32; /* 0x0030 */ packed_float3 vec3_f32;
/* 0x003c */ tint_array<int8_t, 4> tint_pad_2; /* 0x003c */ tint_array<int8_t, 4> tint_pad_3;
/* 0x0040 */ packed_int3 vec3_i32; /* 0x0040 */ packed_int3 vec3_i32;
/* 0x004c */ tint_array<int8_t, 4> tint_pad_3; /* 0x004c */ tint_array<int8_t, 4> tint_pad_4;
/* 0x0050 */ packed_uint3 vec3_u32; /* 0x0050 */ packed_uint3 vec3_u32;
/* 0x005c */ tint_array<int8_t, 4> tint_pad_4; /* 0x005c */ tint_array<int8_t, 4> tint_pad_5;
/* 0x0060 */ float4 vec4_f32; /* 0x0060 */ float4 vec4_f32;
/* 0x0070 */ int4 vec4_i32; /* 0x0070 */ int4 vec4_i32;
/* 0x0080 */ uint4 vec4_u32; /* 0x0080 */ uint4 vec4_u32;
/* 0x0090 */ float2x2 mat2x2_f32; /* 0x0090 */ float2x2 mat2x2_f32;
/* 0x00a0 */ float2x3 mat2x3_f32; /* 0x00a0 */ tint_array<tint_packed_vec3_f32_array_element, 2> mat2x3_f32;
/* 0x00c0 */ float2x4 mat2x4_f32; /* 0x00c0 */ float2x4 mat2x4_f32;
/* 0x00e0 */ float3x2 mat3x2_f32; /* 0x00e0 */ float3x2 mat3x2_f32;
/* 0x00f8 */ tint_array<int8_t, 8> tint_pad_5; /* 0x00f8 */ tint_array<int8_t, 8> tint_pad_6;
/* 0x0100 */ float3x3 mat3x3_f32; /* 0x0100 */ tint_array<tint_packed_vec3_f32_array_element, 3> mat3x3_f32;
/* 0x0130 */ float3x4 mat3x4_f32; /* 0x0130 */ float3x4 mat3x4_f32;
/* 0x0160 */ float4x2 mat4x2_f32; /* 0x0160 */ float4x2 mat4x2_f32;
/* 0x0180 */ float4x3 mat4x3_f32; /* 0x0180 */ tint_array<tint_packed_vec3_f32_array_element, 4> mat4x3_f32;
/* 0x01c0 */ float4x4 mat4x4_f32; /* 0x01c0 */ float4x4 mat4x4_f32;
/* 0x0200 */ tint_array<float3, 2> arr2_vec3_f32; /* 0x0200 */ tint_array<tint_packed_vec3_f32_array_element, 2> arr2_vec3_f32;
/* 0x0220 */ Inner struct_inner; /* 0x0220 */ Inner struct_inner;
/* 0x0228 */ tint_array<Inner, 4> array_struct_inner; /* 0x0228 */ tint_array<Inner, 4> array_struct_inner;
/* 0x0248 */ tint_array<int8_t, 8> tint_pad_6; /* 0x0248 */ tint_array<int8_t, 8> tint_pad_7;
}; };
void assign_and_preserve_padding(device float2x3* const dest, float2x3 value) { struct S {
(*(dest))[0u] = value[0u]; float scalar_f32;
(*(dest))[1u] = value[1u]; int scalar_i32;
uint scalar_u32;
float2 vec2_f32;
int2 vec2_i32;
uint2 vec2_u32;
float3 vec3_f32;
int3 vec3_i32;
uint3 vec3_u32;
float4 vec4_f32;
int4 vec4_i32;
uint4 vec4_u32;
float2x2 mat2x2_f32;
float2x3 mat2x3_f32;
float2x4 mat2x4_f32;
float3x2 mat3x2_f32;
float3x3 mat3x3_f32;
float3x4 mat3x4_f32;
float4x2 mat4x2_f32;
float4x3 mat4x3_f32;
float4x4 mat4x4_f32;
tint_array<float3, 2> arr2_vec3_f32;
Inner struct_inner;
tint_array<Inner, 4> array_struct_inner;
};
void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, float2x3 value) {
(*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u].elements = packed_float3(value[1u]);
} }
void assign_and_preserve_padding_1(device float3x3* const dest, float3x3 value) { void assign_and_preserve_padding_1(device tint_array<tint_packed_vec3_f32_array_element, 3>* const dest, float3x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_float3(value[1u]);
(*(dest))[2u] = value[2u]; (*(dest))[2u].elements = packed_float3(value[2u]);
} }
void assign_and_preserve_padding_2(device float4x3* const dest, float4x3 value) { void assign_and_preserve_padding_2(device tint_array<tint_packed_vec3_f32_array_element, 4>* const dest, float4x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_float3(value[1u]);
(*(dest))[2u] = value[2u]; (*(dest))[2u].elements = packed_float3(value[2u]);
(*(dest))[3u] = value[3u]; (*(dest))[3u].elements = packed_float3(value[3u]);
} }
void assign_and_preserve_padding_3(device tint_array<float3, 2>* const dest, tint_array<float3, 2> value) { void assign_and_preserve_padding_3(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
for(uint i = 0u; (i < 2u); i = (i + 1u)) { for(uint i = 0u; (i < 2u); i = (i + 1u)) {
(*(dest))[i] = value[i]; (*(dest))[i].elements = packed_float3(value[i]);
} }
} }
kernel void tint_symbol(device S* tint_symbol_4 [[buffer(0)]]) { kernel void tint_symbol(device S_tint_packed_vec3* tint_symbol_4 [[buffer(0)]]) {
(*(tint_symbol_4)).scalar_f32 = 0.0f; (*(tint_symbol_4)).scalar_f32 = 0.0f;
(*(tint_symbol_4)).scalar_i32 = 0; (*(tint_symbol_4)).scalar_i32 = 0;
(*(tint_symbol_4)).scalar_u32 = 0u; (*(tint_symbol_4)).scalar_u32 = 0u;
(*(tint_symbol_4)).vec2_f32 = float2(0.0f); (*(tint_symbol_4)).vec2_f32 = float2(0.0f);
(*(tint_symbol_4)).vec2_i32 = int2(0); (*(tint_symbol_4)).vec2_i32 = int2(0);
(*(tint_symbol_4)).vec2_u32 = uint2(0u); (*(tint_symbol_4)).vec2_u32 = uint2(0u);
(*(tint_symbol_4)).vec3_f32 = float3(0.0f); (*(tint_symbol_4)).vec3_f32 = packed_float3(0.0f);
(*(tint_symbol_4)).vec3_i32 = int3(0); (*(tint_symbol_4)).vec3_i32 = packed_int3(0);
(*(tint_symbol_4)).vec3_u32 = uint3(0u); (*(tint_symbol_4)).vec3_u32 = packed_uint3(0u);
(*(tint_symbol_4)).vec4_f32 = float4(0.0f); (*(tint_symbol_4)).vec4_f32 = float4(0.0f);
(*(tint_symbol_4)).vec4_i32 = int4(0); (*(tint_symbol_4)).vec4_i32 = int4(0);
(*(tint_symbol_4)).vec4_u32 = uint4(0u); (*(tint_symbol_4)).vec4_u32 = uint4(0u);

View File

@ -14,104 +14,155 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad_1;
};
struct Inner { struct Inner {
/* 0x0000 */ int scalar_i32; /* 0x0000 */ int scalar_i32;
/* 0x0004 */ float scalar_f32; /* 0x0004 */ float scalar_f32;
/* 0x0008 */ half scalar_f16; /* 0x0008 */ half scalar_f16;
/* 0x000a */ tint_array<int8_t, 2> tint_pad; /* 0x000a */ tint_array<int8_t, 2> tint_pad_2;
}; };
struct S { struct S_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ int scalar_i32; /* 0x0004 */ int scalar_i32;
/* 0x0008 */ uint scalar_u32; /* 0x0008 */ uint scalar_u32;
/* 0x000c */ half scalar_f16; /* 0x000c */ half scalar_f16;
/* 0x000e */ tint_array<int8_t, 2> tint_pad_1; /* 0x000e */ tint_array<int8_t, 2> tint_pad_3;
/* 0x0010 */ float2 vec2_f32; /* 0x0010 */ float2 vec2_f32;
/* 0x0018 */ int2 vec2_i32; /* 0x0018 */ int2 vec2_i32;
/* 0x0020 */ uint2 vec2_u32; /* 0x0020 */ uint2 vec2_u32;
/* 0x0028 */ half2 vec2_f16; /* 0x0028 */ half2 vec2_f16;
/* 0x002c */ tint_array<int8_t, 4> tint_pad_2; /* 0x002c */ tint_array<int8_t, 4> tint_pad_4;
/* 0x0030 */ packed_float3 vec3_f32; /* 0x0030 */ packed_float3 vec3_f32;
/* 0x003c */ tint_array<int8_t, 4> tint_pad_3; /* 0x003c */ tint_array<int8_t, 4> tint_pad_5;
/* 0x0040 */ packed_int3 vec3_i32; /* 0x0040 */ packed_int3 vec3_i32;
/* 0x004c */ tint_array<int8_t, 4> tint_pad_4; /* 0x004c */ tint_array<int8_t, 4> tint_pad_6;
/* 0x0050 */ packed_uint3 vec3_u32; /* 0x0050 */ packed_uint3 vec3_u32;
/* 0x005c */ tint_array<int8_t, 4> tint_pad_5; /* 0x005c */ tint_array<int8_t, 4> tint_pad_7;
/* 0x0060 */ packed_half3 vec3_f16; /* 0x0060 */ packed_half3 vec3_f16;
/* 0x0066 */ tint_array<int8_t, 10> tint_pad_6; /* 0x0066 */ tint_array<int8_t, 10> tint_pad_8;
/* 0x0070 */ float4 vec4_f32; /* 0x0070 */ float4 vec4_f32;
/* 0x0080 */ int4 vec4_i32; /* 0x0080 */ int4 vec4_i32;
/* 0x0090 */ uint4 vec4_u32; /* 0x0090 */ uint4 vec4_u32;
/* 0x00a0 */ half4 vec4_f16; /* 0x00a0 */ half4 vec4_f16;
/* 0x00a8 */ float2x2 mat2x2_f32; /* 0x00a8 */ float2x2 mat2x2_f32;
/* 0x00b8 */ tint_array<int8_t, 8> tint_pad_7; /* 0x00b8 */ tint_array<int8_t, 8> tint_pad_9;
/* 0x00c0 */ float2x3 mat2x3_f32; /* 0x00c0 */ tint_array<tint_packed_vec3_f32_array_element, 2> mat2x3_f32;
/* 0x00e0 */ float2x4 mat2x4_f32; /* 0x00e0 */ float2x4 mat2x4_f32;
/* 0x0100 */ float3x2 mat3x2_f32; /* 0x0100 */ float3x2 mat3x2_f32;
/* 0x0118 */ tint_array<int8_t, 8> tint_pad_8; /* 0x0118 */ tint_array<int8_t, 8> tint_pad_10;
/* 0x0120 */ float3x3 mat3x3_f32; /* 0x0120 */ tint_array<tint_packed_vec3_f32_array_element, 3> mat3x3_f32;
/* 0x0150 */ float3x4 mat3x4_f32; /* 0x0150 */ float3x4 mat3x4_f32;
/* 0x0180 */ float4x2 mat4x2_f32; /* 0x0180 */ float4x2 mat4x2_f32;
/* 0x01a0 */ float4x3 mat4x3_f32; /* 0x01a0 */ tint_array<tint_packed_vec3_f32_array_element, 4> mat4x3_f32;
/* 0x01e0 */ float4x4 mat4x4_f32; /* 0x01e0 */ float4x4 mat4x4_f32;
/* 0x0220 */ half2x2 mat2x2_f16; /* 0x0220 */ half2x2 mat2x2_f16;
/* 0x0228 */ half2x3 mat2x3_f16; /* 0x0228 */ tint_array<tint_packed_vec3_f16_array_element, 2> mat2x3_f16;
/* 0x0238 */ half2x4 mat2x4_f16; /* 0x0238 */ half2x4 mat2x4_f16;
/* 0x0248 */ half3x2 mat3x2_f16; /* 0x0248 */ half3x2 mat3x2_f16;
/* 0x0254 */ tint_array<int8_t, 4> tint_pad_9; /* 0x0254 */ tint_array<int8_t, 4> tint_pad_11;
/* 0x0258 */ half3x3 mat3x3_f16; /* 0x0258 */ tint_array<tint_packed_vec3_f16_array_element, 3> mat3x3_f16;
/* 0x0270 */ half3x4 mat3x4_f16; /* 0x0270 */ half3x4 mat3x4_f16;
/* 0x0288 */ half4x2 mat4x2_f16; /* 0x0288 */ half4x2 mat4x2_f16;
/* 0x0298 */ half4x3 mat4x3_f16; /* 0x0298 */ tint_array<tint_packed_vec3_f16_array_element, 4> mat4x3_f16;
/* 0x02b8 */ half4x4 mat4x4_f16; /* 0x02b8 */ half4x4 mat4x4_f16;
/* 0x02d8 */ tint_array<int8_t, 8> tint_pad_10; /* 0x02d8 */ tint_array<int8_t, 8> tint_pad_12;
/* 0x02e0 */ tint_array<float3, 2> arr2_vec3_f32; /* 0x02e0 */ tint_array<tint_packed_vec3_f32_array_element, 2> arr2_vec3_f32;
/* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16; /* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16;
/* 0x0320 */ Inner struct_inner; /* 0x0320 */ Inner struct_inner;
/* 0x032c */ tint_array<Inner, 4> array_struct_inner; /* 0x032c */ tint_array<Inner, 4> array_struct_inner;
/* 0x035c */ tint_array<int8_t, 4> tint_pad_11; /* 0x035c */ tint_array<int8_t, 4> tint_pad_13;
}; };
void assign_and_preserve_padding(device float2x3* const dest, float2x3 value) { struct S {
(*(dest))[0u] = value[0u]; float scalar_f32;
(*(dest))[1u] = value[1u]; int scalar_i32;
uint scalar_u32;
half scalar_f16;
float2 vec2_f32;
int2 vec2_i32;
uint2 vec2_u32;
half2 vec2_f16;
float3 vec3_f32;
int3 vec3_i32;
uint3 vec3_u32;
half3 vec3_f16;
float4 vec4_f32;
int4 vec4_i32;
uint4 vec4_u32;
half4 vec4_f16;
float2x2 mat2x2_f32;
float2x3 mat2x3_f32;
float2x4 mat2x4_f32;
float3x2 mat3x2_f32;
float3x3 mat3x3_f32;
float3x4 mat3x4_f32;
float4x2 mat4x2_f32;
float4x3 mat4x3_f32;
float4x4 mat4x4_f32;
half2x2 mat2x2_f16;
half2x3 mat2x3_f16;
half2x4 mat2x4_f16;
half3x2 mat3x2_f16;
half3x3 mat3x3_f16;
half3x4 mat3x4_f16;
half4x2 mat4x2_f16;
half4x3 mat4x3_f16;
half4x4 mat4x4_f16;
tint_array<float3, 2> arr2_vec3_f32;
tint_array<half4x2, 2> arr2_mat4x2_f16;
Inner struct_inner;
tint_array<Inner, 4> array_struct_inner;
};
void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, float2x3 value) {
(*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u].elements = packed_float3(value[1u]);
} }
void assign_and_preserve_padding_1(device float3x3* const dest, float3x3 value) { void assign_and_preserve_padding_1(device tint_array<tint_packed_vec3_f32_array_element, 3>* const dest, float3x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_float3(value[1u]);
(*(dest))[2u] = value[2u]; (*(dest))[2u].elements = packed_float3(value[2u]);
} }
void assign_and_preserve_padding_2(device float4x3* const dest, float4x3 value) { void assign_and_preserve_padding_2(device tint_array<tint_packed_vec3_f32_array_element, 4>* const dest, float4x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_float3(value[1u]);
(*(dest))[2u] = value[2u]; (*(dest))[2u].elements = packed_float3(value[2u]);
(*(dest))[3u] = value[3u]; (*(dest))[3u].elements = packed_float3(value[3u]);
} }
void assign_and_preserve_padding_3(device half2x3* const dest, half2x3 value) { void assign_and_preserve_padding_3(device tint_array<tint_packed_vec3_f16_array_element, 2>* const dest, half2x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_half3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_half3(value[1u]);
} }
void assign_and_preserve_padding_4(device half3x3* const dest, half3x3 value) { void assign_and_preserve_padding_4(device tint_array<tint_packed_vec3_f16_array_element, 3>* const dest, half3x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_half3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_half3(value[1u]);
(*(dest))[2u] = value[2u]; (*(dest))[2u].elements = packed_half3(value[2u]);
} }
void assign_and_preserve_padding_5(device half4x3* const dest, half4x3 value) { void assign_and_preserve_padding_5(device tint_array<tint_packed_vec3_f16_array_element, 4>* const dest, half4x3 value) {
(*(dest))[0u] = value[0u]; (*(dest))[0u].elements = packed_half3(value[0u]);
(*(dest))[1u] = value[1u]; (*(dest))[1u].elements = packed_half3(value[1u]);
(*(dest))[2u] = value[2u]; (*(dest))[2u].elements = packed_half3(value[2u]);
(*(dest))[3u] = value[3u]; (*(dest))[3u].elements = packed_half3(value[3u]);
} }
void assign_and_preserve_padding_6(device tint_array<float3, 2>* const dest, tint_array<float3, 2> value) { void assign_and_preserve_padding_6(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
for(uint i = 0u; (i < 2u); i = (i + 1u)) { for(uint i = 0u; (i < 2u); i = (i + 1u)) {
(*(dest))[i] = value[i]; (*(dest))[i].elements = packed_float3(value[i]);
} }
} }
@ -127,7 +178,7 @@ void assign_and_preserve_padding_8(device tint_array<Inner, 4>* const dest, tint
} }
} }
kernel void tint_symbol(device S* tint_symbol_5 [[buffer(0)]]) { kernel void tint_symbol(device S_tint_packed_vec3* tint_symbol_5 [[buffer(0)]]) {
(*(tint_symbol_5)).scalar_f32 = 0.0f; (*(tint_symbol_5)).scalar_f32 = 0.0f;
(*(tint_symbol_5)).scalar_i32 = 0; (*(tint_symbol_5)).scalar_i32 = 0;
(*(tint_symbol_5)).scalar_u32 = 0u; (*(tint_symbol_5)).scalar_u32 = 0u;
@ -136,10 +187,10 @@ kernel void tint_symbol(device S* tint_symbol_5 [[buffer(0)]]) {
(*(tint_symbol_5)).vec2_i32 = int2(0); (*(tint_symbol_5)).vec2_i32 = int2(0);
(*(tint_symbol_5)).vec2_u32 = uint2(0u); (*(tint_symbol_5)).vec2_u32 = uint2(0u);
(*(tint_symbol_5)).vec2_f16 = half2(0.0h); (*(tint_symbol_5)).vec2_f16 = half2(0.0h);
(*(tint_symbol_5)).vec3_f32 = float3(0.0f); (*(tint_symbol_5)).vec3_f32 = packed_float3(0.0f);
(*(tint_symbol_5)).vec3_i32 = int3(0); (*(tint_symbol_5)).vec3_i32 = packed_int3(0);
(*(tint_symbol_5)).vec3_u32 = uint3(0u); (*(tint_symbol_5)).vec3_u32 = packed_uint3(0u);
(*(tint_symbol_5)).vec3_f16 = half3(0.0h); (*(tint_symbol_5)).vec3_f16 = packed_half3(0.0h);
(*(tint_symbol_5)).vec4_f32 = float4(0.0f); (*(tint_symbol_5)).vec4_f32 = float4(0.0f);
(*(tint_symbol_5)).vec4_i32 = int4(0); (*(tint_symbol_5)).vec4_i32 = int4(0);
(*(tint_symbol_5)).vec4_u32 = uint4(0u); (*(tint_symbol_5)).vec4_u32 = uint4(0u);

View File

@ -1,13 +1,39 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
void assign_and_preserve_padding(device half2x3* const dest, half2x3 value) {
(*(dest))[0u] = value[0u]; template<typename T, size_t N>
(*(dest))[1u] = value[1u]; struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad;
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
half2x3 result = half2x3(0.0h);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
} }
kernel void tint_symbol(device half2x3* tint_symbol_1 [[buffer(0)]], const device half2x3* tint_symbol_2 [[buffer(1)]]) { void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f16_array_element, 2>* const dest, half2x3 value) {
assign_and_preserve_padding(tint_symbol_1, *(tint_symbol_2)); (*(dest))[0u].elements = packed_half3(value[0u]);
(*(dest))[1u].elements = packed_half3(value[1u]);
}
kernel void tint_symbol(device tint_array<tint_packed_vec3_f16_array_element, 2>* tint_symbol_1 [[buffer(0)]], const device tint_array<tint_packed_vec3_f16_array_element, 2>* tint_symbol_2 [[buffer(1)]]) {
assign_and_preserve_padding(tint_symbol_1, tint_unpack_vec3_in_composite(*(tint_symbol_2)));
return; return;
} }

View File

@ -1,13 +1,39 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
void assign_and_preserve_padding(device float2x3* const dest, float2x3 value) {
(*(dest))[0u] = value[0u]; template<typename T, size_t N>
(*(dest))[1u] = value[1u]; struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
} }
kernel void tint_symbol(device float2x3* tint_symbol_1 [[buffer(0)]], const device float2x3* tint_symbol_2 [[buffer(1)]]) { void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, float2x3 value) {
assign_and_preserve_padding(tint_symbol_1, *(tint_symbol_2)); (*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u].elements = packed_float3(value[1u]);
}
kernel void tint_symbol(device tint_array<tint_packed_vec3_f32_array_element, 2>* tint_symbol_1 [[buffer(0)]], const device tint_array<tint_packed_vec3_f32_array_element, 2>* tint_symbol_2 [[buffer(1)]]) {
assign_and_preserve_padding(tint_symbol_1, tint_unpack_vec3_in_composite(*(tint_symbol_2)));
return; return;
} }

View File

@ -1,14 +1,40 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
void assign_and_preserve_padding(device half3x3* const dest, half3x3 value) {
(*(dest))[0u] = value[0u]; template<typename T, size_t N>
(*(dest))[1u] = value[1u]; struct tint_array {
(*(dest))[2u] = value[2u]; const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad;
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
half3x3 result = half3x3(0.0h);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
} }
kernel void tint_symbol(device half3x3* tint_symbol_1 [[buffer(0)]], const device half3x3* tint_symbol_2 [[buffer(1)]]) { void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f16_array_element, 3>* const dest, half3x3 value) {
assign_and_preserve_padding(tint_symbol_1, *(tint_symbol_2)); (*(dest))[0u].elements = packed_half3(value[0u]);
(*(dest))[1u].elements = packed_half3(value[1u]);
(*(dest))[2u].elements = packed_half3(value[2u]);
}
kernel void tint_symbol(device tint_array<tint_packed_vec3_f16_array_element, 3>* tint_symbol_1 [[buffer(0)]], const device tint_array<tint_packed_vec3_f16_array_element, 3>* tint_symbol_2 [[buffer(1)]]) {
assign_and_preserve_padding(tint_symbol_1, tint_unpack_vec3_in_composite(*(tint_symbol_2)));
return; return;
} }

View File

@ -1,14 +1,40 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
void assign_and_preserve_padding(device float3x3* const dest, float3x3 value) {
(*(dest))[0u] = value[0u]; template<typename T, size_t N>
(*(dest))[1u] = value[1u]; struct tint_array {
(*(dest))[2u] = value[2u]; const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
} }
kernel void tint_symbol(device float3x3* tint_symbol_1 [[buffer(0)]], const device float3x3* tint_symbol_2 [[buffer(1)]]) { void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 3>* const dest, float3x3 value) {
assign_and_preserve_padding(tint_symbol_1, *(tint_symbol_2)); (*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u].elements = packed_float3(value[1u]);
(*(dest))[2u].elements = packed_float3(value[2u]);
}
kernel void tint_symbol(device tint_array<tint_packed_vec3_f32_array_element, 3>* tint_symbol_1 [[buffer(0)]], const device tint_array<tint_packed_vec3_f32_array_element, 3>* tint_symbol_2 [[buffer(1)]]) {
assign_and_preserve_padding(tint_symbol_1, tint_unpack_vec3_in_composite(*(tint_symbol_2)));
return; return;
} }

View File

@ -1,15 +1,41 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
void assign_and_preserve_padding(device half4x3* const dest, half4x3 value) {
(*(dest))[0u] = value[0u]; template<typename T, size_t N>
(*(dest))[1u] = value[1u]; struct tint_array {
(*(dest))[2u] = value[2u]; const constant T& operator[](size_t i) const constant { return elements[i]; }
(*(dest))[3u] = value[3u]; device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad;
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
half4x3 result = half4x3(0.0h);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
} }
kernel void tint_symbol(device half4x3* tint_symbol_1 [[buffer(0)]], const device half4x3* tint_symbol_2 [[buffer(1)]]) { void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f16_array_element, 4>* const dest, half4x3 value) {
assign_and_preserve_padding(tint_symbol_1, *(tint_symbol_2)); (*(dest))[0u].elements = packed_half3(value[0u]);
(*(dest))[1u].elements = packed_half3(value[1u]);
(*(dest))[2u].elements = packed_half3(value[2u]);
(*(dest))[3u].elements = packed_half3(value[3u]);
}
kernel void tint_symbol(device tint_array<tint_packed_vec3_f16_array_element, 4>* tint_symbol_1 [[buffer(0)]], const device tint_array<tint_packed_vec3_f16_array_element, 4>* tint_symbol_2 [[buffer(1)]]) {
assign_and_preserve_padding(tint_symbol_1, tint_unpack_vec3_in_composite(*(tint_symbol_2)));
return; return;
} }

View File

@ -1,15 +1,41 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
void assign_and_preserve_padding(device float4x3* const dest, float4x3 value) {
(*(dest))[0u] = value[0u]; template<typename T, size_t N>
(*(dest))[1u] = value[1u]; struct tint_array {
(*(dest))[2u] = value[2u]; const constant T& operator[](size_t i) const constant { return elements[i]; }
(*(dest))[3u] = value[3u]; device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
float4x3 result = float4x3(0.0f);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
} }
kernel void tint_symbol(device float4x3* tint_symbol_1 [[buffer(0)]], const device float4x3* tint_symbol_2 [[buffer(1)]]) { void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 4>* const dest, float4x3 value) {
assign_and_preserve_padding(tint_symbol_1, *(tint_symbol_2)); (*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u].elements = packed_float3(value[1u]);
(*(dest))[2u].elements = packed_float3(value[2u]);
(*(dest))[3u].elements = packed_float3(value[3u]);
}
kernel void tint_symbol(device tint_array<tint_packed_vec3_f32_array_element, 4>* tint_symbol_1 [[buffer(0)]], const device tint_array<tint_packed_vec3_f32_array_element, 4>* tint_symbol_2 [[buffer(1)]]) {
assign_and_preserve_padding(tint_symbol_1, tint_unpack_vec3_in_composite(*(tint_symbol_2)));
return; return;
} }

View File

@ -14,7 +14,7 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct Inner { struct Inner_tint_packed_vec3 {
/* 0x0000 */ half scalar_f16; /* 0x0000 */ half scalar_f16;
/* 0x0002 */ tint_array<int8_t, 6> tint_pad; /* 0x0002 */ tint_array<int8_t, 6> tint_pad;
/* 0x0008 */ packed_half3 vec3_f16; /* 0x0008 */ packed_half3 vec3_f16;
@ -22,22 +22,46 @@ struct Inner {
/* 0x0010 */ half2x4 mat2x4_f16; /* 0x0010 */ half2x4 mat2x4_f16;
}; };
struct S { struct S_tint_packed_vec3 {
/* 0x0000 */ Inner inner; /* 0x0000 */ Inner_tint_packed_vec3 inner;
}; };
void assign_and_preserve_padding_1(device Inner* const dest, Inner value) { struct Inner {
half scalar_f16;
half3 vec3_f16;
half2x4 mat2x4_f16;
};
Inner tint_unpack_vec3_in_composite(Inner_tint_packed_vec3 in) {
Inner result = {};
result.scalar_f16 = in.scalar_f16;
result.vec3_f16 = half3(in.vec3_f16);
result.mat2x4_f16 = in.mat2x4_f16;
return result;
}
struct S {
Inner inner;
};
S tint_unpack_vec3_in_composite_1(S_tint_packed_vec3 in) {
S result = {};
result.inner = tint_unpack_vec3_in_composite(in.inner);
return result;
}
void assign_and_preserve_padding_1(device Inner_tint_packed_vec3* const dest, Inner value) {
(*(dest)).scalar_f16 = value.scalar_f16; (*(dest)).scalar_f16 = value.scalar_f16;
(*(dest)).vec3_f16 = half3(value.vec3_f16); (*(dest)).vec3_f16 = packed_half3(value.vec3_f16);
(*(dest)).mat2x4_f16 = value.mat2x4_f16; (*(dest)).mat2x4_f16 = value.mat2x4_f16;
} }
void assign_and_preserve_padding(device S* const dest, S value) { void assign_and_preserve_padding(device S_tint_packed_vec3* const dest, S value) {
assign_and_preserve_padding_1(&((*(dest)).inner), value.inner); assign_and_preserve_padding_1(&((*(dest)).inner), value.inner);
} }
kernel void tint_symbol(const device S* tint_symbol_1 [[buffer(1)]], device S* tint_symbol_2 [[buffer(0)]]) { kernel void tint_symbol(const device S_tint_packed_vec3* tint_symbol_1 [[buffer(1)]], device S_tint_packed_vec3* tint_symbol_2 [[buffer(0)]]) {
S const t = *(tint_symbol_1); S const t = tint_unpack_vec3_in_composite_1(*(tint_symbol_1));
assign_and_preserve_padding(tint_symbol_2, t); assign_and_preserve_padding(tint_symbol_2, t);
return; return;
} }

View File

@ -14,7 +14,7 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct Inner { struct Inner_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ tint_array<int8_t, 12> tint_pad; /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
/* 0x0010 */ packed_float3 vec3_f32; /* 0x0010 */ packed_float3 vec3_f32;
@ -22,22 +22,46 @@ struct Inner {
/* 0x0020 */ float2x4 mat2x4_f32; /* 0x0020 */ float2x4 mat2x4_f32;
}; };
struct S { struct S_tint_packed_vec3 {
/* 0x0000 */ Inner inner; /* 0x0000 */ Inner_tint_packed_vec3 inner;
}; };
void assign_and_preserve_padding_1(device Inner* const dest, Inner value) { struct Inner {
float scalar_f32;
float3 vec3_f32;
float2x4 mat2x4_f32;
};
Inner tint_unpack_vec3_in_composite(Inner_tint_packed_vec3 in) {
Inner result = {};
result.scalar_f32 = in.scalar_f32;
result.vec3_f32 = float3(in.vec3_f32);
result.mat2x4_f32 = in.mat2x4_f32;
return result;
}
struct S {
Inner inner;
};
S tint_unpack_vec3_in_composite_1(S_tint_packed_vec3 in) {
S result = {};
result.inner = tint_unpack_vec3_in_composite(in.inner);
return result;
}
void assign_and_preserve_padding_1(device Inner_tint_packed_vec3* const dest, Inner value) {
(*(dest)).scalar_f32 = value.scalar_f32; (*(dest)).scalar_f32 = value.scalar_f32;
(*(dest)).vec3_f32 = float3(value.vec3_f32); (*(dest)).vec3_f32 = packed_float3(value.vec3_f32);
(*(dest)).mat2x4_f32 = value.mat2x4_f32; (*(dest)).mat2x4_f32 = value.mat2x4_f32;
} }
void assign_and_preserve_padding(device S* const dest, S value) { void assign_and_preserve_padding(device S_tint_packed_vec3* const dest, S value) {
assign_and_preserve_padding_1(&((*(dest)).inner), value.inner); assign_and_preserve_padding_1(&((*(dest)).inner), value.inner);
} }
kernel void tint_symbol(const device S* tint_symbol_1 [[buffer(1)]], device S* tint_symbol_2 [[buffer(0)]]) { kernel void tint_symbol(const device S_tint_packed_vec3* tint_symbol_1 [[buffer(1)]], device S_tint_packed_vec3* tint_symbol_2 [[buffer(0)]]) {
S const t = *(tint_symbol_1); S const t = tint_unpack_vec3_in_composite_1(*(tint_symbol_1));
assign_and_preserve_padding(tint_symbol_2, t); assign_and_preserve_padding(tint_symbol_2, t);
return; return;
} }

View File

@ -1,7 +1,7 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
kernel void tint_symbol(device half3* tint_symbol_1 [[buffer(0)]], const device half3* tint_symbol_2 [[buffer(1)]]) { kernel void tint_symbol(device packed_half3* tint_symbol_1 [[buffer(0)]], const device packed_half3* tint_symbol_2 [[buffer(1)]]) {
*(tint_symbol_1) = *(tint_symbol_2); *(tint_symbol_1) = *(tint_symbol_2);
return; return;
} }

View File

@ -1,7 +1,7 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
kernel void tint_symbol(device float3* tint_symbol_1 [[buffer(0)]], const device float3* tint_symbol_2 [[buffer(1)]]) { kernel void tint_symbol(device packed_float3* tint_symbol_1 [[buffer(0)]], const device packed_float3* tint_symbol_2 [[buffer(1)]]) {
*(tint_symbol_1) = *(tint_symbol_2); *(tint_symbol_1) = *(tint_symbol_2);
return; return;
} }

View File

@ -1,7 +1,7 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
kernel void tint_symbol(device int3* tint_symbol_1 [[buffer(0)]], const device int3* tint_symbol_2 [[buffer(1)]]) { kernel void tint_symbol(device packed_int3* tint_symbol_1 [[buffer(0)]], const device packed_int3* tint_symbol_2 [[buffer(1)]]) {
*(tint_symbol_1) = *(tint_symbol_2); *(tint_symbol_1) = *(tint_symbol_2);
return; return;
} }

View File

@ -1,7 +1,7 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
kernel void tint_symbol(device uint3* tint_symbol_1 [[buffer(0)]], const device uint3* tint_symbol_2 [[buffer(1)]]) { kernel void tint_symbol(device packed_uint3* tint_symbol_1 [[buffer(0)]], const device packed_uint3* tint_symbol_2 [[buffer(1)]]) {
*(tint_symbol_1) = *(tint_symbol_2); *(tint_symbol_1) = *(tint_symbol_2);
return; return;
} }

View File

@ -14,42 +14,108 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct Inner { struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
struct Inner_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ int scalar_i32; /* 0x0004 */ int scalar_i32;
/* 0x0008 */ uint scalar_u32; /* 0x0008 */ uint scalar_u32;
/* 0x000c */ tint_array<int8_t, 4> tint_pad; /* 0x000c */ tint_array<int8_t, 4> tint_pad_1;
/* 0x0010 */ float2 vec2_f32; /* 0x0010 */ float2 vec2_f32;
/* 0x0018 */ int2 vec2_i32; /* 0x0018 */ int2 vec2_i32;
/* 0x0020 */ uint2 vec2_u32; /* 0x0020 */ uint2 vec2_u32;
/* 0x0028 */ tint_array<int8_t, 8> tint_pad_1; /* 0x0028 */ tint_array<int8_t, 8> tint_pad_2;
/* 0x0030 */ packed_float3 vec3_f32; /* 0x0030 */ packed_float3 vec3_f32;
/* 0x003c */ tint_array<int8_t, 4> tint_pad_2; /* 0x003c */ tint_array<int8_t, 4> tint_pad_3;
/* 0x0040 */ packed_int3 vec3_i32; /* 0x0040 */ packed_int3 vec3_i32;
/* 0x004c */ tint_array<int8_t, 4> tint_pad_3; /* 0x004c */ tint_array<int8_t, 4> tint_pad_4;
/* 0x0050 */ packed_uint3 vec3_u32; /* 0x0050 */ packed_uint3 vec3_u32;
/* 0x005c */ tint_array<int8_t, 4> tint_pad_4; /* 0x005c */ tint_array<int8_t, 4> tint_pad_5;
/* 0x0060 */ float4 vec4_f32; /* 0x0060 */ float4 vec4_f32;
/* 0x0070 */ int4 vec4_i32; /* 0x0070 */ int4 vec4_i32;
/* 0x0080 */ uint4 vec4_u32; /* 0x0080 */ uint4 vec4_u32;
/* 0x0090 */ float2x2 mat2x2_f32; /* 0x0090 */ float2x2 mat2x2_f32;
/* 0x00a0 */ float2x3 mat2x3_f32; /* 0x00a0 */ tint_array<tint_packed_vec3_f32_array_element, 2> mat2x3_f32;
/* 0x00c0 */ float2x4 mat2x4_f32; /* 0x00c0 */ float2x4 mat2x4_f32;
/* 0x00e0 */ float3x2 mat3x2_f32; /* 0x00e0 */ float3x2 mat3x2_f32;
/* 0x00f8 */ tint_array<int8_t, 8> tint_pad_5; /* 0x00f8 */ tint_array<int8_t, 8> tint_pad_6;
/* 0x0100 */ float3x3 mat3x3_f32; /* 0x0100 */ tint_array<tint_packed_vec3_f32_array_element, 3> mat3x3_f32;
/* 0x0130 */ float3x4 mat3x4_f32; /* 0x0130 */ float3x4 mat3x4_f32;
/* 0x0160 */ float4x2 mat4x2_f32; /* 0x0160 */ float4x2 mat4x2_f32;
/* 0x0180 */ float4x3 mat4x3_f32; /* 0x0180 */ tint_array<tint_packed_vec3_f32_array_element, 4> mat4x3_f32;
/* 0x01c0 */ float4x4 mat4x4_f32; /* 0x01c0 */ float4x4 mat4x4_f32;
/* 0x0200 */ tint_array<float3, 2> arr2_vec3_f32; /* 0x0200 */ tint_array<tint_packed_vec3_f32_array_element, 2> arr2_vec3_f32;
};
struct S_tint_packed_vec3 {
/* 0x0000 */ tint_array<Inner_tint_packed_vec3, 8> arr;
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
float4x3 result = float4x3(0.0f);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
tint_array<float3, 2> result = {};
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
struct Inner {
float scalar_f32;
int scalar_i32;
uint scalar_u32;
float2 vec2_f32;
int2 vec2_i32;
uint2 vec2_u32;
float3 vec3_f32;
int3 vec3_i32;
uint3 vec3_u32;
float4 vec4_f32;
int4 vec4_i32;
uint4 vec4_u32;
float2x2 mat2x2_f32;
float2x3 mat2x3_f32;
float2x4 mat2x4_f32;
float3x2 mat3x2_f32;
float3x3 mat3x3_f32;
float3x4 mat3x4_f32;
float4x2 mat4x2_f32;
float4x3 mat4x3_f32;
float4x4 mat4x4_f32;
tint_array<float3, 2> arr2_vec3_f32;
}; };
struct S { struct S {
/* 0x0000 */ tint_array<Inner, 8> arr; tint_array<Inner, 8> arr;
}; };
void tint_symbol_inner(uint idx, const constant S* const tint_symbol_1) { void tint_symbol_inner(uint idx, const constant S_tint_packed_vec3* const tint_symbol_1) {
float const scalar_f32 = (*(tint_symbol_1)).arr[idx].scalar_f32; float const scalar_f32 = (*(tint_symbol_1)).arr[idx].scalar_f32;
int const scalar_i32 = (*(tint_symbol_1)).arr[idx].scalar_i32; int const scalar_i32 = (*(tint_symbol_1)).arr[idx].scalar_i32;
uint const scalar_u32 = (*(tint_symbol_1)).arr[idx].scalar_u32; uint const scalar_u32 = (*(tint_symbol_1)).arr[idx].scalar_u32;
@ -63,18 +129,18 @@ void tint_symbol_inner(uint idx, const constant S* const tint_symbol_1) {
int4 const vec4_i32 = (*(tint_symbol_1)).arr[idx].vec4_i32; int4 const vec4_i32 = (*(tint_symbol_1)).arr[idx].vec4_i32;
uint4 const vec4_u32 = (*(tint_symbol_1)).arr[idx].vec4_u32; uint4 const vec4_u32 = (*(tint_symbol_1)).arr[idx].vec4_u32;
float2x2 const mat2x2_f32 = (*(tint_symbol_1)).arr[idx].mat2x2_f32; float2x2 const mat2x2_f32 = (*(tint_symbol_1)).arr[idx].mat2x2_f32;
float2x3 const mat2x3_f32 = (*(tint_symbol_1)).arr[idx].mat2x3_f32; float2x3 const mat2x3_f32 = tint_unpack_vec3_in_composite((*(tint_symbol_1)).arr[idx].mat2x3_f32);
float2x4 const mat2x4_f32 = (*(tint_symbol_1)).arr[idx].mat2x4_f32; float2x4 const mat2x4_f32 = (*(tint_symbol_1)).arr[idx].mat2x4_f32;
float3x2 const mat3x2_f32 = (*(tint_symbol_1)).arr[idx].mat3x2_f32; float3x2 const mat3x2_f32 = (*(tint_symbol_1)).arr[idx].mat3x2_f32;
float3x3 const mat3x3_f32 = (*(tint_symbol_1)).arr[idx].mat3x3_f32; float3x3 const mat3x3_f32 = tint_unpack_vec3_in_composite_1((*(tint_symbol_1)).arr[idx].mat3x3_f32);
float3x4 const mat3x4_f32 = (*(tint_symbol_1)).arr[idx].mat3x4_f32; float3x4 const mat3x4_f32 = (*(tint_symbol_1)).arr[idx].mat3x4_f32;
float4x2 const mat4x2_f32 = (*(tint_symbol_1)).arr[idx].mat4x2_f32; float4x2 const mat4x2_f32 = (*(tint_symbol_1)).arr[idx].mat4x2_f32;
float4x3 const mat4x3_f32 = (*(tint_symbol_1)).arr[idx].mat4x3_f32; float4x3 const mat4x3_f32 = tint_unpack_vec3_in_composite_2((*(tint_symbol_1)).arr[idx].mat4x3_f32);
float4x4 const mat4x4_f32 = (*(tint_symbol_1)).arr[idx].mat4x4_f32; float4x4 const mat4x4_f32 = (*(tint_symbol_1)).arr[idx].mat4x4_f32;
tint_array<float3, 2> const arr2_vec3_f32 = (*(tint_symbol_1)).arr[idx].arr2_vec3_f32; tint_array<float3, 2> const arr2_vec3_f32 = tint_unpack_vec3_in_composite_3((*(tint_symbol_1)).arr[idx].arr2_vec3_f32);
} }
kernel void tint_symbol(const constant S* tint_symbol_2 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) { kernel void tint_symbol(const constant S_tint_packed_vec3* tint_symbol_2 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) {
tint_symbol_inner(idx, tint_symbol_2); tint_symbol_inner(idx, tint_symbol_2);
return; return;
} }

View File

@ -14,60 +14,169 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct Inner { struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad_1;
};
struct Inner_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ int scalar_i32; /* 0x0004 */ int scalar_i32;
/* 0x0008 */ uint scalar_u32; /* 0x0008 */ uint scalar_u32;
/* 0x000c */ half scalar_f16; /* 0x000c */ half scalar_f16;
/* 0x000e */ tint_array<int8_t, 2> tint_pad; /* 0x000e */ tint_array<int8_t, 2> tint_pad_2;
/* 0x0010 */ float2 vec2_f32; /* 0x0010 */ float2 vec2_f32;
/* 0x0018 */ int2 vec2_i32; /* 0x0018 */ int2 vec2_i32;
/* 0x0020 */ uint2 vec2_u32; /* 0x0020 */ uint2 vec2_u32;
/* 0x0028 */ half2 vec2_f16; /* 0x0028 */ half2 vec2_f16;
/* 0x002c */ tint_array<int8_t, 4> tint_pad_1; /* 0x002c */ tint_array<int8_t, 4> tint_pad_3;
/* 0x0030 */ packed_float3 vec3_f32; /* 0x0030 */ packed_float3 vec3_f32;
/* 0x003c */ tint_array<int8_t, 4> tint_pad_2; /* 0x003c */ tint_array<int8_t, 4> tint_pad_4;
/* 0x0040 */ packed_int3 vec3_i32; /* 0x0040 */ packed_int3 vec3_i32;
/* 0x004c */ tint_array<int8_t, 4> tint_pad_3; /* 0x004c */ tint_array<int8_t, 4> tint_pad_5;
/* 0x0050 */ packed_uint3 vec3_u32; /* 0x0050 */ packed_uint3 vec3_u32;
/* 0x005c */ tint_array<int8_t, 4> tint_pad_4; /* 0x005c */ tint_array<int8_t, 4> tint_pad_6;
/* 0x0060 */ packed_half3 vec3_f16; /* 0x0060 */ packed_half3 vec3_f16;
/* 0x0066 */ tint_array<int8_t, 10> tint_pad_5; /* 0x0066 */ tint_array<int8_t, 10> tint_pad_7;
/* 0x0070 */ float4 vec4_f32; /* 0x0070 */ float4 vec4_f32;
/* 0x0080 */ int4 vec4_i32; /* 0x0080 */ int4 vec4_i32;
/* 0x0090 */ uint4 vec4_u32; /* 0x0090 */ uint4 vec4_u32;
/* 0x00a0 */ half4 vec4_f16; /* 0x00a0 */ half4 vec4_f16;
/* 0x00a8 */ float2x2 mat2x2_f32; /* 0x00a8 */ float2x2 mat2x2_f32;
/* 0x00b8 */ tint_array<int8_t, 8> tint_pad_6; /* 0x00b8 */ tint_array<int8_t, 8> tint_pad_8;
/* 0x00c0 */ float2x3 mat2x3_f32; /* 0x00c0 */ tint_array<tint_packed_vec3_f32_array_element, 2> mat2x3_f32;
/* 0x00e0 */ float2x4 mat2x4_f32; /* 0x00e0 */ float2x4 mat2x4_f32;
/* 0x0100 */ float3x2 mat3x2_f32; /* 0x0100 */ float3x2 mat3x2_f32;
/* 0x0118 */ tint_array<int8_t, 8> tint_pad_7; /* 0x0118 */ tint_array<int8_t, 8> tint_pad_9;
/* 0x0120 */ float3x3 mat3x3_f32; /* 0x0120 */ tint_array<tint_packed_vec3_f32_array_element, 3> mat3x3_f32;
/* 0x0150 */ float3x4 mat3x4_f32; /* 0x0150 */ float3x4 mat3x4_f32;
/* 0x0180 */ float4x2 mat4x2_f32; /* 0x0180 */ float4x2 mat4x2_f32;
/* 0x01a0 */ float4x3 mat4x3_f32; /* 0x01a0 */ tint_array<tint_packed_vec3_f32_array_element, 4> mat4x3_f32;
/* 0x01e0 */ float4x4 mat4x4_f32; /* 0x01e0 */ float4x4 mat4x4_f32;
/* 0x0220 */ half2x2 mat2x2_f16; /* 0x0220 */ half2x2 mat2x2_f16;
/* 0x0228 */ half2x3 mat2x3_f16; /* 0x0228 */ tint_array<tint_packed_vec3_f16_array_element, 2> mat2x3_f16;
/* 0x0238 */ half2x4 mat2x4_f16; /* 0x0238 */ half2x4 mat2x4_f16;
/* 0x0248 */ half3x2 mat3x2_f16; /* 0x0248 */ half3x2 mat3x2_f16;
/* 0x0254 */ tint_array<int8_t, 4> tint_pad_8; /* 0x0254 */ tint_array<int8_t, 4> tint_pad_10;
/* 0x0258 */ half3x3 mat3x3_f16; /* 0x0258 */ tint_array<tint_packed_vec3_f16_array_element, 3> mat3x3_f16;
/* 0x0270 */ half3x4 mat3x4_f16; /* 0x0270 */ half3x4 mat3x4_f16;
/* 0x0288 */ half4x2 mat4x2_f16; /* 0x0288 */ half4x2 mat4x2_f16;
/* 0x0298 */ half4x3 mat4x3_f16; /* 0x0298 */ tint_array<tint_packed_vec3_f16_array_element, 4> mat4x3_f16;
/* 0x02b8 */ half4x4 mat4x4_f16; /* 0x02b8 */ half4x4 mat4x4_f16;
/* 0x02d8 */ tint_array<int8_t, 8> tint_pad_9; /* 0x02d8 */ tint_array<int8_t, 8> tint_pad_11;
/* 0x02e0 */ tint_array<float3, 2> arr2_vec3_f32; /* 0x02e0 */ tint_array<tint_packed_vec3_f32_array_element, 2> arr2_vec3_f32;
/* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16; /* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16;
}; };
struct S { struct S_tint_packed_vec3 {
/* 0x0000 */ tint_array<Inner, 8> arr; /* 0x0000 */ tint_array<Inner_tint_packed_vec3, 8> arr;
}; };
void tint_symbol_inner(uint idx, const constant S* const tint_symbol_1) { float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
float4x3 result = float4x3(0.0f);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
half2x3 tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
half2x3 result = half2x3(0.0h);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
half3x3 tint_unpack_vec3_in_composite_4(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
half3x3 result = half3x3(0.0h);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
half4x3 tint_unpack_vec3_in_composite_5(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
half4x3 result = half4x3(0.0h);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_6(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
tint_array<float3, 2> result = {};
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
struct Inner {
float scalar_f32;
int scalar_i32;
uint scalar_u32;
half scalar_f16;
float2 vec2_f32;
int2 vec2_i32;
uint2 vec2_u32;
half2 vec2_f16;
float3 vec3_f32;
int3 vec3_i32;
uint3 vec3_u32;
half3 vec3_f16;
float4 vec4_f32;
int4 vec4_i32;
uint4 vec4_u32;
half4 vec4_f16;
float2x2 mat2x2_f32;
float2x3 mat2x3_f32;
float2x4 mat2x4_f32;
float3x2 mat3x2_f32;
float3x3 mat3x3_f32;
float3x4 mat3x4_f32;
float4x2 mat4x2_f32;
float4x3 mat4x3_f32;
float4x4 mat4x4_f32;
half2x2 mat2x2_f16;
half2x3 mat2x3_f16;
half2x4 mat2x4_f16;
half3x2 mat3x2_f16;
half3x3 mat3x3_f16;
half3x4 mat3x4_f16;
half4x2 mat4x2_f16;
half4x3 mat4x3_f16;
half4x4 mat4x4_f16;
tint_array<float3, 2> arr2_vec3_f32;
tint_array<half4x2, 2> arr2_mat4x2_f16;
};
struct S {
tint_array<Inner, 8> arr;
};
void tint_symbol_inner(uint idx, const constant S_tint_packed_vec3* const tint_symbol_1) {
float const scalar_f32 = (*(tint_symbol_1)).arr[idx].scalar_f32; float const scalar_f32 = (*(tint_symbol_1)).arr[idx].scalar_f32;
int const scalar_i32 = (*(tint_symbol_1)).arr[idx].scalar_i32; int const scalar_i32 = (*(tint_symbol_1)).arr[idx].scalar_i32;
uint const scalar_u32 = (*(tint_symbol_1)).arr[idx].scalar_u32; uint const scalar_u32 = (*(tint_symbol_1)).arr[idx].scalar_u32;
@ -85,28 +194,28 @@ void tint_symbol_inner(uint idx, const constant S* const tint_symbol_1) {
uint4 const vec4_u32 = (*(tint_symbol_1)).arr[idx].vec4_u32; uint4 const vec4_u32 = (*(tint_symbol_1)).arr[idx].vec4_u32;
half4 const vec4_f16 = (*(tint_symbol_1)).arr[idx].vec4_f16; half4 const vec4_f16 = (*(tint_symbol_1)).arr[idx].vec4_f16;
float2x2 const mat2x2_f32 = (*(tint_symbol_1)).arr[idx].mat2x2_f32; float2x2 const mat2x2_f32 = (*(tint_symbol_1)).arr[idx].mat2x2_f32;
float2x3 const mat2x3_f32 = (*(tint_symbol_1)).arr[idx].mat2x3_f32; float2x3 const mat2x3_f32 = tint_unpack_vec3_in_composite((*(tint_symbol_1)).arr[idx].mat2x3_f32);
float2x4 const mat2x4_f32 = (*(tint_symbol_1)).arr[idx].mat2x4_f32; float2x4 const mat2x4_f32 = (*(tint_symbol_1)).arr[idx].mat2x4_f32;
float3x2 const mat3x2_f32 = (*(tint_symbol_1)).arr[idx].mat3x2_f32; float3x2 const mat3x2_f32 = (*(tint_symbol_1)).arr[idx].mat3x2_f32;
float3x3 const mat3x3_f32 = (*(tint_symbol_1)).arr[idx].mat3x3_f32; float3x3 const mat3x3_f32 = tint_unpack_vec3_in_composite_1((*(tint_symbol_1)).arr[idx].mat3x3_f32);
float3x4 const mat3x4_f32 = (*(tint_symbol_1)).arr[idx].mat3x4_f32; float3x4 const mat3x4_f32 = (*(tint_symbol_1)).arr[idx].mat3x4_f32;
float4x2 const mat4x2_f32 = (*(tint_symbol_1)).arr[idx].mat4x2_f32; float4x2 const mat4x2_f32 = (*(tint_symbol_1)).arr[idx].mat4x2_f32;
float4x3 const mat4x3_f32 = (*(tint_symbol_1)).arr[idx].mat4x3_f32; float4x3 const mat4x3_f32 = tint_unpack_vec3_in_composite_2((*(tint_symbol_1)).arr[idx].mat4x3_f32);
float4x4 const mat4x4_f32 = (*(tint_symbol_1)).arr[idx].mat4x4_f32; float4x4 const mat4x4_f32 = (*(tint_symbol_1)).arr[idx].mat4x4_f32;
half2x2 const mat2x2_f16 = (*(tint_symbol_1)).arr[idx].mat2x2_f16; half2x2 const mat2x2_f16 = (*(tint_symbol_1)).arr[idx].mat2x2_f16;
half2x3 const mat2x3_f16 = (*(tint_symbol_1)).arr[idx].mat2x3_f16; half2x3 const mat2x3_f16 = tint_unpack_vec3_in_composite_3((*(tint_symbol_1)).arr[idx].mat2x3_f16);
half2x4 const mat2x4_f16 = (*(tint_symbol_1)).arr[idx].mat2x4_f16; half2x4 const mat2x4_f16 = (*(tint_symbol_1)).arr[idx].mat2x4_f16;
half3x2 const mat3x2_f16 = (*(tint_symbol_1)).arr[idx].mat3x2_f16; half3x2 const mat3x2_f16 = (*(tint_symbol_1)).arr[idx].mat3x2_f16;
half3x3 const mat3x3_f16 = (*(tint_symbol_1)).arr[idx].mat3x3_f16; half3x3 const mat3x3_f16 = tint_unpack_vec3_in_composite_4((*(tint_symbol_1)).arr[idx].mat3x3_f16);
half3x4 const mat3x4_f16 = (*(tint_symbol_1)).arr[idx].mat3x4_f16; half3x4 const mat3x4_f16 = (*(tint_symbol_1)).arr[idx].mat3x4_f16;
half4x2 const mat4x2_f16 = (*(tint_symbol_1)).arr[idx].mat4x2_f16; half4x2 const mat4x2_f16 = (*(tint_symbol_1)).arr[idx].mat4x2_f16;
half4x3 const mat4x3_f16 = (*(tint_symbol_1)).arr[idx].mat4x3_f16; half4x3 const mat4x3_f16 = tint_unpack_vec3_in_composite_5((*(tint_symbol_1)).arr[idx].mat4x3_f16);
half4x4 const mat4x4_f16 = (*(tint_symbol_1)).arr[idx].mat4x4_f16; half4x4 const mat4x4_f16 = (*(tint_symbol_1)).arr[idx].mat4x4_f16;
tint_array<float3, 2> const arr2_vec3_f32 = (*(tint_symbol_1)).arr[idx].arr2_vec3_f32; tint_array<float3, 2> const arr2_vec3_f32 = tint_unpack_vec3_in_composite_6((*(tint_symbol_1)).arr[idx].arr2_vec3_f32);
tint_array<half4x2, 2> const arr2_mat4x2_f16 = (*(tint_symbol_1)).arr[idx].arr2_mat4x2_f16; tint_array<half4x2, 2> const arr2_mat4x2_f16 = (*(tint_symbol_1)).arr[idx].arr2_mat4x2_f16;
} }
kernel void tint_symbol(const constant S* tint_symbol_2 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) { kernel void tint_symbol(const constant S_tint_packed_vec3* tint_symbol_2 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) {
tint_symbol_inner(idx, tint_symbol_2); tint_symbol_inner(idx, tint_symbol_2);
return; return;
} }

View File

@ -14,47 +14,111 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct Inner { struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ int scalar_i32; /* 0x0000 */ packed_float3 elements;
/* 0x0004 */ tint_array<int8_t, 12> tint_pad; /* 0x000c */ tint_array<int8_t, 4> tint_pad;
/* 0x0010 */ float scalar_f32;
/* 0x0014 */ tint_array<int8_t, 12> tint_pad_1;
}; };
struct S { struct Inner {
/* 0x0000 */ int scalar_i32;
/* 0x0004 */ tint_array<int8_t, 12> tint_pad_1;
/* 0x0010 */ float scalar_f32;
/* 0x0014 */ tint_array<int8_t, 12> tint_pad_2;
};
struct S_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ int scalar_i32; /* 0x0004 */ int scalar_i32;
/* 0x0008 */ uint scalar_u32; /* 0x0008 */ uint scalar_u32;
/* 0x000c */ tint_array<int8_t, 4> tint_pad_2; /* 0x000c */ tint_array<int8_t, 4> tint_pad_3;
/* 0x0010 */ float2 vec2_f32; /* 0x0010 */ float2 vec2_f32;
/* 0x0018 */ int2 vec2_i32; /* 0x0018 */ int2 vec2_i32;
/* 0x0020 */ uint2 vec2_u32; /* 0x0020 */ uint2 vec2_u32;
/* 0x0028 */ tint_array<int8_t, 8> tint_pad_3; /* 0x0028 */ tint_array<int8_t, 8> tint_pad_4;
/* 0x0030 */ packed_float3 vec3_f32; /* 0x0030 */ packed_float3 vec3_f32;
/* 0x003c */ tint_array<int8_t, 4> tint_pad_4; /* 0x003c */ tint_array<int8_t, 4> tint_pad_5;
/* 0x0040 */ packed_int3 vec3_i32; /* 0x0040 */ packed_int3 vec3_i32;
/* 0x004c */ tint_array<int8_t, 4> tint_pad_5; /* 0x004c */ tint_array<int8_t, 4> tint_pad_6;
/* 0x0050 */ packed_uint3 vec3_u32; /* 0x0050 */ packed_uint3 vec3_u32;
/* 0x005c */ tint_array<int8_t, 4> tint_pad_6; /* 0x005c */ tint_array<int8_t, 4> tint_pad_7;
/* 0x0060 */ float4 vec4_f32; /* 0x0060 */ float4 vec4_f32;
/* 0x0070 */ int4 vec4_i32; /* 0x0070 */ int4 vec4_i32;
/* 0x0080 */ uint4 vec4_u32; /* 0x0080 */ uint4 vec4_u32;
/* 0x0090 */ float2x2 mat2x2_f32; /* 0x0090 */ float2x2 mat2x2_f32;
/* 0x00a0 */ float2x3 mat2x3_f32; /* 0x00a0 */ tint_array<tint_packed_vec3_f32_array_element, 2> mat2x3_f32;
/* 0x00c0 */ float2x4 mat2x4_f32; /* 0x00c0 */ float2x4 mat2x4_f32;
/* 0x00e0 */ float3x2 mat3x2_f32; /* 0x00e0 */ float3x2 mat3x2_f32;
/* 0x00f8 */ tint_array<int8_t, 8> tint_pad_7; /* 0x00f8 */ tint_array<int8_t, 8> tint_pad_8;
/* 0x0100 */ float3x3 mat3x3_f32; /* 0x0100 */ tint_array<tint_packed_vec3_f32_array_element, 3> mat3x3_f32;
/* 0x0130 */ float3x4 mat3x4_f32; /* 0x0130 */ float3x4 mat3x4_f32;
/* 0x0160 */ float4x2 mat4x2_f32; /* 0x0160 */ float4x2 mat4x2_f32;
/* 0x0180 */ float4x3 mat4x3_f32; /* 0x0180 */ tint_array<tint_packed_vec3_f32_array_element, 4> mat4x3_f32;
/* 0x01c0 */ float4x4 mat4x4_f32; /* 0x01c0 */ float4x4 mat4x4_f32;
/* 0x0200 */ tint_array<float3, 2> arr2_vec3_f32; /* 0x0200 */ tint_array<tint_packed_vec3_f32_array_element, 2> arr2_vec3_f32;
/* 0x0220 */ Inner struct_inner; /* 0x0220 */ Inner struct_inner;
/* 0x0240 */ tint_array<Inner, 4> array_struct_inner; /* 0x0240 */ tint_array<Inner, 4> array_struct_inner;
}; };
kernel void tint_symbol(const constant S* tint_symbol_1 [[buffer(0)]]) { float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
float4x3 result = float4x3(0.0f);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
tint_array<float3, 2> result = {};
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
struct S {
float scalar_f32;
int scalar_i32;
uint scalar_u32;
float2 vec2_f32;
int2 vec2_i32;
uint2 vec2_u32;
float3 vec3_f32;
int3 vec3_i32;
uint3 vec3_u32;
float4 vec4_f32;
int4 vec4_i32;
uint4 vec4_u32;
float2x2 mat2x2_f32;
float2x3 mat2x3_f32;
float2x4 mat2x4_f32;
float3x2 mat3x2_f32;
float3x3 mat3x3_f32;
float3x4 mat3x4_f32;
float4x2 mat4x2_f32;
float4x3 mat4x3_f32;
float4x4 mat4x4_f32;
tint_array<float3, 2> arr2_vec3_f32;
Inner struct_inner;
tint_array<Inner, 4> array_struct_inner;
};
kernel void tint_symbol(const constant S_tint_packed_vec3* tint_symbol_1 [[buffer(0)]]) {
float const scalar_f32 = (*(tint_symbol_1)).scalar_f32; float const scalar_f32 = (*(tint_symbol_1)).scalar_f32;
int const scalar_i32 = (*(tint_symbol_1)).scalar_i32; int const scalar_i32 = (*(tint_symbol_1)).scalar_i32;
uint const scalar_u32 = (*(tint_symbol_1)).scalar_u32; uint const scalar_u32 = (*(tint_symbol_1)).scalar_u32;
@ -68,15 +132,15 @@ kernel void tint_symbol(const constant S* tint_symbol_1 [[buffer(0)]]) {
int4 const vec4_i32 = (*(tint_symbol_1)).vec4_i32; int4 const vec4_i32 = (*(tint_symbol_1)).vec4_i32;
uint4 const vec4_u32 = (*(tint_symbol_1)).vec4_u32; uint4 const vec4_u32 = (*(tint_symbol_1)).vec4_u32;
float2x2 const mat2x2_f32 = (*(tint_symbol_1)).mat2x2_f32; float2x2 const mat2x2_f32 = (*(tint_symbol_1)).mat2x2_f32;
float2x3 const mat2x3_f32 = (*(tint_symbol_1)).mat2x3_f32; float2x3 const mat2x3_f32 = tint_unpack_vec3_in_composite((*(tint_symbol_1)).mat2x3_f32);
float2x4 const mat2x4_f32 = (*(tint_symbol_1)).mat2x4_f32; float2x4 const mat2x4_f32 = (*(tint_symbol_1)).mat2x4_f32;
float3x2 const mat3x2_f32 = (*(tint_symbol_1)).mat3x2_f32; float3x2 const mat3x2_f32 = (*(tint_symbol_1)).mat3x2_f32;
float3x3 const mat3x3_f32 = (*(tint_symbol_1)).mat3x3_f32; float3x3 const mat3x3_f32 = tint_unpack_vec3_in_composite_1((*(tint_symbol_1)).mat3x3_f32);
float3x4 const mat3x4_f32 = (*(tint_symbol_1)).mat3x4_f32; float3x4 const mat3x4_f32 = (*(tint_symbol_1)).mat3x4_f32;
float4x2 const mat4x2_f32 = (*(tint_symbol_1)).mat4x2_f32; float4x2 const mat4x2_f32 = (*(tint_symbol_1)).mat4x2_f32;
float4x3 const mat4x3_f32 = (*(tint_symbol_1)).mat4x3_f32; float4x3 const mat4x3_f32 = tint_unpack_vec3_in_composite_2((*(tint_symbol_1)).mat4x3_f32);
float4x4 const mat4x4_f32 = (*(tint_symbol_1)).mat4x4_f32; float4x4 const mat4x4_f32 = (*(tint_symbol_1)).mat4x4_f32;
tint_array<float3, 2> const arr2_vec3_f32 = (*(tint_symbol_1)).arr2_vec3_f32; tint_array<float3, 2> const arr2_vec3_f32 = tint_unpack_vec3_in_composite_3((*(tint_symbol_1)).arr2_vec3_f32);
Inner const struct_inner = (*(tint_symbol_1)).struct_inner; Inner const struct_inner = (*(tint_symbol_1)).struct_inner;
tint_array<Inner, 4> const array_struct_inner = (*(tint_symbol_1)).array_struct_inner; tint_array<Inner, 4> const array_struct_inner = (*(tint_symbol_1)).array_struct_inner;
return; return;

View File

@ -14,65 +14,172 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad_1;
};
struct Inner { struct Inner {
/* 0x0000 */ int scalar_i32; /* 0x0000 */ int scalar_i32;
/* 0x0004 */ float scalar_f32; /* 0x0004 */ float scalar_f32;
/* 0x0008 */ half scalar_f16; /* 0x0008 */ half scalar_f16;
/* 0x000a */ tint_array<int8_t, 6> tint_pad; /* 0x000a */ tint_array<int8_t, 6> tint_pad_2;
}; };
struct S { struct S_tint_packed_vec3 {
/* 0x0000 */ float scalar_f32; /* 0x0000 */ float scalar_f32;
/* 0x0004 */ int scalar_i32; /* 0x0004 */ int scalar_i32;
/* 0x0008 */ uint scalar_u32; /* 0x0008 */ uint scalar_u32;
/* 0x000c */ half scalar_f16; /* 0x000c */ half scalar_f16;
/* 0x000e */ tint_array<int8_t, 2> tint_pad_1; /* 0x000e */ tint_array<int8_t, 2> tint_pad_3;
/* 0x0010 */ float2 vec2_f32; /* 0x0010 */ float2 vec2_f32;
/* 0x0018 */ int2 vec2_i32; /* 0x0018 */ int2 vec2_i32;
/* 0x0020 */ uint2 vec2_u32; /* 0x0020 */ uint2 vec2_u32;
/* 0x0028 */ half2 vec2_f16; /* 0x0028 */ half2 vec2_f16;
/* 0x002c */ tint_array<int8_t, 4> tint_pad_2; /* 0x002c */ tint_array<int8_t, 4> tint_pad_4;
/* 0x0030 */ packed_float3 vec3_f32; /* 0x0030 */ packed_float3 vec3_f32;
/* 0x003c */ tint_array<int8_t, 4> tint_pad_3; /* 0x003c */ tint_array<int8_t, 4> tint_pad_5;
/* 0x0040 */ packed_int3 vec3_i32; /* 0x0040 */ packed_int3 vec3_i32;
/* 0x004c */ tint_array<int8_t, 4> tint_pad_4; /* 0x004c */ tint_array<int8_t, 4> tint_pad_6;
/* 0x0050 */ packed_uint3 vec3_u32; /* 0x0050 */ packed_uint3 vec3_u32;
/* 0x005c */ tint_array<int8_t, 4> tint_pad_5; /* 0x005c */ tint_array<int8_t, 4> tint_pad_7;
/* 0x0060 */ packed_half3 vec3_f16; /* 0x0060 */ packed_half3 vec3_f16;
/* 0x0066 */ tint_array<int8_t, 10> tint_pad_6; /* 0x0066 */ tint_array<int8_t, 10> tint_pad_8;
/* 0x0070 */ float4 vec4_f32; /* 0x0070 */ float4 vec4_f32;
/* 0x0080 */ int4 vec4_i32; /* 0x0080 */ int4 vec4_i32;
/* 0x0090 */ uint4 vec4_u32; /* 0x0090 */ uint4 vec4_u32;
/* 0x00a0 */ half4 vec4_f16; /* 0x00a0 */ half4 vec4_f16;
/* 0x00a8 */ float2x2 mat2x2_f32; /* 0x00a8 */ float2x2 mat2x2_f32;
/* 0x00b8 */ tint_array<int8_t, 8> tint_pad_7; /* 0x00b8 */ tint_array<int8_t, 8> tint_pad_9;
/* 0x00c0 */ float2x3 mat2x3_f32; /* 0x00c0 */ tint_array<tint_packed_vec3_f32_array_element, 2> mat2x3_f32;
/* 0x00e0 */ float2x4 mat2x4_f32; /* 0x00e0 */ float2x4 mat2x4_f32;
/* 0x0100 */ float3x2 mat3x2_f32; /* 0x0100 */ float3x2 mat3x2_f32;
/* 0x0118 */ tint_array<int8_t, 8> tint_pad_8; /* 0x0118 */ tint_array<int8_t, 8> tint_pad_10;
/* 0x0120 */ float3x3 mat3x3_f32; /* 0x0120 */ tint_array<tint_packed_vec3_f32_array_element, 3> mat3x3_f32;
/* 0x0150 */ float3x4 mat3x4_f32; /* 0x0150 */ float3x4 mat3x4_f32;
/* 0x0180 */ float4x2 mat4x2_f32; /* 0x0180 */ float4x2 mat4x2_f32;
/* 0x01a0 */ float4x3 mat4x3_f32; /* 0x01a0 */ tint_array<tint_packed_vec3_f32_array_element, 4> mat4x3_f32;
/* 0x01e0 */ float4x4 mat4x4_f32; /* 0x01e0 */ float4x4 mat4x4_f32;
/* 0x0220 */ half2x2 mat2x2_f16; /* 0x0220 */ half2x2 mat2x2_f16;
/* 0x0228 */ half2x3 mat2x3_f16; /* 0x0228 */ tint_array<tint_packed_vec3_f16_array_element, 2> mat2x3_f16;
/* 0x0238 */ half2x4 mat2x4_f16; /* 0x0238 */ half2x4 mat2x4_f16;
/* 0x0248 */ half3x2 mat3x2_f16; /* 0x0248 */ half3x2 mat3x2_f16;
/* 0x0254 */ tint_array<int8_t, 4> tint_pad_9; /* 0x0254 */ tint_array<int8_t, 4> tint_pad_11;
/* 0x0258 */ half3x3 mat3x3_f16; /* 0x0258 */ tint_array<tint_packed_vec3_f16_array_element, 3> mat3x3_f16;
/* 0x0270 */ half3x4 mat3x4_f16; /* 0x0270 */ half3x4 mat3x4_f16;
/* 0x0288 */ half4x2 mat4x2_f16; /* 0x0288 */ half4x2 mat4x2_f16;
/* 0x0298 */ half4x3 mat4x3_f16; /* 0x0298 */ tint_array<tint_packed_vec3_f16_array_element, 4> mat4x3_f16;
/* 0x02b8 */ half4x4 mat4x4_f16; /* 0x02b8 */ half4x4 mat4x4_f16;
/* 0x02d8 */ tint_array<int8_t, 8> tint_pad_10; /* 0x02d8 */ tint_array<int8_t, 8> tint_pad_12;
/* 0x02e0 */ tint_array<float3, 2> arr2_vec3_f32; /* 0x02e0 */ tint_array<tint_packed_vec3_f32_array_element, 2> arr2_vec3_f32;
/* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16; /* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16;
/* 0x0320 */ Inner struct_inner; /* 0x0320 */ Inner struct_inner;
/* 0x0330 */ tint_array<Inner, 4> array_struct_inner; /* 0x0330 */ tint_array<Inner, 4> array_struct_inner;
}; };
kernel void tint_symbol(const constant S* tint_symbol_1 [[buffer(0)]]) { float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
float4x3 result = float4x3(0.0f);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
half2x3 tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
half2x3 result = half2x3(0.0h);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
half3x3 tint_unpack_vec3_in_composite_4(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
half3x3 result = half3x3(0.0h);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
half4x3 tint_unpack_vec3_in_composite_5(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
half4x3 result = half4x3(0.0h);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_6(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
tint_array<float3, 2> result = {};
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
struct S {
float scalar_f32;
int scalar_i32;
uint scalar_u32;
half scalar_f16;
float2 vec2_f32;
int2 vec2_i32;
uint2 vec2_u32;
half2 vec2_f16;
float3 vec3_f32;
int3 vec3_i32;
uint3 vec3_u32;
half3 vec3_f16;
float4 vec4_f32;
int4 vec4_i32;
uint4 vec4_u32;
half4 vec4_f16;
float2x2 mat2x2_f32;
float2x3 mat2x3_f32;
float2x4 mat2x4_f32;
float3x2 mat3x2_f32;
float3x3 mat3x3_f32;
float3x4 mat3x4_f32;
float4x2 mat4x2_f32;
float4x3 mat4x3_f32;
float4x4 mat4x4_f32;
half2x2 mat2x2_f16;
half2x3 mat2x3_f16;
half2x4 mat2x4_f16;
half3x2 mat3x2_f16;
half3x3 mat3x3_f16;
half3x4 mat3x4_f16;
half4x2 mat4x2_f16;
half4x3 mat4x3_f16;
half4x4 mat4x4_f16;
tint_array<float3, 2> arr2_vec3_f32;
tint_array<half4x2, 2> arr2_mat4x2_f16;
Inner struct_inner;
tint_array<Inner, 4> array_struct_inner;
};
kernel void tint_symbol(const constant S_tint_packed_vec3* tint_symbol_1 [[buffer(0)]]) {
float const scalar_f32 = (*(tint_symbol_1)).scalar_f32; float const scalar_f32 = (*(tint_symbol_1)).scalar_f32;
int const scalar_i32 = (*(tint_symbol_1)).scalar_i32; int const scalar_i32 = (*(tint_symbol_1)).scalar_i32;
uint const scalar_u32 = (*(tint_symbol_1)).scalar_u32; uint const scalar_u32 = (*(tint_symbol_1)).scalar_u32;
@ -90,24 +197,24 @@ kernel void tint_symbol(const constant S* tint_symbol_1 [[buffer(0)]]) {
uint4 const vec4_u32 = (*(tint_symbol_1)).vec4_u32; uint4 const vec4_u32 = (*(tint_symbol_1)).vec4_u32;
half4 const vec4_f16 = (*(tint_symbol_1)).vec4_f16; half4 const vec4_f16 = (*(tint_symbol_1)).vec4_f16;
float2x2 const mat2x2_f32 = (*(tint_symbol_1)).mat2x2_f32; float2x2 const mat2x2_f32 = (*(tint_symbol_1)).mat2x2_f32;
float2x3 const mat2x3_f32 = (*(tint_symbol_1)).mat2x3_f32; float2x3 const mat2x3_f32 = tint_unpack_vec3_in_composite((*(tint_symbol_1)).mat2x3_f32);
float2x4 const mat2x4_f32 = (*(tint_symbol_1)).mat2x4_f32; float2x4 const mat2x4_f32 = (*(tint_symbol_1)).mat2x4_f32;
float3x2 const mat3x2_f32 = (*(tint_symbol_1)).mat3x2_f32; float3x2 const mat3x2_f32 = (*(tint_symbol_1)).mat3x2_f32;
float3x3 const mat3x3_f32 = (*(tint_symbol_1)).mat3x3_f32; float3x3 const mat3x3_f32 = tint_unpack_vec3_in_composite_1((*(tint_symbol_1)).mat3x3_f32);
float3x4 const mat3x4_f32 = (*(tint_symbol_1)).mat3x4_f32; float3x4 const mat3x4_f32 = (*(tint_symbol_1)).mat3x4_f32;
float4x2 const mat4x2_f32 = (*(tint_symbol_1)).mat4x2_f32; float4x2 const mat4x2_f32 = (*(tint_symbol_1)).mat4x2_f32;
float4x3 const mat4x3_f32 = (*(tint_symbol_1)).mat4x3_f32; float4x3 const mat4x3_f32 = tint_unpack_vec3_in_composite_2((*(tint_symbol_1)).mat4x3_f32);
float4x4 const mat4x4_f32 = (*(tint_symbol_1)).mat4x4_f32; float4x4 const mat4x4_f32 = (*(tint_symbol_1)).mat4x4_f32;
half2x2 const mat2x2_f16 = (*(tint_symbol_1)).mat2x2_f16; half2x2 const mat2x2_f16 = (*(tint_symbol_1)).mat2x2_f16;
half2x3 const mat2x3_f16 = (*(tint_symbol_1)).mat2x3_f16; half2x3 const mat2x3_f16 = tint_unpack_vec3_in_composite_3((*(tint_symbol_1)).mat2x3_f16);
half2x4 const mat2x4_f16 = (*(tint_symbol_1)).mat2x4_f16; half2x4 const mat2x4_f16 = (*(tint_symbol_1)).mat2x4_f16;
half3x2 const mat3x2_f16 = (*(tint_symbol_1)).mat3x2_f16; half3x2 const mat3x2_f16 = (*(tint_symbol_1)).mat3x2_f16;
half3x3 const mat3x3_f16 = (*(tint_symbol_1)).mat3x3_f16; half3x3 const mat3x3_f16 = tint_unpack_vec3_in_composite_4((*(tint_symbol_1)).mat3x3_f16);
half3x4 const mat3x4_f16 = (*(tint_symbol_1)).mat3x4_f16; half3x4 const mat3x4_f16 = (*(tint_symbol_1)).mat3x4_f16;
half4x2 const mat4x2_f16 = (*(tint_symbol_1)).mat4x2_f16; half4x2 const mat4x2_f16 = (*(tint_symbol_1)).mat4x2_f16;
half4x3 const mat4x3_f16 = (*(tint_symbol_1)).mat4x3_f16; half4x3 const mat4x3_f16 = tint_unpack_vec3_in_composite_5((*(tint_symbol_1)).mat4x3_f16);
half4x4 const mat4x4_f16 = (*(tint_symbol_1)).mat4x4_f16; half4x4 const mat4x4_f16 = (*(tint_symbol_1)).mat4x4_f16;
tint_array<float3, 2> const arr2_vec3_f32 = (*(tint_symbol_1)).arr2_vec3_f32; tint_array<float3, 2> const arr2_vec3_f32 = tint_unpack_vec3_in_composite_6((*(tint_symbol_1)).arr2_vec3_f32);
tint_array<half4x2, 2> const arr2_mat4x2_f16 = (*(tint_symbol_1)).arr2_mat4x2_f16; tint_array<half4x2, 2> const arr2_mat4x2_f16 = (*(tint_symbol_1)).arr2_mat4x2_f16;
Inner const struct_inner = (*(tint_symbol_1)).struct_inner; Inner const struct_inner = (*(tint_symbol_1)).struct_inner;
tint_array<Inner, 4> const array_struct_inner = (*(tint_symbol_1)).array_struct_inner; tint_array<Inner, 4> const array_struct_inner = (*(tint_symbol_1)).array_struct_inner;

View File

@ -16,8 +16,8 @@ struct tint_array {
kernel void f(const constant tint_array<float2x2, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<float2x2, 4>* tint_symbol [[buffer(0)]]) {
float2x2 const t = transpose((*(tint_symbol))[2]); float2x2 const t = transpose((*(tint_symbol))[2]);
float const l = length(float2((*(tint_symbol))[0][1]).yx); float const l = length((*(tint_symbol))[0][1].yx);
float const a = fabs(float2((*(tint_symbol))[0][1]).yx[0]); float const a = fabs((*(tint_symbol))[0][1].yx[0]);
return; return;
} }

View File

@ -29,8 +29,8 @@ void d(float f_1) {
kernel void f(const constant tint_array<float2x2, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<float2x2, 4>* tint_symbol [[buffer(0)]]) {
a(*(tint_symbol)); a(*(tint_symbol));
b((*(tint_symbol))[1]); b((*(tint_symbol))[1]);
c(float2((*(tint_symbol))[1][0]).yx); c((*(tint_symbol))[1][0].yx);
d(float2((*(tint_symbol))[1][0]).yx[0]); d((*(tint_symbol))[1][0].yx[0]);
return; return;
} }

View File

@ -18,7 +18,7 @@ kernel void f(const constant tint_array<float2x2, 4>* tint_symbol_1 [[buffer(0)]
thread tint_array<float2x2, 4> tint_symbol = {}; thread tint_array<float2x2, 4> tint_symbol = {};
tint_symbol = *(tint_symbol_1); tint_symbol = *(tint_symbol_1);
tint_symbol[1] = (*(tint_symbol_1))[2]; tint_symbol[1] = (*(tint_symbol_1))[2];
tint_symbol[1][0] = float2((*(tint_symbol_1))[0][1]).yx; tint_symbol[1][0] = (*(tint_symbol_1))[0][1].yx;
tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0]; tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0];
return; return;
} }

View File

@ -17,7 +17,7 @@ struct tint_array {
kernel void f(device tint_array<float2x2, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float2x2, 4>* tint_symbol_1 [[buffer(0)]]) { kernel void f(device tint_array<float2x2, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float2x2, 4>* tint_symbol_1 [[buffer(0)]]) {
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = *(tint_symbol_1);
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = (*(tint_symbol_1))[2];
(*(tint_symbol))[1][0] = float2((*(tint_symbol_1))[0][1]).yx; (*(tint_symbol))[1][0] = (*(tint_symbol_1))[0][1].yx;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
return; return;
} }

View File

@ -26,7 +26,7 @@ void f_inner(uint local_invocation_index, threadgroup tint_array<float2x2, 4>* c
threadgroup_barrier(mem_flags::mem_threadgroup); threadgroup_barrier(mem_flags::mem_threadgroup);
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = *(tint_symbol_1);
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = (*(tint_symbol_1))[2];
(*(tint_symbol))[1][0] = float2((*(tint_symbol_1))[0][1]).yx; (*(tint_symbol))[1][0] = (*(tint_symbol_1))[0][1].yx;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
} }

View File

@ -14,20 +14,41 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad;
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
half2x3 result = half2x3(0.0h);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
tint_array<half2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4> in) {
tint_array<half2x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
int i() { int i() {
thread int tint_symbol_2 = 0; thread int tint_symbol_2 = 0;
tint_symbol_2 = as_type<int>((as_type<uint>(tint_symbol_2) + as_type<uint>(1))); tint_symbol_2 = as_type<int>((as_type<uint>(tint_symbol_2) + as_type<uint>(1)));
return tint_symbol_2; return tint_symbol_2;
} }
kernel void f(const constant tint_array<half2x3, 4>* tint_symbol_3 [[buffer(0)]]) { kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4>* tint_symbol_3 [[buffer(0)]]) {
int const tint_symbol = i(); int const tint_symbol = i();
int const p_a_i_save = tint_symbol; int const p_a_i_save = tint_symbol;
int const tint_symbol_1 = i(); int const tint_symbol_1 = i();
int const p_a_i_i_save = tint_symbol_1; int const p_a_i_i_save = tint_symbol_1;
tint_array<half2x3, 4> const l_a = *(tint_symbol_3); tint_array<half2x3, 4> const l_a = tint_unpack_vec3_in_composite_1(*(tint_symbol_3));
half2x3 const l_a_i = (*(tint_symbol_3))[p_a_i_save]; half2x3 const l_a_i = tint_unpack_vec3_in_composite((*(tint_symbol_3))[p_a_i_save]);
half3 const l_a_i_i = (*(tint_symbol_3))[p_a_i_save][p_a_i_i_save]; half3 const l_a_i_i = half3((*(tint_symbol_3))[p_a_i_save][p_a_i_i_save].elements);
return; return;
} }

View File

@ -14,10 +14,31 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
kernel void f(const constant tint_array<half2x3, 4>* tint_symbol [[buffer(0)]]) { struct tint_packed_vec3_f16_array_element {
tint_array<half2x3, 4> const l_a = *(tint_symbol); /* 0x0000 */ packed_half3 elements;
half2x3 const l_a_i = (*(tint_symbol))[2]; /* 0x0006 */ tint_array<int8_t, 2> tint_pad;
half3 const l_a_i_i = (*(tint_symbol))[2][1]; };
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
half2x3 result = half2x3(0.0h);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
tint_array<half2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4> in) {
tint_array<half2x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4>* tint_symbol [[buffer(0)]]) {
tint_array<half2x3, 4> const l_a = tint_unpack_vec3_in_composite_1(*(tint_symbol));
half2x3 const l_a_i = tint_unpack_vec3_in_composite((*(tint_symbol))[2]);
half3 const l_a_i_i = half3((*(tint_symbol))[2][1].elements);
return; return;
} }

View File

@ -14,10 +14,23 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
kernel void f(const constant tint_array<half2x3, 4>* tint_symbol [[buffer(0)]]) { struct tint_packed_vec3_f16_array_element {
half3x2 const t = transpose((*(tint_symbol))[2]); /* 0x0000 */ packed_half3 elements;
half const l = length(half3((*(tint_symbol))[0][1]).zxy); /* 0x0006 */ tint_array<int8_t, 2> tint_pad;
half const a = fabs(half3((*(tint_symbol))[0][1]).zxy[0]); };
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
half2x3 result = half2x3(0.0h);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4>* tint_symbol [[buffer(0)]]) {
half3x2 const t = transpose(tint_unpack_vec3_in_composite((*(tint_symbol))[2]));
half const l = length(half3((*(tint_symbol))[0][1].elements).zxy);
half const a = fabs(half3((*(tint_symbol))[0][1].elements).zxy[0]);
return; return;
} }

View File

@ -14,6 +14,27 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad;
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
half2x3 result = half2x3(0.0h);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
tint_array<half2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4> in) {
tint_array<half2x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
void a(tint_array<half2x3, 4> a_1) { void a(tint_array<half2x3, 4> a_1) {
} }
@ -26,11 +47,11 @@ void c(half3 v) {
void d(half f_1) { void d(half f_1) {
} }
kernel void f(const constant tint_array<half2x3, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4>* tint_symbol [[buffer(0)]]) {
a(*(tint_symbol)); a(tint_unpack_vec3_in_composite_1(*(tint_symbol)));
b((*(tint_symbol))[1]); b(tint_unpack_vec3_in_composite((*(tint_symbol))[1]));
c(half3((*(tint_symbol))[1][0]).zxy); c(half3((*(tint_symbol))[1][0].elements).zxy);
d(half3((*(tint_symbol))[1][0]).zxy[0]); d(half3((*(tint_symbol))[1][0].elements).zxy[0]);
return; return;
} }

View File

@ -14,12 +14,33 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
kernel void f(const constant tint_array<half2x3, 4>* tint_symbol_1 [[buffer(0)]]) { struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad;
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
half2x3 result = half2x3(0.0h);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
tint_array<half2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4> in) {
tint_array<half2x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4>* tint_symbol_1 [[buffer(0)]]) {
thread tint_array<half2x3, 4> tint_symbol = {}; thread tint_array<half2x3, 4> tint_symbol = {};
tint_symbol = *(tint_symbol_1); tint_symbol = tint_unpack_vec3_in_composite_1(*(tint_symbol_1));
tint_symbol[1] = (*(tint_symbol_1))[2]; tint_symbol[1] = tint_unpack_vec3_in_composite((*(tint_symbol_1))[2]);
tint_symbol[1][0] = half3((*(tint_symbol_1))[0][1]).zxy; tint_symbol[1][0] = half3((*(tint_symbol_1))[0][1].elements).zxy;
tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0]; tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1].elements[0];
return; return;
} }

View File

@ -14,22 +14,43 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
void assign_and_preserve_padding_1(device half2x3* const dest, half2x3 value) { struct tint_packed_vec3_f16_array_element {
(*(dest))[0u] = value[0u]; /* 0x0000 */ packed_half3 elements;
(*(dest))[1u] = value[1u]; /* 0x0006 */ tint_array<int8_t, 2> tint_pad;
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
half2x3 result = half2x3(0.0h);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
} }
void assign_and_preserve_padding(device tint_array<half2x3, 4>* const dest, tint_array<half2x3, 4> value) { tint_array<half2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4> in) {
tint_array<half2x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
void assign_and_preserve_padding_1(device tint_array<tint_packed_vec3_f16_array_element, 2>* const dest, half2x3 value) {
(*(dest))[0u].elements = packed_half3(value[0u]);
(*(dest))[1u].elements = packed_half3(value[1u]);
}
void assign_and_preserve_padding(device tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4>* const dest, tint_array<half2x3, 4> value) {
for(uint i = 0u; (i < 4u); i = (i + 1u)) { for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]); assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
} }
} }
kernel void f(device tint_array<half2x3, 4>* tint_symbol [[buffer(1)]], const constant tint_array<half2x3, 4>* tint_symbol_1 [[buffer(0)]]) { kernel void f(device tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4>* tint_symbol [[buffer(1)]], const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4>* tint_symbol_1 [[buffer(0)]]) {
assign_and_preserve_padding(tint_symbol, *(tint_symbol_1)); assign_and_preserve_padding(tint_symbol, tint_unpack_vec3_in_composite_1(*(tint_symbol_1)));
assign_and_preserve_padding_1(&((*(tint_symbol))[1]), (*(tint_symbol_1))[2]); assign_and_preserve_padding_1(&((*(tint_symbol))[1]), tint_unpack_vec3_in_composite((*(tint_symbol_1))[2]));
(*(tint_symbol))[1][0] = half3((*(tint_symbol_1))[0][1]).zxy; (*(tint_symbol))[1][0].elements = packed_half3(half3((*(tint_symbol_1))[0][1].elements).zxy);
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0].elements[0] = (*(tint_symbol_1))[0][1].elements[0];
return; return;
} }

View File

@ -18,19 +18,40 @@ struct tint_symbol_5 {
tint_array<half2x3, 4> w; tint_array<half2x3, 4> w;
}; };
void f_inner(uint local_invocation_index, threadgroup tint_array<half2x3, 4>* const tint_symbol, const constant tint_array<half2x3, 4>* const tint_symbol_1) { struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad;
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
half2x3 result = half2x3(0.0h);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
tint_array<half2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4> in) {
tint_array<half2x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
void f_inner(uint local_invocation_index, threadgroup tint_array<half2x3, 4>* const tint_symbol, const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4>* const tint_symbol_1) {
for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx; uint const i = idx;
(*(tint_symbol))[i] = half2x3(half3(0.0h), half3(0.0h)); (*(tint_symbol))[i] = half2x3(half3(0.0h), half3(0.0h));
} }
threadgroup_barrier(mem_flags::mem_threadgroup); threadgroup_barrier(mem_flags::mem_threadgroup);
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = tint_unpack_vec3_in_composite_1(*(tint_symbol_1));
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = tint_unpack_vec3_in_composite((*(tint_symbol_1))[2]);
(*(tint_symbol))[1][0] = half3((*(tint_symbol_1))[0][1]).zxy; (*(tint_symbol))[1][0] = half3((*(tint_symbol_1))[0][1].elements).zxy;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1].elements[0];
} }
kernel void f(const constant tint_array<half2x3, 4>* tint_symbol_4 [[buffer(0)]], threadgroup tint_symbol_5* tint_symbol_3 [[threadgroup(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) { kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4>* tint_symbol_4 [[buffer(0)]], threadgroup tint_symbol_5* tint_symbol_3 [[threadgroup(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
threadgroup tint_array<half2x3, 4>* const tint_symbol_2 = &((*(tint_symbol_3)).w); threadgroup tint_array<half2x3, 4>* const tint_symbol_2 = &((*(tint_symbol_3)).w);
f_inner(local_invocation_index, tint_symbol_2, tint_symbol_4); f_inner(local_invocation_index, tint_symbol_2, tint_symbol_4);
return; return;

View File

@ -14,20 +14,41 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4> in) {
tint_array<float2x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
int i() { int i() {
thread int tint_symbol_2 = 0; thread int tint_symbol_2 = 0;
tint_symbol_2 = as_type<int>((as_type<uint>(tint_symbol_2) + as_type<uint>(1))); tint_symbol_2 = as_type<int>((as_type<uint>(tint_symbol_2) + as_type<uint>(1)));
return tint_symbol_2; return tint_symbol_2;
} }
kernel void f(const constant tint_array<float2x3, 4>* tint_symbol_3 [[buffer(0)]]) { kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4>* tint_symbol_3 [[buffer(0)]]) {
int const tint_symbol = i(); int const tint_symbol = i();
int const p_a_i_save = tint_symbol; int const p_a_i_save = tint_symbol;
int const tint_symbol_1 = i(); int const tint_symbol_1 = i();
int const p_a_i_i_save = tint_symbol_1; int const p_a_i_i_save = tint_symbol_1;
tint_array<float2x3, 4> const l_a = *(tint_symbol_3); tint_array<float2x3, 4> const l_a = tint_unpack_vec3_in_composite_1(*(tint_symbol_3));
float2x3 const l_a_i = (*(tint_symbol_3))[p_a_i_save]; float2x3 const l_a_i = tint_unpack_vec3_in_composite((*(tint_symbol_3))[p_a_i_save]);
float3 const l_a_i_i = (*(tint_symbol_3))[p_a_i_save][p_a_i_i_save]; float3 const l_a_i_i = float3((*(tint_symbol_3))[p_a_i_save][p_a_i_i_save].elements);
return; return;
} }

View File

@ -14,10 +14,31 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
kernel void f(const constant tint_array<float2x3, 4>* tint_symbol [[buffer(0)]]) { struct tint_packed_vec3_f32_array_element {
tint_array<float2x3, 4> const l_a = *(tint_symbol); /* 0x0000 */ packed_float3 elements;
float2x3 const l_a_i = (*(tint_symbol))[2]; /* 0x000c */ tint_array<int8_t, 4> tint_pad;
float3 const l_a_i_i = (*(tint_symbol))[2][1]; };
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4> in) {
tint_array<float2x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4>* tint_symbol [[buffer(0)]]) {
tint_array<float2x3, 4> const l_a = tint_unpack_vec3_in_composite_1(*(tint_symbol));
float2x3 const l_a_i = tint_unpack_vec3_in_composite((*(tint_symbol))[2]);
float3 const l_a_i_i = float3((*(tint_symbol))[2][1].elements);
return; return;
} }

View File

@ -14,10 +14,23 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
kernel void f(const constant tint_array<float2x3, 4>* tint_symbol [[buffer(0)]]) { struct tint_packed_vec3_f32_array_element {
float3x2 const t = transpose((*(tint_symbol))[2]); /* 0x0000 */ packed_float3 elements;
float const l = length(float3((*(tint_symbol))[0][1]).zxy); /* 0x000c */ tint_array<int8_t, 4> tint_pad;
float const a = fabs(float3((*(tint_symbol))[0][1]).zxy[0]); };
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4>* tint_symbol [[buffer(0)]]) {
float3x2 const t = transpose(tint_unpack_vec3_in_composite((*(tint_symbol))[2]));
float const l = length(float3((*(tint_symbol))[0][1].elements).zxy);
float const a = fabs(float3((*(tint_symbol))[0][1].elements).zxy[0]);
return; return;
} }

View File

@ -14,6 +14,27 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4> in) {
tint_array<float2x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
void a(tint_array<float2x3, 4> a_1) { void a(tint_array<float2x3, 4> a_1) {
} }
@ -26,11 +47,11 @@ void c(float3 v) {
void d(float f_1) { void d(float f_1) {
} }
kernel void f(const constant tint_array<float2x3, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4>* tint_symbol [[buffer(0)]]) {
a(*(tint_symbol)); a(tint_unpack_vec3_in_composite_1(*(tint_symbol)));
b((*(tint_symbol))[1]); b(tint_unpack_vec3_in_composite((*(tint_symbol))[1]));
c(float3((*(tint_symbol))[1][0]).zxy); c(float3((*(tint_symbol))[1][0].elements).zxy);
d(float3((*(tint_symbol))[1][0]).zxy[0]); d(float3((*(tint_symbol))[1][0].elements).zxy[0]);
return; return;
} }

View File

@ -14,12 +14,33 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
kernel void f(const constant tint_array<float2x3, 4>* tint_symbol_1 [[buffer(0)]]) { struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4> in) {
tint_array<float2x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4>* tint_symbol_1 [[buffer(0)]]) {
thread tint_array<float2x3, 4> tint_symbol = {}; thread tint_array<float2x3, 4> tint_symbol = {};
tint_symbol = *(tint_symbol_1); tint_symbol = tint_unpack_vec3_in_composite_1(*(tint_symbol_1));
tint_symbol[1] = (*(tint_symbol_1))[2]; tint_symbol[1] = tint_unpack_vec3_in_composite((*(tint_symbol_1))[2]);
tint_symbol[1][0] = float3((*(tint_symbol_1))[0][1]).zxy; tint_symbol[1][0] = float3((*(tint_symbol_1))[0][1].elements).zxy;
tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0]; tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1].elements[0];
return; return;
} }

View File

@ -14,22 +14,43 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
void assign_and_preserve_padding_1(device float2x3* const dest, float2x3 value) { struct tint_packed_vec3_f32_array_element {
(*(dest))[0u] = value[0u]; /* 0x0000 */ packed_float3 elements;
(*(dest))[1u] = value[1u]; /* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
} }
void assign_and_preserve_padding(device tint_array<float2x3, 4>* const dest, tint_array<float2x3, 4> value) { tint_array<float2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4> in) {
tint_array<float2x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
void assign_and_preserve_padding_1(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, float2x3 value) {
(*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u].elements = packed_float3(value[1u]);
}
void assign_and_preserve_padding(device tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4>* const dest, tint_array<float2x3, 4> value) {
for(uint i = 0u; (i < 4u); i = (i + 1u)) { for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]); assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
} }
} }
kernel void f(device tint_array<float2x3, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float2x3, 4>* tint_symbol_1 [[buffer(0)]]) { kernel void f(device tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4>* tint_symbol [[buffer(1)]], const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4>* tint_symbol_1 [[buffer(0)]]) {
assign_and_preserve_padding(tint_symbol, *(tint_symbol_1)); assign_and_preserve_padding(tint_symbol, tint_unpack_vec3_in_composite_1(*(tint_symbol_1)));
assign_and_preserve_padding_1(&((*(tint_symbol))[1]), (*(tint_symbol_1))[2]); assign_and_preserve_padding_1(&((*(tint_symbol))[1]), tint_unpack_vec3_in_composite((*(tint_symbol_1))[2]));
(*(tint_symbol))[1][0] = float3((*(tint_symbol_1))[0][1]).zxy; (*(tint_symbol))[1][0].elements = packed_float3(float3((*(tint_symbol_1))[0][1].elements).zxy);
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0].elements[0] = (*(tint_symbol_1))[0][1].elements[0];
return; return;
} }

View File

@ -18,19 +18,40 @@ struct tint_symbol_5 {
tint_array<float2x3, 4> w; tint_array<float2x3, 4> w;
}; };
void f_inner(uint local_invocation_index, threadgroup tint_array<float2x3, 4>* const tint_symbol, const constant tint_array<float2x3, 4>* const tint_symbol_1) { struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
float2x3 result = float2x3(0.0f);
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4> in) {
tint_array<float2x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
void f_inner(uint local_invocation_index, threadgroup tint_array<float2x3, 4>* const tint_symbol, const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4>* const tint_symbol_1) {
for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx; uint const i = idx;
(*(tint_symbol))[i] = float2x3(float3(0.0f), float3(0.0f)); (*(tint_symbol))[i] = float2x3(float3(0.0f), float3(0.0f));
} }
threadgroup_barrier(mem_flags::mem_threadgroup); threadgroup_barrier(mem_flags::mem_threadgroup);
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = tint_unpack_vec3_in_composite_1(*(tint_symbol_1));
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = tint_unpack_vec3_in_composite((*(tint_symbol_1))[2]);
(*(tint_symbol))[1][0] = float3((*(tint_symbol_1))[0][1]).zxy; (*(tint_symbol))[1][0] = float3((*(tint_symbol_1))[0][1].elements).zxy;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1].elements[0];
} }
kernel void f(const constant tint_array<float2x3, 4>* tint_symbol_4 [[buffer(0)]], threadgroup tint_symbol_5* tint_symbol_3 [[threadgroup(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) { kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4>* tint_symbol_4 [[buffer(0)]], threadgroup tint_symbol_5* tint_symbol_3 [[threadgroup(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
threadgroup tint_array<float2x3, 4>* const tint_symbol_2 = &((*(tint_symbol_3)).w); threadgroup tint_array<float2x3, 4>* const tint_symbol_2 = &((*(tint_symbol_3)).w);
f_inner(local_invocation_index, tint_symbol_2, tint_symbol_4); f_inner(local_invocation_index, tint_symbol_2, tint_symbol_4);
return; return;

View File

@ -16,8 +16,8 @@ struct tint_array {
kernel void f(const constant tint_array<half2x4, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<half2x4, 4>* tint_symbol [[buffer(0)]]) {
half4x2 const t = transpose((*(tint_symbol))[2]); half4x2 const t = transpose((*(tint_symbol))[2]);
half const l = length(half4((*(tint_symbol))[0][1]).ywxz); half const l = length((*(tint_symbol))[0][1].ywxz);
half const a = fabs(half4((*(tint_symbol))[0][1]).ywxz[0]); half const a = fabs((*(tint_symbol))[0][1].ywxz[0]);
return; return;
} }

View File

@ -29,8 +29,8 @@ void d(half f_1) {
kernel void f(const constant tint_array<half2x4, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<half2x4, 4>* tint_symbol [[buffer(0)]]) {
a(*(tint_symbol)); a(*(tint_symbol));
b((*(tint_symbol))[1]); b((*(tint_symbol))[1]);
c(half4((*(tint_symbol))[1][0]).ywxz); c((*(tint_symbol))[1][0].ywxz);
d(half4((*(tint_symbol))[1][0]).ywxz[0]); d((*(tint_symbol))[1][0].ywxz[0]);
return; return;
} }

View File

@ -18,7 +18,7 @@ kernel void f(const constant tint_array<half2x4, 4>* tint_symbol_1 [[buffer(0)]]
thread tint_array<half2x4, 4> tint_symbol = {}; thread tint_array<half2x4, 4> tint_symbol = {};
tint_symbol = *(tint_symbol_1); tint_symbol = *(tint_symbol_1);
tint_symbol[1] = (*(tint_symbol_1))[2]; tint_symbol[1] = (*(tint_symbol_1))[2];
tint_symbol[1][0] = half4((*(tint_symbol_1))[0][1]).ywxz; tint_symbol[1][0] = (*(tint_symbol_1))[0][1].ywxz;
tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0]; tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0];
return; return;
} }

View File

@ -17,7 +17,7 @@ struct tint_array {
kernel void f(device tint_array<half2x4, 4>* tint_symbol [[buffer(1)]], const constant tint_array<half2x4, 4>* tint_symbol_1 [[buffer(0)]]) { kernel void f(device tint_array<half2x4, 4>* tint_symbol [[buffer(1)]], const constant tint_array<half2x4, 4>* tint_symbol_1 [[buffer(0)]]) {
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = *(tint_symbol_1);
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = (*(tint_symbol_1))[2];
(*(tint_symbol))[1][0] = half4((*(tint_symbol_1))[0][1]).ywxz; (*(tint_symbol))[1][0] = (*(tint_symbol_1))[0][1].ywxz;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
return; return;
} }

View File

@ -26,7 +26,7 @@ void f_inner(uint local_invocation_index, threadgroup tint_array<half2x4, 4>* co
threadgroup_barrier(mem_flags::mem_threadgroup); threadgroup_barrier(mem_flags::mem_threadgroup);
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = *(tint_symbol_1);
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = (*(tint_symbol_1))[2];
(*(tint_symbol))[1][0] = half4((*(tint_symbol_1))[0][1]).ywxz; (*(tint_symbol))[1][0] = (*(tint_symbol_1))[0][1].ywxz;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
} }

View File

@ -16,8 +16,8 @@ struct tint_array {
kernel void f(const constant tint_array<float2x4, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<float2x4, 4>* tint_symbol [[buffer(0)]]) {
float4x2 const t = transpose((*(tint_symbol))[2]); float4x2 const t = transpose((*(tint_symbol))[2]);
float const l = length(float4((*(tint_symbol))[0][1]).ywxz); float const l = length((*(tint_symbol))[0][1].ywxz);
float const a = fabs(float4((*(tint_symbol))[0][1]).ywxz[0]); float const a = fabs((*(tint_symbol))[0][1].ywxz[0]);
return; return;
} }

View File

@ -29,8 +29,8 @@ void d(float f_1) {
kernel void f(const constant tint_array<float2x4, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<float2x4, 4>* tint_symbol [[buffer(0)]]) {
a(*(tint_symbol)); a(*(tint_symbol));
b((*(tint_symbol))[1]); b((*(tint_symbol))[1]);
c(float4((*(tint_symbol))[1][0]).ywxz); c((*(tint_symbol))[1][0].ywxz);
d(float4((*(tint_symbol))[1][0]).ywxz[0]); d((*(tint_symbol))[1][0].ywxz[0]);
return; return;
} }

View File

@ -18,7 +18,7 @@ kernel void f(const constant tint_array<float2x4, 4>* tint_symbol_1 [[buffer(0)]
thread tint_array<float2x4, 4> tint_symbol = {}; thread tint_array<float2x4, 4> tint_symbol = {};
tint_symbol = *(tint_symbol_1); tint_symbol = *(tint_symbol_1);
tint_symbol[1] = (*(tint_symbol_1))[2]; tint_symbol[1] = (*(tint_symbol_1))[2];
tint_symbol[1][0] = float4((*(tint_symbol_1))[0][1]).ywxz; tint_symbol[1][0] = (*(tint_symbol_1))[0][1].ywxz;
tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0]; tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0];
return; return;
} }

View File

@ -17,7 +17,7 @@ struct tint_array {
kernel void f(device tint_array<float2x4, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float2x4, 4>* tint_symbol_1 [[buffer(0)]]) { kernel void f(device tint_array<float2x4, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float2x4, 4>* tint_symbol_1 [[buffer(0)]]) {
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = *(tint_symbol_1);
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = (*(tint_symbol_1))[2];
(*(tint_symbol))[1][0] = float4((*(tint_symbol_1))[0][1]).ywxz; (*(tint_symbol))[1][0] = (*(tint_symbol_1))[0][1].ywxz;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
return; return;
} }

View File

@ -26,7 +26,7 @@ void f_inner(uint local_invocation_index, threadgroup tint_array<float2x4, 4>* c
threadgroup_barrier(mem_flags::mem_threadgroup); threadgroup_barrier(mem_flags::mem_threadgroup);
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = *(tint_symbol_1);
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = (*(tint_symbol_1))[2];
(*(tint_symbol))[1][0] = float4((*(tint_symbol_1))[0][1]).ywxz; (*(tint_symbol))[1][0] = (*(tint_symbol_1))[0][1].ywxz;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
} }

View File

@ -14,20 +14,41 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) {
tint_array<float3x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
int i() { int i() {
thread int tint_symbol_2 = 0; thread int tint_symbol_2 = 0;
tint_symbol_2 = as_type<int>((as_type<uint>(tint_symbol_2) + as_type<uint>(1))); tint_symbol_2 = as_type<int>((as_type<uint>(tint_symbol_2) + as_type<uint>(1)));
return tint_symbol_2; return tint_symbol_2;
} }
kernel void f(const constant tint_array<float3x3, 4>* tint_symbol_3 [[buffer(0)]]) { kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* tint_symbol_3 [[buffer(0)]]) {
int const tint_symbol = i(); int const tint_symbol = i();
int const p_a_i_save = tint_symbol; int const p_a_i_save = tint_symbol;
int const tint_symbol_1 = i(); int const tint_symbol_1 = i();
int const p_a_i_i_save = tint_symbol_1; int const p_a_i_i_save = tint_symbol_1;
tint_array<float3x3, 4> const l_a = *(tint_symbol_3); tint_array<float3x3, 4> const l_a = tint_unpack_vec3_in_composite_1(*(tint_symbol_3));
float3x3 const l_a_i = (*(tint_symbol_3))[p_a_i_save]; float3x3 const l_a_i = tint_unpack_vec3_in_composite((*(tint_symbol_3))[p_a_i_save]);
float3 const l_a_i_i = (*(tint_symbol_3))[p_a_i_save][p_a_i_i_save]; float3 const l_a_i_i = float3((*(tint_symbol_3))[p_a_i_save][p_a_i_i_save].elements);
return; return;
} }

View File

@ -14,10 +14,31 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
kernel void f(const constant tint_array<float3x3, 4>* tint_symbol [[buffer(0)]]) { struct tint_packed_vec3_f32_array_element {
tint_array<float3x3, 4> const l_a = *(tint_symbol); /* 0x0000 */ packed_float3 elements;
float3x3 const l_a_i = (*(tint_symbol))[2]; /* 0x000c */ tint_array<int8_t, 4> tint_pad;
float3 const l_a_i_i = (*(tint_symbol))[2][1]; };
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) {
tint_array<float3x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* tint_symbol [[buffer(0)]]) {
tint_array<float3x3, 4> const l_a = tint_unpack_vec3_in_composite_1(*(tint_symbol));
float3x3 const l_a_i = tint_unpack_vec3_in_composite((*(tint_symbol))[2]);
float3 const l_a_i_i = float3((*(tint_symbol))[2][1].elements);
return; return;
} }

View File

@ -14,10 +14,23 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
kernel void f(const constant tint_array<float3x3, 4>* tint_symbol [[buffer(0)]]) { struct tint_packed_vec3_f32_array_element {
float3x3 const t = transpose((*(tint_symbol))[2]); /* 0x0000 */ packed_float3 elements;
float const l = length(float3((*(tint_symbol))[0][1]).zxy); /* 0x000c */ tint_array<int8_t, 4> tint_pad;
float const a = fabs(float3((*(tint_symbol))[0][1]).zxy[0]); };
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* tint_symbol [[buffer(0)]]) {
float3x3 const t = transpose(tint_unpack_vec3_in_composite((*(tint_symbol))[2]));
float const l = length(float3((*(tint_symbol))[0][1].elements).zxy);
float const a = fabs(float3((*(tint_symbol))[0][1].elements).zxy[0]);
return; return;
} }

View File

@ -14,6 +14,27 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) {
tint_array<float3x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
void a(tint_array<float3x3, 4> a_1) { void a(tint_array<float3x3, 4> a_1) {
} }
@ -26,11 +47,11 @@ void c(float3 v) {
void d(float f_1) { void d(float f_1) {
} }
kernel void f(const constant tint_array<float3x3, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* tint_symbol [[buffer(0)]]) {
a(*(tint_symbol)); a(tint_unpack_vec3_in_composite_1(*(tint_symbol)));
b((*(tint_symbol))[1]); b(tint_unpack_vec3_in_composite((*(tint_symbol))[1]));
c(float3((*(tint_symbol))[1][0]).zxy); c(float3((*(tint_symbol))[1][0].elements).zxy);
d(float3((*(tint_symbol))[1][0]).zxy[0]); d(float3((*(tint_symbol))[1][0].elements).zxy[0]);
return; return;
} }

View File

@ -14,12 +14,33 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
kernel void f(const constant tint_array<float3x3, 4>* tint_symbol_1 [[buffer(0)]]) { struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) {
tint_array<float3x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* tint_symbol_1 [[buffer(0)]]) {
thread tint_array<float3x3, 4> tint_symbol = {}; thread tint_array<float3x3, 4> tint_symbol = {};
tint_symbol = *(tint_symbol_1); tint_symbol = tint_unpack_vec3_in_composite_1(*(tint_symbol_1));
tint_symbol[1] = (*(tint_symbol_1))[2]; tint_symbol[1] = tint_unpack_vec3_in_composite((*(tint_symbol_1))[2]);
tint_symbol[1][0] = float3((*(tint_symbol_1))[0][1]).zxy; tint_symbol[1][0] = float3((*(tint_symbol_1))[0][1].elements).zxy;
tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0]; tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1].elements[0];
return; return;
} }

View File

@ -14,23 +14,44 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
void assign_and_preserve_padding_1(device float3x3* const dest, float3x3 value) { struct tint_packed_vec3_f32_array_element {
(*(dest))[0u] = value[0u]; /* 0x0000 */ packed_float3 elements;
(*(dest))[1u] = value[1u]; /* 0x000c */ tint_array<int8_t, 4> tint_pad;
(*(dest))[2u] = value[2u]; };
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
} }
void assign_and_preserve_padding(device tint_array<float3x3, 4>* const dest, tint_array<float3x3, 4> value) { tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) {
tint_array<float3x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
void assign_and_preserve_padding_1(device tint_array<tint_packed_vec3_f32_array_element, 3>* const dest, float3x3 value) {
(*(dest))[0u].elements = packed_float3(value[0u]);
(*(dest))[1u].elements = packed_float3(value[1u]);
(*(dest))[2u].elements = packed_float3(value[2u]);
}
void assign_and_preserve_padding(device tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* const dest, tint_array<float3x3, 4> value) {
for(uint i = 0u; (i < 4u); i = (i + 1u)) { for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]); assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
} }
} }
kernel void f(device tint_array<float3x3, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float3x3, 4>* tint_symbol_1 [[buffer(0)]]) { kernel void f(device tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* tint_symbol [[buffer(1)]], const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* tint_symbol_1 [[buffer(0)]]) {
assign_and_preserve_padding(tint_symbol, *(tint_symbol_1)); assign_and_preserve_padding(tint_symbol, tint_unpack_vec3_in_composite_1(*(tint_symbol_1)));
assign_and_preserve_padding_1(&((*(tint_symbol))[1]), (*(tint_symbol_1))[2]); assign_and_preserve_padding_1(&((*(tint_symbol))[1]), tint_unpack_vec3_in_composite((*(tint_symbol_1))[2]));
(*(tint_symbol))[1][0] = float3((*(tint_symbol_1))[0][1]).zxy; (*(tint_symbol))[1][0].elements = packed_float3(float3((*(tint_symbol_1))[0][1].elements).zxy);
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0].elements[0] = (*(tint_symbol_1))[0][1].elements[0];
return; return;
} }

View File

@ -18,19 +18,40 @@ struct tint_symbol_5 {
tint_array<float3x3, 4> w; tint_array<float3x3, 4> w;
}; };
void f_inner(uint local_invocation_index, threadgroup tint_array<float3x3, 4>* const tint_symbol, const constant tint_array<float3x3, 4>* const tint_symbol_1) { struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
/* 0x000c */ tint_array<int8_t, 4> tint_pad;
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
float3x3 result = float3x3(0.0f);
for(uint i = 0u; (i < 3u); i = (i + 1u)) {
result[i] = float3(in[i].elements);
}
return result;
}
tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) {
tint_array<float3x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
void f_inner(uint local_invocation_index, threadgroup tint_array<float3x3, 4>* const tint_symbol, const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* const tint_symbol_1) {
for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx; uint const i = idx;
(*(tint_symbol))[i] = float3x3(float3(0.0f), float3(0.0f), float3(0.0f)); (*(tint_symbol))[i] = float3x3(float3(0.0f), float3(0.0f), float3(0.0f));
} }
threadgroup_barrier(mem_flags::mem_threadgroup); threadgroup_barrier(mem_flags::mem_threadgroup);
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = tint_unpack_vec3_in_composite_1(*(tint_symbol_1));
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = tint_unpack_vec3_in_composite((*(tint_symbol_1))[2]);
(*(tint_symbol))[1][0] = float3((*(tint_symbol_1))[0][1]).zxy; (*(tint_symbol))[1][0] = float3((*(tint_symbol_1))[0][1].elements).zxy;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1].elements[0];
} }
kernel void f(const constant tint_array<float3x3, 4>* tint_symbol_4 [[buffer(0)]], threadgroup tint_symbol_5* tint_symbol_3 [[threadgroup(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) { kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* tint_symbol_4 [[buffer(0)]], threadgroup tint_symbol_5* tint_symbol_3 [[threadgroup(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
threadgroup tint_array<float3x3, 4>* const tint_symbol_2 = &((*(tint_symbol_3)).w); threadgroup tint_array<float3x3, 4>* const tint_symbol_2 = &((*(tint_symbol_3)).w);
f_inner(local_invocation_index, tint_symbol_2, tint_symbol_4); f_inner(local_invocation_index, tint_symbol_2, tint_symbol_4);
return; return;

View File

@ -16,8 +16,8 @@ struct tint_array {
kernel void f(const constant tint_array<float3x4, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<float3x4, 4>* tint_symbol [[buffer(0)]]) {
float4x3 const t = transpose((*(tint_symbol))[2]); float4x3 const t = transpose((*(tint_symbol))[2]);
float const l = length(float4((*(tint_symbol))[0][1]).ywxz); float const l = length((*(tint_symbol))[0][1].ywxz);
float const a = fabs(float4((*(tint_symbol))[0][1]).ywxz[0]); float const a = fabs((*(tint_symbol))[0][1].ywxz[0]);
return; return;
} }

View File

@ -29,8 +29,8 @@ void d(float f_1) {
kernel void f(const constant tint_array<float3x4, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<float3x4, 4>* tint_symbol [[buffer(0)]]) {
a(*(tint_symbol)); a(*(tint_symbol));
b((*(tint_symbol))[1]); b((*(tint_symbol))[1]);
c(float4((*(tint_symbol))[1][0]).ywxz); c((*(tint_symbol))[1][0].ywxz);
d(float4((*(tint_symbol))[1][0]).ywxz[0]); d((*(tint_symbol))[1][0].ywxz[0]);
return; return;
} }

View File

@ -18,7 +18,7 @@ kernel void f(const constant tint_array<float3x4, 4>* tint_symbol_1 [[buffer(0)]
thread tint_array<float3x4, 4> tint_symbol = {}; thread tint_array<float3x4, 4> tint_symbol = {};
tint_symbol = *(tint_symbol_1); tint_symbol = *(tint_symbol_1);
tint_symbol[1] = (*(tint_symbol_1))[2]; tint_symbol[1] = (*(tint_symbol_1))[2];
tint_symbol[1][0] = float4((*(tint_symbol_1))[0][1]).ywxz; tint_symbol[1][0] = (*(tint_symbol_1))[0][1].ywxz;
tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0]; tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0];
return; return;
} }

View File

@ -17,7 +17,7 @@ struct tint_array {
kernel void f(device tint_array<float3x4, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float3x4, 4>* tint_symbol_1 [[buffer(0)]]) { kernel void f(device tint_array<float3x4, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float3x4, 4>* tint_symbol_1 [[buffer(0)]]) {
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = *(tint_symbol_1);
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = (*(tint_symbol_1))[2];
(*(tint_symbol))[1][0] = float4((*(tint_symbol_1))[0][1]).ywxz; (*(tint_symbol))[1][0] = (*(tint_symbol_1))[0][1].ywxz;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
return; return;
} }

View File

@ -26,7 +26,7 @@ void f_inner(uint local_invocation_index, threadgroup tint_array<float3x4, 4>* c
threadgroup_barrier(mem_flags::mem_threadgroup); threadgroup_barrier(mem_flags::mem_threadgroup);
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = *(tint_symbol_1);
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = (*(tint_symbol_1))[2];
(*(tint_symbol))[1][0] = float4((*(tint_symbol_1))[0][1]).ywxz; (*(tint_symbol))[1][0] = (*(tint_symbol_1))[0][1].ywxz;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
} }

View File

@ -16,8 +16,8 @@ struct tint_array {
kernel void f(const constant tint_array<half4x2, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<half4x2, 4>* tint_symbol [[buffer(0)]]) {
half2x4 const t = transpose((*(tint_symbol))[2]); half2x4 const t = transpose((*(tint_symbol))[2]);
half const l = length(half2((*(tint_symbol))[0][1]).yx); half const l = length((*(tint_symbol))[0][1].yx);
half const a = fabs(half2((*(tint_symbol))[0][1]).yx[0]); half const a = fabs((*(tint_symbol))[0][1].yx[0]);
return; return;
} }

View File

@ -29,8 +29,8 @@ void d(half f_1) {
kernel void f(const constant tint_array<half4x2, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<half4x2, 4>* tint_symbol [[buffer(0)]]) {
a(*(tint_symbol)); a(*(tint_symbol));
b((*(tint_symbol))[1]); b((*(tint_symbol))[1]);
c(half2((*(tint_symbol))[1][0]).yx); c((*(tint_symbol))[1][0].yx);
d(half2((*(tint_symbol))[1][0]).yx[0]); d((*(tint_symbol))[1][0].yx[0]);
return; return;
} }

View File

@ -18,7 +18,7 @@ kernel void f(const constant tint_array<half4x2, 4>* tint_symbol_1 [[buffer(0)]]
thread tint_array<half4x2, 4> tint_symbol = {}; thread tint_array<half4x2, 4> tint_symbol = {};
tint_symbol = *(tint_symbol_1); tint_symbol = *(tint_symbol_1);
tint_symbol[1] = (*(tint_symbol_1))[2]; tint_symbol[1] = (*(tint_symbol_1))[2];
tint_symbol[1][0] = half2((*(tint_symbol_1))[0][1]).yx; tint_symbol[1][0] = (*(tint_symbol_1))[0][1].yx;
tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0]; tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0];
return; return;
} }

View File

@ -17,7 +17,7 @@ struct tint_array {
kernel void f(device tint_array<half4x2, 4>* tint_symbol [[buffer(1)]], const constant tint_array<half4x2, 4>* tint_symbol_1 [[buffer(0)]]) { kernel void f(device tint_array<half4x2, 4>* tint_symbol [[buffer(1)]], const constant tint_array<half4x2, 4>* tint_symbol_1 [[buffer(0)]]) {
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = *(tint_symbol_1);
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = (*(tint_symbol_1))[2];
(*(tint_symbol))[1][0] = half2((*(tint_symbol_1))[0][1]).yx; (*(tint_symbol))[1][0] = (*(tint_symbol_1))[0][1].yx;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
return; return;
} }

View File

@ -26,7 +26,7 @@ void f_inner(uint local_invocation_index, threadgroup tint_array<half4x2, 4>* co
threadgroup_barrier(mem_flags::mem_threadgroup); threadgroup_barrier(mem_flags::mem_threadgroup);
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = *(tint_symbol_1);
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = (*(tint_symbol_1))[2];
(*(tint_symbol))[1][0] = half2((*(tint_symbol_1))[0][1]).yx; (*(tint_symbol))[1][0] = (*(tint_symbol_1))[0][1].yx;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
} }

View File

@ -16,8 +16,8 @@ struct tint_array {
kernel void f(const constant tint_array<float4x2, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<float4x2, 4>* tint_symbol [[buffer(0)]]) {
float2x4 const t = transpose((*(tint_symbol))[2]); float2x4 const t = transpose((*(tint_symbol))[2]);
float const l = length(float2((*(tint_symbol))[0][1]).yx); float const l = length((*(tint_symbol))[0][1].yx);
float const a = fabs(float2((*(tint_symbol))[0][1]).yx[0]); float const a = fabs((*(tint_symbol))[0][1].yx[0]);
return; return;
} }

View File

@ -29,8 +29,8 @@ void d(float f_1) {
kernel void f(const constant tint_array<float4x2, 4>* tint_symbol [[buffer(0)]]) { kernel void f(const constant tint_array<float4x2, 4>* tint_symbol [[buffer(0)]]) {
a(*(tint_symbol)); a(*(tint_symbol));
b((*(tint_symbol))[1]); b((*(tint_symbol))[1]);
c(float2((*(tint_symbol))[1][0]).yx); c((*(tint_symbol))[1][0].yx);
d(float2((*(tint_symbol))[1][0]).yx[0]); d((*(tint_symbol))[1][0].yx[0]);
return; return;
} }

View File

@ -18,7 +18,7 @@ kernel void f(const constant tint_array<float4x2, 4>* tint_symbol_1 [[buffer(0)]
thread tint_array<float4x2, 4> tint_symbol = {}; thread tint_array<float4x2, 4> tint_symbol = {};
tint_symbol = *(tint_symbol_1); tint_symbol = *(tint_symbol_1);
tint_symbol[1] = (*(tint_symbol_1))[2]; tint_symbol[1] = (*(tint_symbol_1))[2];
tint_symbol[1][0] = float2((*(tint_symbol_1))[0][1]).yx; tint_symbol[1][0] = (*(tint_symbol_1))[0][1].yx;
tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0]; tint_symbol[1][0][0] = (*(tint_symbol_1))[0][1][0];
return; return;
} }

View File

@ -17,7 +17,7 @@ struct tint_array {
kernel void f(device tint_array<float4x2, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float4x2, 4>* tint_symbol_1 [[buffer(0)]]) { kernel void f(device tint_array<float4x2, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float4x2, 4>* tint_symbol_1 [[buffer(0)]]) {
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = *(tint_symbol_1);
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = (*(tint_symbol_1))[2];
(*(tint_symbol))[1][0] = float2((*(tint_symbol_1))[0][1]).yx; (*(tint_symbol))[1][0] = (*(tint_symbol_1))[0][1].yx;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
return; return;
} }

View File

@ -26,7 +26,7 @@ void f_inner(uint local_invocation_index, threadgroup tint_array<float4x2, 4>* c
threadgroup_barrier(mem_flags::mem_threadgroup); threadgroup_barrier(mem_flags::mem_threadgroup);
*(tint_symbol) = *(tint_symbol_1); *(tint_symbol) = *(tint_symbol_1);
(*(tint_symbol))[1] = (*(tint_symbol_1))[2]; (*(tint_symbol))[1] = (*(tint_symbol_1))[2];
(*(tint_symbol))[1][0] = float2((*(tint_symbol_1))[0][1]).yx; (*(tint_symbol))[1][0] = (*(tint_symbol_1))[0][1].yx;
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0]; (*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
} }

View File

@ -14,20 +14,41 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
/* 0x0006 */ tint_array<int8_t, 2> tint_pad;
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
half4x3 result = half4x3(0.0h);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
tint_array<half4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4> in) {
tint_array<half4x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
int i() { int i() {
thread int tint_symbol_2 = 0; thread int tint_symbol_2 = 0;
tint_symbol_2 = as_type<int>((as_type<uint>(tint_symbol_2) + as_type<uint>(1))); tint_symbol_2 = as_type<int>((as_type<uint>(tint_symbol_2) + as_type<uint>(1)));
return tint_symbol_2; return tint_symbol_2;
} }
kernel void f(const constant tint_array<half4x3, 4>* tint_symbol_3 [[buffer(0)]]) { kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4>* tint_symbol_3 [[buffer(0)]]) {
int const tint_symbol = i(); int const tint_symbol = i();
int const p_a_i_save = tint_symbol; int const p_a_i_save = tint_symbol;
int const tint_symbol_1 = i(); int const tint_symbol_1 = i();
int const p_a_i_i_save = tint_symbol_1; int const p_a_i_i_save = tint_symbol_1;
tint_array<half4x3, 4> const l_a = *(tint_symbol_3); tint_array<half4x3, 4> const l_a = tint_unpack_vec3_in_composite_1(*(tint_symbol_3));
half4x3 const l_a_i = (*(tint_symbol_3))[p_a_i_save]; half4x3 const l_a_i = tint_unpack_vec3_in_composite((*(tint_symbol_3))[p_a_i_save]);
half3 const l_a_i_i = (*(tint_symbol_3))[p_a_i_save][p_a_i_i_save]; half3 const l_a_i_i = half3((*(tint_symbol_3))[p_a_i_save][p_a_i_i_save].elements);
return; return;
} }

View File

@ -14,10 +14,31 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
kernel void f(const constant tint_array<half4x3, 4>* tint_symbol [[buffer(0)]]) { struct tint_packed_vec3_f16_array_element {
tint_array<half4x3, 4> const l_a = *(tint_symbol); /* 0x0000 */ packed_half3 elements;
half4x3 const l_a_i = (*(tint_symbol))[2]; /* 0x0006 */ tint_array<int8_t, 2> tint_pad;
half3 const l_a_i_i = (*(tint_symbol))[2][1]; };
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
half4x3 result = half4x3(0.0h);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
tint_array<half4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4> in) {
tint_array<half4x3, 4> result = {};
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4>* tint_symbol [[buffer(0)]]) {
tint_array<half4x3, 4> const l_a = tint_unpack_vec3_in_composite_1(*(tint_symbol));
half4x3 const l_a_i = tint_unpack_vec3_in_composite((*(tint_symbol))[2]);
half3 const l_a_i_i = half3((*(tint_symbol))[2][1].elements);
return; return;
} }

View File

@ -14,10 +14,23 @@ struct tint_array {
T elements[N]; T elements[N];
}; };
kernel void f(const constant tint_array<half4x3, 4>* tint_symbol [[buffer(0)]]) { struct tint_packed_vec3_f16_array_element {
half3x4 const t = transpose((*(tint_symbol))[2]); /* 0x0000 */ packed_half3 elements;
half const l = length(half3((*(tint_symbol))[0][1]).zxy); /* 0x0006 */ tint_array<int8_t, 2> tint_pad;
half const a = fabs(half3((*(tint_symbol))[0][1]).zxy[0]); };
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
half4x3 result = half4x3(0.0h);
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
result[i] = half3(in[i].elements);
}
return result;
}
kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4>* tint_symbol [[buffer(0)]]) {
half3x4 const t = transpose(tint_unpack_vec3_in_composite((*(tint_symbol))[2]));
half const l = length(half3((*(tint_symbol))[0][1].elements).zxy);
half const a = fabs(half3((*(tint_symbol))[0][1].elements).zxy[0]);
return; return;
} }

Some files were not shown because too many files have changed in this diff Show More