Commit 486f381f by Clemen Deng Committed by Commit Bot

Add desktop GL built-in functions to symbol table

Added GL built-in functions to symbol table autogeneration Built-in lookup now checks against spec and returns GL symbols when appropriate. Bug: angleproject:3719 Change-Id: I74786150f6063b40e13aebcb2eb9ea35e4ecaa53 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1731550Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Clemen Deng <clemendeng@google.com>
parent 265fdf0c
{ {
"src/compiler/translator/ImmutableString_autogen.cpp": "src/compiler/translator/ImmutableString_autogen.cpp":
"a47e4acb32dac769b179bb1e884fbece", "0a96956b0168817b28032a567f606940",
"src/compiler/translator/ParseContext_autogen.h": "src/compiler/translator/ParseContext_autogen.h":
"58786d2f352ee1a58d529fb7572c86a4", "48f878f5878e8ab239af7c14e5878b62",
"src/compiler/translator/SymbolTable_autogen.cpp": "src/compiler/translator/SymbolTable_autogen.cpp":
"e53566eaeeb2ca47d54b22ff0ff21b6d", "49931f9922d8b8d4478658fc76ae2a44",
"src/compiler/translator/SymbolTable_autogen.h": "src/compiler/translator/SymbolTable_autogen.h":
"bdb3c8eab0d48267a2f264e3af635e1a", "bdb3c8eab0d48267a2f264e3af635e1a",
"src/compiler/translator/builtin_function_declarations.txt": "src/compiler/translator/builtin_function_declarations.txt":
"d0c15cb9f2ef6c0ba5cd6612470db000", "583e23ceaca8d2baeb07694049b68644",
"src/compiler/translator/builtin_variables.json": "src/compiler/translator/builtin_variables.json":
"bbcda061188c066dd887f9ecf5f6f4b4", "bbcda061188c066dd887f9ecf5f6f4b4",
"src/compiler/translator/gen_builtin_symbols.py": "src/compiler/translator/gen_builtin_symbols.py":
"5527c49f0e939aa593fa14f0f0cf84c5", "ff3ba3065b88217d72419630d87940e9",
"src/compiler/translator/tree_util/BuiltIn_autogen.h": "src/compiler/translator/tree_util/BuiltIn_autogen.h":
"8960db32b50614ad1f339bd0f5fdca2a", "eb49e9f6216e90d11e91d60a2446ac6d",
"src/tests/compiler_tests/ImmutableString_test_autogen.cpp": "src/tests/compiler_tests/ImmutableString_test_autogen.cpp":
"7b9cded5c25f8e433b866a3f4be334c3" "99468acdcf2bad59fd9f6a7519bcf390"
} }
\ No newline at end of file
...@@ -54,6 +54,7 @@ enum TBasicType ...@@ -54,6 +54,7 @@ enum TBasicType
{ {
EbtVoid, EbtVoid,
EbtFloat, EbtFloat,
EbtDouble,
EbtInt, EbtInt,
EbtUInt, EbtUInt,
EbtBool, EbtBool,
...@@ -86,7 +87,25 @@ enum TBasicType ...@@ -86,7 +87,25 @@ enum TBasicType
EbtSampler2DShadow, EbtSampler2DShadow,
EbtSamplerCubeShadow, EbtSamplerCubeShadow,
EbtSampler2DArrayShadow, EbtSampler2DArrayShadow,
EbtGuardSamplerEnd = EbtSampler2DArrayShadow, // non type: see implementation of IsSampler() EbtSampler1D, // Desktop GLSL sampler types
EbtSampler1DArray,
EbtSampler1DArrayShadow,
EbtSamplerBuffer,
EbtSamplerCubeArray,
EbtSamplerCubeArrayShadow,
EbtSampler1DShadow,
EbtSampler2DRectShadow,
EbtISampler1D,
EbtISampler1DArray,
EbtISampler2DRect,
EbtISamplerBuffer,
EbtISamplerCubeArray,
EbtUSampler1D,
EbtUSampler1DArray,
EbtUSampler2DRect,
EbtUSamplerBuffer,
EbtUSamplerCubeArray,
EbtGuardSamplerEnd = EbtUSamplerCubeArray, // non type: see implementation of IsSampler()
// images // images
EbtGuardImageBegin, EbtGuardImageBegin,
...@@ -102,9 +121,40 @@ enum TBasicType ...@@ -102,9 +121,40 @@ enum TBasicType
EbtImageCube, EbtImageCube,
EbtIImageCube, EbtIImageCube,
EbtUImageCube, EbtUImageCube,
EbtGuardImageEnd = EbtUImageCube, EbtImage1D, // Desktop GLSL image types
EbtIImage1D,
EbtLastSimpleType = EbtGuardImageEnd, EbtUImage1D,
EbtImage1DArray,
EbtIImage1DArray,
EbtUImage1DArray,
EbtImage2DMS,
EbtIImage2DMS,
EbtUImage2DMS,
EbtImage2DMSArray,
EbtIImage2DMSArray,
EbtUImage2DMSArray,
EbtImage2DRect,
EbtIImage2DRect,
EbtUImage2DRect,
EbtImageCubeArray,
EbtIImageCubeArray,
EbtUImageCubeArray,
EbtImageRect,
EbtIImageRect,
EbtUImageRect,
EbtImageBuffer,
EbtIImageBuffer,
EbtUImageBuffer,
EbtGuardImageEnd = EbtUImageBuffer,
EbtSubpassInput,
EbtISubpassInput,
EbtUSubpassInput,
EbtSubpassInputMS,
EbtISubpassInputMS,
EbtUSubpassInputMS,
EbtLastSimpleType = EbtUSubpassInputMS,
EbtStruct, EbtStruct,
EbtInterfaceBlock, EbtInterfaceBlock,
...@@ -133,6 +183,16 @@ class TBasicMangledName ...@@ -133,6 +183,16 @@ class TBasicMangledName
mName[0] = '0'; mName[0] = '0';
mName[1] = static_cast<char>('a' - 26 + t); mName[1] = static_cast<char>('a' - 26 + t);
} }
else if (t < 78)
{
mName[0] = '1';
mName[1] = static_cast<char>('A' - 52 + t);
}
else if (t < 104)
{
mName[0] = '1';
mName[1] = static_cast<char>('a' - 78 + t);
}
} }
constexpr char *getName() { return mName; } constexpr char *getName() { return mName; }
......
...@@ -24,147 +24,332 @@ std::ostream &operator<<(std::ostream &os, const sh::ImmutableString &str) ...@@ -24,147 +24,332 @@ std::ostream &operator<<(std::ostream &os, const sh::ImmutableString &str)
namespace namespace
{ {
constexpr int kT1[] = {100, 182, 2130, 662, 157, 133, 170, 477, 1253, 73, 861, 1822, 1766, constexpr int kT1[] = {4292, 1592, 4573, 298, 3173, 3569, 4869, 2125, 2112, 3198, 1733, 4935, 1772,
363, 405, 112, 62, 1889, 1641, 1159, 1800, 323, 2099, 1538, 1744, 549, 748, 1729, 1297, 5087, 4525, 3739, 1397, 1435, 466, 1338, 2385, 2143, 3818,
40, 1304, 1204, 497, 654, 1117, 2106, 1383, 1458, 584, 791}; 437, 3614, 1476, 2658, 4988, 848, 4735, 2113, 4485, 1905, 4677};
constexpr int kT2[] = {1790, 2006, 711, 1768, 1296, 50, 1765, 2077, 1563, 1552, 55, 758, 1598, constexpr int kT2[] = {773, 2979, 1124, 532, 4590, 1371, 3189, 659, 1450, 705, 1406, 47, 1843,
1977, 317, 477, 1306, 1736, 632, 833, 1484, 166, 1015, 571, 71, 779, 4783, 3189, 4836, 2299, 303, 782, 2482, 1161, 4792, 2767, 463, 598, 2055,
634, 1906, 583, 805, 238, 164, 420, 1754, 1761, 2014, 1117}; 2768, 4489, 4232, 1677, 1321, 501, 3971, 2039, 2368, 485, 353};
constexpr int kG[] = { constexpr int kG[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1390, 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 660, 0, 0, 0, 0, 1707, 0, 0, 0, 0, 0, 780, 0, 1819, 0, 1432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 796, 0, 1055, 0, 0, 1363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1731, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 65, 0, 0, 0, 0, 0, 0, 1590, 0, 0, 0, 1959, 0, 0, 0, 0, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
928, 0, 462, 1609, 2072, 0, 0, 0, 0, 0, 0, 0, 817, 1404, 0, 0, 0, 1215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1018,
0, 0, 0, 0, 490, 0, 1430, 0, 1988, 0, 1779, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1526, 0,
0, 0, 0, 0, 0, 904, 0, 0, 779, 441, 0, 1094, 0, 1037, 0, 1786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3654,
0, 1616, 241, 0, 0, 0, 0, 0, 0, 661, 0, 0, 0, 0, 1970, 0, 0, 4390, 0, 0, 0, 0, 0, 0, 0, 0, 651, 462, 0, 0, 0, 518,
0, 0, 0, 0, 1137, 0, 0, 0, 0, 475, 0, 0, 0, 1411, 0, 0, 0, 0, 4759, 0, 0, 2301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
151, 0, 0, 686, 0, 0, 0, 0, 0, 1890, 1023, 239, 758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1263, 0, 141, 0, 0, 0,
0, 0, 1527, 0, 0, 378, 2085, 0, 0, 0, 0, 900, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 862, 0,
0, 0, 1160, 155, 0, 483, 0, 0, 0, 0, 2123, 0, 0, 51, 0, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 184, 0, 0, 186, 1240, 0,
0, 0, 0, 0, 0, 0, 768, 1360, 0, 0, 0, 1442, 0, 0, 0, 83, 0, 5080, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4926, 431, 0, 0, 0,
0, 452, 0, 0, 0, 1816, 0, 53, 125, 0, 0, 2120, 0, 0, 0, 0, 0, 0, 0, 4103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0,
0, 1301, 0, 9, 1035, 0, 1722, 122, 620, 0, 1865, 0, 2118, 0, 0, 0, 0, 0, 629, 0, 0, 0, 0, 0, 0, 4796, 0, 0, 0, 0, 0, 0,
0, 0, 1627, 0, 699, 0, 480, 1697, 0, 1786, 227, 0, 286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 334, 0, 4437, 0, 1824,
0, 0, 0, 0, 0, 0, 1273, 498, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 1136, 0, 0, 0, 0, 0, 0, 883, 0, 0, 2978, 0, 0, 0,
0, 1888, 0, 0, 0, 865, 0, 0, 0, 0, 960, 0, 0, 484, 0, 0, 695, 0, 0, 0, 0, 0, 0, 0, 0, 583, 0, 282, 0, 0, 0, 0,
0, 350, 0, 0, 1309, 1336, 0, 0, 241, 0, 0, 288, 0, 1111, 0, 0, 0, 0, 0, 0, 2848, 0, 0, 0, 0, 5022, 0, 0, 0, 4122, 4340, 0,
0, 1072, 0, 121, 1559, 1623, 392, 0, 0, 1707, 1104, 0, 737, 0, 0, 1523, 3830, 0, 0, 0, 0, 0, 2272, 0, 0, 0, 1768, 0, 0, 4024, 0, 0,
996, 380, 0, 0, 57, 0, 0, 1933, 0, 0, 0, 257, 774, 0, 703, 0, 0, 0, 0, 0, 0, 4603, 2203, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1360, 0, 0, 1282, 0, 2050, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 2278, 0, 0, 0, 2046, 918, 0, 0, 0, 0,
1999, 0, 0, 0, 0, 0, 1928, 0, 0, 0, 0, 1832, 0, 1853, 1066, 1017, 4553, 0, 0, 1808, 0, 0, 0, 0, 0, 0, 0, 2334, 1739, 0, 0, 440,
424, 0, 876, 0, 222, 538, 0, 1987, 0, 509, 525, 1708, 0, 2093, 0, 0, 0, 0, 0, 0, 0, 0, 1773, 0, 0, 1880, 0, 0, 656, 0, 0, 379,
0, 298, 0, 1889, 916, 1840, 139, 2076, 745, 0, 0, 1668, 0, 0, 754, 1937, 385, 0, 2244, 0, 0, 0, 0, 1792, 0, 0, 4806, 0, 2325, 0, 1550, 0,
0, 0, 0, 0, 0, 1839, 296, 0, 1774, 602, 0, 1205, 0, 0, 0, 493, 0, 0, 0, 0, 0, 0, 2472, 0, 4596, 0, 430, 0, 0, 360, 0, 0,
290, 1905, 0, 0, 1478, 0, 0, 885, 0, 0, 263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1672, 1301, 0, 1406, 0, 0, 2130, 0, 0,
793, 0, 1046, 869, 0, 0, 338, 380, 26, 40, 1023, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 227, 0, 0, 0, 0,
0, 629, 0, 1443, 603, 0, 1078, 1478, 1204, 2072, 248, 0, 0, 596, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 514, 0, 1010, 0, 0,
0, 1881, 2011, 834, 310, 1096, 0, 1910, 0, 0, 0, 856, 315, 445, 0, 2059, 0, 5017, 0, 0, 0, 1490, 552, 0, 0, 0, 0, 0, 1029, 0, 0, 0,
185, 0, 0, 0, 0, 665, 1936, 0, 109, 748, 385, 2127, 394, 268, 74, 31, 652, 0, 0, 0, 0, 0, 0, 2464, 0, 3943, 0, 0, 0, 0, 0, 959,
0, 0, 386, 0, 1235, 0, 121, 0, 0, 1846, 1631, 0, 0, 0, 1529, 439, 235, 4679, 0, 0, 0, 0, 1534, 4602, 0, 0, 2012, 4094, 0, 0, 0, 0,
829, 0, 1387, 433, 724, 0, 1817, 0, 0, 0, 306, 0, 0, 0, 0, 0, 0, 1021, 0, 4868, 1419, 0, 2590, 1630, 0, 0, 1523, 1253, 761, 1105, 1737, 0,
0, 93, 40, 0, 0, 1433, 1863, 0, 0, 1838, 0, 1379, 0, 0, 0, 989, 0, 0, 0, 0, 0, 438, 0, 0, 4717, 0, 4493, 1766, 0, 0, 0, 0,
0, 1996, 1213, 1379, 0, 0, 0, 113, 0, 327, 803, 0, 1989, 0, 1771, 0, 0, 0, 4923, 0, 1190, 0, 0, 0, 0, 0, 0, 0, 1127, 4967, 0, 3999,
1682, 466, 1550, 0, 1301, 0, 0, 1933, 837, 0, 0, 0, 124, 841, 54, 233, 0, 0, 0, 0, 0, 2178, 0, 0, 0, 3138, 1947, 0, 0, 0, 0, 0,
0, 0, 2128, 0, 0, 2022, 0, 1006, 606, 0, 112, 452, 2078, 0, 0, 1778, 0, 0, 2687, 0, 910, 851, 0, 0, 5041, 0, 0, 0, 0, 0, 0, 0,
2076, 372, 0, 1812, 0, 948, 0, 1119, 0, 0, 480, 244, 960, 198, 0, 1608, 295, 2216, 1680, 0, 0, 0, 0, 0, 0, 533, 1264, 1084, 0, 0, 0, 0,
953, 1325, 1067, 1342, 0, 101, 0, 0, 0, 2124, 293, 1402, 297, 808, 0, 623, 0, 0, 0, 0, 1592, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 522, 412, 0, 0, 0, 0, 0, 486, 221, 311, 458, 254, 0, 0, 0, 0, 0, 0, 3919, 0, 0, 0, 0, 0, 0, 3918, 0, 1314, 0, 0,
606, 0, 0, 0, 0, 214, 2006, 0, 0, 0, 1248, 120, 0, 0, 0, 557, 0, 0, 0, 0, 0, 0, 0, 4545, 136, 2906, 0, 2082, 3908, 0, 0, 126,
0, 619, 515, 0, 0, 0, 1939, 1069, 0, 0, 1723, 0, 0, 0, 189, 496, 0, 0, 0, 1055, 0, 0, 0, 0, 0, 0, 0, 334, 1154, 0, 0, 0,
0, 0, 609, 0, 0, 1048, 0, 0, 0, 0, 785, 837, 0, 777, 0, 191, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 4027, 0, 0, 0, 0,
694, 0, 1244, 0, 0, 0, 0, 474, 0, 1799, 0, 1252, 1770, 0, 0, 323, 0, 0, 0, 0, 2891, 0, 0, 0, 1540, 1225, 0, 0, 0, 122, 0, 0,
1071, 0, 1620, 0, 0, 1987, 911, 315, 125, 376, 1930, 0, 0, 0, 285, 901, 0, 0, 3866, 857, 1003, 4959, 0, 0, 347, 0, 1185, 0, 1323, 2918, 0, 3920,
276, 789, 0, 0, 1213, 0, 456, 50, 0, 448, 2113, 1154, 0, 0, 608, 1409, 762, 0, 5089, 0, 0, 3236, 0, 4253, 4838, 2189, 0, 0, 0, 2312, 2824, 0,
0, 0, 0, 879, 1936, 568, 0, 0, 104, 0, 0, 345, 0, 0, 0, 0, 0, 893, 275, 1775, 595, 1509, 0, 3551, 1639, 4083, 290, 115, 0, 0, 2156, 0,
0, 427, 0, 0, 0, 2095, 1372, 0, 0, 1494, 0, 985, 0, 514, 0, 0, 0, 0, 0, 0, 0, 3752, 0, 0, 0, 0, 3262, 260, 0, 0, 0, 0,
115, 0, 0, 0, 0, 1661, 694, 1725, 1003, 875, 796, 759, 0, 0, 0, 624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 379, 4935, 0,
89, 748, 1719, 380, 2075, 0, 0, 1795, 0, 0, 0, 0, 264, 229, 0, 310, 1851, 4776, 0, 0, 4643, 294, 0, 0, 4578, 0, 3763, 1349, 605, 0, 1630, 0,
1353, 1461, 2008, 0, 0, 0, 0, 1076, 0, 0, 0, 0, 0, 883, 25, 992, 0, 2044, 0, 5042, 1429, 0, 1679, 0, 0, 0, 0, 0, 0, 0, 0, 2003,
0, 0, 272, 0, 1658, 0, 543, 0, 2079, 0, 0, 0, 0, 766, 0, 852, 0, 1315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 523, 0,
430, 815, 395, 1026, 720, 175, 0, 1680, 1430, 0, 0, 773, 0, 908, 0, 0, 5059, 0, 0, 0, 0, 0, 0, 0, 105, 357, 0, 0, 920, 0, 2848, 0,
224, 922, 0, 0, 650, 0, 0, 418, 0, 2033, 428, 301, 0, 1116, 0, 988, 2912, 4941, 0, 0, 578, 1170, 0, 64, 0, 0, 1291, 0, 0, 0, 908, 0,
878, 2088, 0, 0, 1613, 368, 0, 0, 0, 0, 750, 1946, 1932, 0, 0, 839, 0, 0, 0, 0, 0, 0, 4024, 1845, 0, 2291, 0, 1876, 0, 1745, 1132, 0,
0, 0, 0, 169, 0, 1545, 330, 1162, 0, 0, 0, 557, 0, 0, 0, 0, 0, 0, 0, 588, 0, 0, 0, 1404, 3350, 0, 0, 0, 0, 0, 4650, 0,
370, 0, 491, 0, 729, 0, 1275, 229, 556, 0, 0, 1886, 0, 131, 0, 1117, 0, 0, 0, 0, 0, 735, 1805, 0, 0, 0, 4180, 0, 0, 0, 3635, 0,
0, 994, 152, 0, 346, 947, 0, 170, 0, 0, 484, 431, 0, 1393, 932, 0, 0, 0, 1422, 0, 1882, 0, 0, 0, 233, 0, 0, 0, 0, 0, 167, 0,
0, 0, 416, 0, 0, 178, 1686, 0, 674, 0, 0, 844, 0, 0, 0, 0, 0, 0, 1525, 0, 1881, 428, 0, 0, 2315, 5057, 0, 0, 0, 3737, 0, 209,
0, 1944, 324, 2006, 635, 0, 58, 2097, 659, 115, 890, 0, 0, 0, 0, 0, 195, 0, 684, 1590, 0, 4127, 1049, 0, 0, 0, 0, 1246, 4585, 0, 0, 1478,
1904, 0, 0, 1264, 274, 1889, 1743, 0, 216, 604, 0, 0, 0, 1383, 0, 0, 0, 0, 1622, 0, 4898, 134, 0, 0, 0, 4573, 0, 0, 0, 0, 0, 3052,
0, 0, 986, 0, 0, 0, 0, 1692, 0, 0, 0, 28, 1942, 0, 763, 0, 0, 0, 0, 0, 0, 1169, 4981, 0, 0, 2277, 3719, 0, 0, 0, 526, 212,
0, 0, 211, 1666, 0, 1631, 1895, 0, 1913, 0, 0, 852, 232, 0, 1138, 441, 0, 3673, 0, 0, 0, 4709, 0, 0, 530, 0, 0, 0, 0, 0, 0, 0,
1382, 0, 0, 74, 683, 1671, 0, 191, 650, 0, 1717, 1539, 0, 0, 685, 1722, 269, 0, 2226, 0, 606, 0, 0, 3583, 0, 0, 4042, 0, 0, 0, 0, 0,
2006, 79, 266, 814, 527, 0, 1480, 0, 0, 915, 0, 0, 1692, 2015, 123, 347, 4014, 0, 0, 0, 0, 0, 825, 0, 0, 2952, 3782, 4842, 0, 0, 0, 0,
1467, 0, 1777, 1715, 1684, 947, 0, 503, 551, 511, 745, 0, 1720, 0, 2013, 307, 0, 0, 0, 0, 0, 2537, 0, 0, 2524, 0, 2604, 0, 678, 0, 2045, 0,
0, 0, 123, 0, 2110, 449, 1338, 548, 0, 0, 603, 0, 1883, 0, 771, 0, 0, 1058, 0, 0, 4883, 2302, 0, 0, 2665, 0, 0, 1641, 1811, 4687, 1033, 0,
556, 446, 1479, 0, 1083, 0, 0, 1576, 0, 0, 0, 572, 902, 117, 0, 956, 0, 0, 511, 0, 0, 0, 0, 0, 0, 765, 0, 4156, 0, 1758, 0, 0,
0, 951, 0, 0, 0, 0, 764, 98, 1230, 1509, 0, 0, 0, 84, 807, 1283, 4987, 1642, 0, 0, 2761, 0, 0, 0, 0, 1289, 0, 2195, 3143, 0, 2384, 313,
0, 1115, 1787, 609, 821, 0, 447, 1534, 1830, 0, 0, 0, 286, 134, 0, 0, 0, 0, 2989, 0, 0, 0, 1511, 1461, 0, 0, 2201, 0, 838, 0, 0, 0,
0, 0, 46, 0, 135, 742, 0, 1041, 0, 0, 783, 1612, 668, 919, 1487, 826, 0, 2349, 320, 3184, 0, 0, 0, 0, 922, 234, 0, 0, 4996, 0, 1626, 129,
2083, 1467, 182, 0, 296, 302, 129, 328, 1692, 0, 1763, 0, 563, 2008, 0, 0, 1462, 0, 203, 0, 1072, 0, 1597, 0, 0, 531, 0, 0, 3903, 0, 4587, 1156,
95, 0, 1764, 1519, 0, 0, 844, 406, 122, 0, 0, 993, 0, 0, 636, 408, 0, 0, 0, 0, 0, 0, 1172, 0, 4621, 0, 0, 0, 0, 0, 0, 4545,
0, 0, 688, 0, 0, 265, 758, 0, 1964, 0, 0, 0, 0, 0, 611, 1993, 0, 0, 0, 0, 1449, 1501, 1464, 0, 0, 4367, 0, 0, 1180, 2207, 0, 0,
0, 0, 380, 1877, 55, 0, 264, 0, 0, 456, 201, 0, 463, 1066, 0, 367, 1149, 0, 3586, 0, 1301, 567, 0, 0, 0, 0, 0, 0, 0, 365, 0, 0,
1467, 0, 170, 0, 1249, 0, 0, 0, 2068, 0, 2121, 570, 1076, 0, 335, 749, 1311, 4729, 0, 0, 312, 0, 0, 0, 0, 0, 4283, 0, 1616, 0, 4708, 656,
0, 0, 250, 0, 985, 0, 0, 1649, 161, 58, 427, 1869, 555, 46, 341, 0, 1761, 0, 0, 4898, 1480, 3168, 0, 1498, 0, 1864, 0, 0, 0, 4471, 0, 79,
742, 159, 1853, 889, 976, 900, 1651, 0, 2039, 0, 1045, 715, 0, 0, 0, 0, 0, 1315, 627, 0, 0, 4163, 0, 534, 1307, 2121, 0, 0, 805, 1726, 0, 0,
0, 894, 0, 0, 0, 801, 279, 0, 0, 455, 0, 0, 1336, 0, 390, 0, 0, 0, 0, 0, 0, 3947, 0, 4636, 0, 0, 0, 0, 0, 4315, 376, 0,
430, 732, 1289, 2045, 1020, 1274, 34, 0, 1117, 0, 0, 0, 1667, 1825, 0, 0, 0, 0, 0, 0, 814, 4927, 4654, 4721, 0, 0, 2679, 453, 0, 256, 180, 0,
377, 0, 1432, 0, 0, 2009, 0, 0, 961, 1293, 111, 0, 0, 0, 0, 1735, 0, 2352, 2528, 2534, 0, 1397, 0, 822, 0, 854, 0, 1328, 0, 0, 1946, 365,
0, 569, 0, 153, 0, 139, 0, 152, 327, 314, 0, 0, 0, 2090, 0, 67, 2246, 0, 699, 0, 0, 0, 1382, 0, 0, 0, 0, 0, 0, 2199, 690, 0,
178, 645, 514, 0, 0, 235, 0, 0, 1013, 540, 2011, 0, 0, 0, 221, 471, 0, 0, 0, 1609, 0, 4896, 4405, 757, 0, 3653, 0, 0, 96, 0, 0, 1067,
0, 0, 0, 0, 165, 163, 0, 899, 0, 0, 699, 1648, 0, 137, 1944, 904, 0, 0, 2451, 0, 0, 0, 0, 0, 0, 962, 0, 1320, 0, 79, 0, 0,
0, 142, 1742, 0, 0, 313, 1369, 1879, 857, 154, 795, 1238, 1454, 516, 1334, 119, 0, 0, 0, 0, 0, 633, 1098, 1513, 0, 0, 0, 0, 0, 2977, 725, 99,
0, 981, 768, 0, 1009, 1516, 1390, 0, 973, 456, 744, 0, 917, 0, 0, 1879, 952, 1757, 3515, 4653, 0, 1339, 0, 4605, 0, 0, 4466, 4266, 0, 1088, 4487, 0,
2113, 19, 1183, 395, 543, 1905, 251, 0, 825, 0, 952, 0, 0, 399, 0, 1509, 0, 2713, 1730, 118, 0, 4590, 0, 0, 0, 0, 390, 0, 1267, 0, 0, 0,
0, 1426, 0, 1455, 1011, 520, 890, 787, 862, 445, 0, 464, 1315, 1638, 0, 806, 0, 1047, 0, 0, 0, 0, 0, 0, 0, 27, 1085, 0, 0, 0, 2294, 3386,
0, 938, 879, 1729, 0, 556, 0, 1810, 0, 816, 0, 0, 0, 0, 77, 271, 0, 0, 0, 3829, 1335, 0, 0, 0, 0, 0, 0, 4604, 0, 0, 0, 0,
1844, 260, 0, 714, 835, 1384, 376, 1620, 1054, 1654, 0, 2078, 929, 301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
701, 525, 371, 0, 485, 1888, 0, 0, 655, 0, 0, 61, 0, 0, 253, 0, 0, 4759, 1485, 2075, 0, 4615, 0, 0, 4393, 4663, 2297, 0, 4400, 767, 0, 2644,
0, 587, 1636, 985, 910, 0, 432, 0, 0, 910, 0, 610, 1919, 1799, 230, 871, 0, 0, 0, 369, 1878, 0, 4297, 1424, 2783, 0, 0, 1993, 0, 0, 1089, 0,
73, 0, 659, 0, 0, 0, 0, 21, 0, 0, 935, 403, 1061, 619, 0, 513, 1366, 0, 117, 2074, 917, 0, 0, 0, 1058, 0, 0, 0, 260, 4469, 0, 739,
0, 0, 0, 651, 658, 168, 672, 20, 680, 0, 66, 0, 56, 0, 266, 0, 791, 0, 0, 0, 623, 0, 2816, 0, 0, 624, 0, 148, 545, 0, 0, 0,
0, 0, 0, 0, 0, 417, 364, 15, 892, 82, 614, 497, 960, 339, 250, 0, 0, 4436, 2667, 0, 1843, 0, 0, 0, 0, 0, 0, 0, 4940, 0, 0, 0,
0, 0, 311, 564, 853, 0, 0, 944, 172, 1713, 1341, 892, 819, 377, 305, 966, 0, 0, 0, 284, 0, 0, 704, 811, 0, 0, 1213, 0, 0, 0, 0, 897,
1680, 381, 997, 0, 1402, 938, 120, 1188, 384, 414, 1436, 83, 385, 1949, 0, 0, 0, 2283, 3155, 162, 0, 4361, 0, 0, 0, 1152, 1349, 779, 3600, 900, 1454, 2107,
0, 298, 670, 0, 0, 0, 1731, 0, 335, 174, 0, 1001, 0, 1575, 819, 0, 885, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1238, 1270, 1690, 4678, 2145, 0,
0, 37, 647, 411, 1946, 711, 15, 377, 0, 361, 847, 0, 0, 26, 396, 60, 0, 0, 0, 802, 0, 0, 101, 4842, 0, 0, 0, 0, 2201, 578, 0, 988,
1049, 0, 1051, 0, 473, 0, 0, 0, 0, 1686, 0, 196, 0, 0, 139, 0, 236, 3189, 0, 0, 445, 182, 670, 3851, 0, 0, 0, 0, 0, 0, 0, 3236,
0, 0, 0, 0, 709, 0, 1752, 0, 546, 724, 1252, 805, 1015, 0, 319, 0, 5074, 0, 0, 0, 0, 0, 1748, 1691, 0, 0, 4213, 892, 0, 2152, 0, 158,
0, 0, 115, 0, 0, 2092, 765, 661, 0, 535, 702, 632, 754, 901, 211, 1276, 0, 0, 0, 1681, 0, 4552, 0, 0, 0, 0, 0, 0, 0, 0, 1720, 0,
0, 0, 117, 0, 80, 331, 0, 483, 838, 559, 0, 658, 1955, 720, 111, 0, 0, 0, 0, 262, 0, 1502, 0, 0, 3731, 0, 2303, 0, 0, 0, 0, 868,
576, 110, 1228, 2072, 0, 0, 0, 1531, 1797, 435, 1538, 989, 0, 140, 711, 0, 0, 0, 0, 4839, 0, 2208, 3256, 382, 2642, 0, 0, 4064, 0, 165, 0, 0,
0, 25, 70, 246, 608, 478, 36, 1525, 0, 0, 1952, 636, 812, 0, 1051, 0, 0, 4688, 0, 0, 361, 0, 70, 4819, 4711, 0, 0, 0, 1154, 2660, 4482, 296,
1790, 1265, 0, 0, 2127, 539, 0, 0, 1126, 0, 0, 0, 511, 530, 0, 0, 75, 4445, 0, 4697, 0, 257, 0, 0, 0, 530, 0, 755, 0, 2177, 0, 0,
0, 1342, 29, 67, 283, 0, 0, 879, 863, 0, 685, 0, 0, 386, 991, 560, 0, 0, 0, 4826, 4496, 0, 0, 0, 0, 589, 0, 0, 1269, 0, 0, 0,
1347, 1420, 520, 281, 167, 661, 0, 0, 0, 0, 0, 2050, 53, 0, 0, 0, 0, 0, 0, 0, 2255, 0, 1757, 0, 1029, 0, 0, 3256, 0, 0, 0, 0,
352, 341, 0, 0, 533, 0, 2089, 749, 0, 0, 1076, 0, 0, 780, 0, 94, 1774, 0, 0, 690, 0, 0, 0, 723, 0, 0, 0, 517, 3904, 680, 656, 0,
0, 0, 1128, 600, 30, 1465, 112, 1054, 155, 0, 873, 0, 0, 1221, 0, 372, 0, 0, 0, 0, 0, 0, 1037, 0, 0, 751, 0, 0, 0, 0, 873, 1033,
239, 1956, 1102, 438, 0, 0, 1783, 0, 0, 789, 105, 1451, 0, 572, 0, 1635, 4598, 0, 4586, 0, 3060, 59, 2835, 3530, 1595, 0, 1586, 0, 266, 2212, 63, 3124,
752, 875, 949, 1373, 518, 0, 0, 1538, 895, 0, 303, 0, 1379, 1259, 430, 283, 0, 0, 0, 3298, 0, 0, 0, 0, 0, 4240, 1827, 0, 0, 0, 1413, 1656,
0, 0, 2029, 582, 0, 685, 0, 290, 556, 937, 0, 0, 0, 0, 414, 65, 93, 2169, 0, 2523, 1579, 0, 0, 2609, 0, 2027, 2390, 0, 0, 2496, 0, 0,
395, 0, 1064, 0, 2053, 0, 685, 998, 0, 2065, 756, 303, 0, 591, 736, 980, 1074, 72, 864, 0, 0, 0, 0, 1743, 1282, 0, 0, 0, 0, 527, 0, 0,
886, 424, 828, 0, 795, 0, 0, 1948, 505, 374, 733, 1023, 0, 0, 0, 0, 0, 117, 0, 2286, 876, 0, 0, 0, 0, 4093, 0, 0, 0, 3956, 0, 1941,
461, 1856, 1471, 868, 879, 381, 489, 304, 0, 187, 1464, 0, 948, 1574, 0, 0, 0, 0, 0, 322, 556, 3519, 1986, 0, 0, 0, 0, 0, 1011, 2053, 0, 0,
462, 0, 0, 51, 0, 0, 0, 0, 448, 0, 525, 768, 1222, 723, 798, 0, 1253, 0, 0, 1921, 558, 0, 1399, 219, 1850, 0, 2126, 3638, 0, 0, 0, 0,
0, 0, 1237, 0, 2054, 1469, 71, 17, 2081, 16, 1057, 1818, 0, 756, 0, 1391, 0, 0, 676, 1290, 289, 115, 198, 0, 67, 3869, 4497, 0, 0, 3958, 0, 0,
0, 385, 266, 186, 0, 0, 0, 0, 870, 672, 1107, 1998, 712, 192, 660, 0, 1815, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 291, 0,
445, 1021, 962, 0, 1947, 0, 533, 0, 0, 0, 0, 0, 0, 980, 1656, 0, 0, 0, 0, 0, 0, 0, 645, 936, 4793, 1926, 0, 0, 0, 0, 1339, 0,
0, 1625, 716, 1184, 0, 355, 0, 0, 0, 482, 865, 131, 0, 0, 0, 621, 4922, 3430, 3614, 212, 667, 0, 0, 0, 1565, 0, 4660, 0, 979, 4016, 795, 0,
0, 80, 1559, 245, 0, 753, 0, 560, 0, 210, 1779, 0, 0, 7, 0, 0, 1412, 0, 0, 0, 0, 1347, 464, 396, 0, 0, 3899, 0, 0, 7, 0, 0,
1503, 99, 1010, 317, 1968, 0, 490, 444, 1994, 375, 532, 583, 1631, 451, 1780, 0, 0, 4130, 4123, 159, 0, 4810, 0, 0, 416, 2236, 0, 0, 1028, 0, 0, 0,
636, 0, 767, 0, 0, 0, 186, 0, 1280, 0, 603, 42, 1611, 147, 0, 1125, 35, 0, 1919, 0, 1009, 0, 464, 1128, 333, 0, 1507, 220, 0, 0, 0, 1771,
0, 158, 0, 0, 1197, 736, 63, 762, 671, 0, 0, 0, 0, 0, 477, 0, 0, 2131, 0, 3755, 1460, 1970, 0, 0, 0, 0, 0, 0, 0, 1884, 2926, 1103,
1180, 285, 696, 2054, 0, 1741, 751, 803, 2083, 1509, 1000, 0, 0, 0, 749, 406, 0, 0, 0, 2875, 0, 0, 0, 2521, 2079, 600, 0, 110, 0, 0, 1639, 0,
0, 0, 0, 0, 0, 0, 842, 426, 127, 1889, 0, 114, 0, 1080, 0, 652, 2739, 3722, 2248, 0, 879, 0, 1145, 0, 1415, 0, 0, 963, 0, 0, 0, 0,
1071, 0, 722, 1367, 0, 388, 365, 0, 825, 1681, 975, 0, 0, 2107, 403, 0, 0, 0, 647, 0, 4350, 700, 507, 0, 1638, 0, 5023, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2103, 170, 0, 0, 0, 0, 0, 1292, 1060, 1742, 98, 71, 0, 0, 0, 0, 586, 0, 1310, 2572, 0, 0, 0, 0, 597, 0, 832, 0,
2124, 1978, 0, 0, 0, 846, 1755, 0, 893, 0, 777, 179, 2003, 1614, 529, 0, 423, 4698, 1782, 1501, 0, 0, 1157, 0, 0, 0, 0, 0, 0, 789, 878, 0,
1846, 1388, 500, 0, 1799, 899, 564, 550, 0, 0, 0, 0, 619, 332, 1889, 2073, 0, 2293, 0, 0, 231, 942, 2499, 474, 3392, 0, 0, 2319, 0, 2968, 0, 0,
442, 363, 1678}; 370, 0, 0, 0, 2885, 3363, 2689, 0, 1830, 0, 0, 5032, 0, 0, 0, 0,
3127, 0, 290, 0, 2089, 0, 0, 1268, 0, 0, 0, 0, 0, 279, 2178, 0,
0, 0, 0, 4327, 1278, 1706, 3, 1715, 339, 4666, 1136, 0, 732, 4523, 1047, 216,
0, 1391, 0, 4410, 0, 0, 4112, 4526, 1385, 0, 158, 86, 3927, 1661, 969, 0,
1623, 0, 1774, 0, 0, 0, 0, 0, 0, 0, 1366, 0, 0, 0, 377, 657,
1242, 0, 1518, 0, 2715, 0, 0, 0, 0, 0, 1421, 748, 0, 0, 0, 119,
4053, 2861, 0, 0, 958, 0, 0, 1734, 1999, 10, 4095, 0, 0, 0, 0, 0,
3601, 261, 1081, 3018, 4431, 0, 3687, 0, 463, 0, 0, 0, 0, 211, 0, 0,
0, 1186, 2768, 1220, 0, 0, 0, 0, 0, 641, 3580, 0, 543, 182, 0, 0,
0, 0, 1931, 735, 293, 1423, 1714, 2306, 1747, 0, 2478, 4798, 0, 0, 0, 0,
3002, 0, 2167, 0, 0, 0, 0, 642, 662, 1170, 4000, 0, 296, 0, 4830, 1879,
826, 0, 0, 0, 1489, 0, 3835, 0, 394, 2059, 0, 0, 0, 178, 0, 0,
0, 3591, 2056, 2815, 0, 0, 0, 0, 1268, 0, 0, 0, 0, 3932, 176, 0,
47, 196, 0, 0, 0, 308, 929, 0, 4913, 997, 1166, 1063, 0, 2318, 87, 0,
0, 3559, 0, 571, 2099, 716, 921, 0, 0, 0, 1633, 1642, 0, 761, 211, 0,
2015, 0, 1998, 3960, 0, 0, 0, 0, 459, 4419, 4463, 0, 5038, 3072, 0, 0,
0, 976, 1497, 5071, 1022, 0, 1740, 284, 515, 0, 1556, 0, 0, 1735, 605, 0,
1420, 0, 0, 0, 2039, 95, 1637, 195, 1862, 1375, 1142, 0, 0, 0, 0, 4550,
0, 0, 0, 0, 2501, 657, 3003, 0, 0, 0, 0, 1985, 749, 0, 0, 0,
1174, 1078, 692, 0, 75, 1129, 979, 0, 0, 0, 2110, 0, 0, 972, 2374, 534,
0, 0, 0, 1660, 0, 234, 1402, 1227, 0, 0, 362, 0, 0, 1468, 275, 1168,
0, 4701, 0, 0, 0, 0, 4903, 2139, 1404, 0, 0, 405, 0, 1156, 0, 0,
0, 0, 336, 3043, 0, 0, 0, 0, 0, 1281, 264, 4375, 3148, 0, 2265, 447,
0, 2321, 0, 4928, 4437, 352, 0, 0, 0, 0, 2143, 0, 2490, 0, 0, 0,
0, 2083, 0, 0, 398, 484, 1027, 1821, 0, 0, 2180, 948, 0, 0, 215, 2902,
0, 0, 0, 0, 475, 1286, 1766, 0, 989, 408, 1409, 0, 5020, 1042, 115, 0,
0, 1532, 675, 455, 1994, 0, 1380, 0, 3976, 0, 2734, 0, 4745, 0, 96, 0,
132, 617, 0, 0, 0, 1837, 401, 1112, 3942, 4986, 4593, 2055, 498, 1499, 4045, 0,
0, 5046, 327, 0, 0, 292, 0, 2055, 0, 2336, 0, 0, 0, 4697, 1519, 2176,
0, 2054, 0, 0, 0, 878, 0, 0, 4365, 0, 0, 0, 0, 4590, 373, 3773,
1049, 0, 3695, 4019, 0, 0, 599, 0, 0, 0, 197, 0, 692, 0, 130, 0,
178, 0, 0, 0, 1106, 0, 1851, 0, 975, 261, 710, 1112, 3723, 1196, 1422, 510,
0, 3643, 3929, 0, 3965, 1343, 3381, 0, 0, 1413, 1206, 589, 0, 0, 0, 3972,
1265, 1330, 157, 0, 1763, 877, 3213, 737, 0, 0, 0, 0, 1473, 0, 3071, 0,
1102, 3205, 2962, 1754, 0, 0, 0, 0, 0, 0, 0, 907, 0, 0, 3996, 0,
0, 3345, 0, 0, 0, 0, 25, 4591, 0, 0, 2573, 0, 0, 628, 4843, 472,
441, 216, 961, 3104, 748, 4360, 0, 0, 0, 0, 0, 0, 0, 939, 415, 2886,
4143, 168, 881, 0, 874, 0, 873, 0, 4043, 0, 0, 600, 0, 4814, 0, 0,
1315, 1191, 0, 0, 0, 0, 2391, 0, 0, 1515, 4740, 0, 0, 0, 0, 2026,
0, 301, 3904, 0, 1732, 831, 0, 0, 0, 627, 39, 0, 0, 2689, 591, 853,
0, 4747, 0, 0, 0, 4900, 415, 0, 0, 532, 1484, 0, 4651, 567, 3660, 0,
0, 163, 0, 2362, 0, 3781, 24, 0, 0, 2006, 0, 0, 0, 1587, 2951, 0,
0, 2057, 0, 0, 2238, 0, 4944, 1703, 0, 2475, 4900, 33, 976, 4866, 0, 0,
0, 1740, 773, 3391, 0, 0, 3826, 705, 0, 0, 0, 1971, 2, 1912, 0, 0,
0, 0, 1727, 0, 328, 0, 0, 1617, 0, 0, 823, 4792, 5030, 2050, 0, 707,
0, 0, 0, 3511, 0, 0, 0, 0, 2100, 0, 18, 1810, 928, 2269, 0, 0,
3245, 0, 0, 2197, 1572, 0, 0, 0, 0, 1143, 0, 0, 2200, 1564, 531, 1429,
0, 5022, 0, 4544, 0, 0, 413, 0, 0, 0, 0, 0, 0, 0, 0, 0,
918, 865, 0, 1857, 1476, 1721, 2331, 1537, 194, 0, 1730, 1299, 4135, 1799, 364, 733,
780, 0, 1696, 1722, 5032, 0, 0, 719, 0, 0, 1676, 0, 1789, 0, 0, 0,
0, 4900, 0, 0, 4812, 1462, 2223, 0, 0, 0, 0, 37, 0, 0, 0, 1338,
0, 0, 576, 0, 1342, 0, 0, 0, 853, 4376, 0, 4452, 4034, 4375, 1017, 0,
0, 4862, 1957, 3924, 375, 1158, 1086, 1989, 0, 3487, 0, 1993, 0, 608, 0, 365,
4583, 2187, 1176, 0, 0, 0, 0, 494, 0, 2241, 0, 0, 0, 0, 4076, 11,
0, 4541, 58, 912, 1440, 1503, 1435, 0, 1245, 614, 3526, 0, 0, 0, 1812, 0,
0, 1166, 1632, 0, 5016, 1108, 0, 1152, 14, 0, 0, 1704, 0, 1403, 0, 338,
3819, 4322, 3707, 38, 0, 934, 1992, 0, 0, 2232, 1464, 1845, 0, 1977, 0, 782,
0, 0, 0, 0, 845, 0, 2085, 860, 621, 0, 4891, 0, 0, 1941, 0, 0,
0, 831, 0, 0, 0, 0, 966, 0, 0, 1622, 0, 0, 0, 0, 0, 0,
2280, 0, 642, 3111, 0, 0, 0, 0, 0, 0, 0, 0, 3266, 820, 3458, 0,
0, 0, 2173, 2140, 258, 354, 2123, 66, 71, 0, 1525, 0, 0, 0, 0, 2253,
0, 0, 202, 0, 0, 0, 1522, 0, 4362, 0, 1242, 0, 0, 0, 665, 0,
0, 519, 0, 0, 4666, 0, 0, 0, 2208, 0, 5057, 2081, 621, 0, 0, 0,
3354, 0, 1991, 599, 0, 2852, 0, 0, 0, 0, 0, 0, 0, 4568, 1567, 0,
0, 35, 491, 2164, 0, 0, 0, 0, 0, 1495, 0, 4721, 4494, 0, 222, 1801,
3465, 0, 4420, 0, 0, 3638, 790, 684, 0, 750, 3350, 4442, 0, 1042, 0, 0,
3915, 134, 2284, 955, 3025, 0, 0, 0, 0, 2255, 1951, 1444, 0, 937, 3399, 4603,
1526, 0, 4562, 2213, 2263, 0, 0, 606, 1937, 0, 1145, 925, 0, 1174, 340, 2140,
0, 0, 1179, 2457, 0, 985, 0, 4697, 0, 0, 3173, 664, 984, 618, 0, 0,
4727, 1266, 0, 0, 0, 4101, 2289, 4742, 1116, 0, 4671, 0, 657, 4131, 0, 0,
763, 1731, 2963, 0, 4663, 169, 756, 1454, 1694, 1053, 1986, 0, 3583, 284, 992, 2934,
97, 0, 1968, 0, 2623, 4668, 3960, 0, 1654, 1273, 2516, 3052, 0, 1320, 4423, 0,
0, 0, 0, 1709, 1492, 4834, 544, 0, 0, 0, 4787, 0, 262, 0, 454, 1063,
3317, 393, 0, 0, 839, 0, 0, 0, 1779, 0, 0, 0, 553, 3933, 0, 0,
0, 1437, 0, 0, 0, 921, 0, 0, 4619, 0, 2524, 0, 0, 0, 0, 711,
0, 1050, 0, 0, 421, 0, 0, 895, 5063, 0, 0, 402, 0, 1193, 0, 2314,
1263, 1777, 0, 5089, 0, 223, 2430, 0, 875, 0, 1384, 0, 3722, 4574, 4280, 0,
0, 2343, 0, 1438, 0, 3369, 0, 0, 0, 141, 687, 0, 625, 3039, 1737, 0,
0, 3141, 288, 4121, 0, 116, 376, 3061, 2296, 0, 1580, 793, 145, 0, 0, 0,
1548, 4738, 0, 1400, 0, 1276, 0, 1528, 5006, 0, 2317, 2043, 4500, 4905, 0, 0,
0, 0, 0, 2666, 2345, 0, 460, 1777, 684, 1054, 0, 1161, 4738, 0, 4655, 0,
4867, 5007, 211, 285, 0, 3769, 502, 0, 4891, 0, 3337, 1454, 1729, 557, 0, 0,
1445, 430, 1829, 103, 0, 0, 0, 0, 1887, 0, 1254, 0, 0, 1543, 0, 404,
0, 4759, 0, 3950, 152, 422, 0, 0, 4855, 221, 4852, 5060, 419, 1281, 658, 4101,
0, 5010, 0, 1011, 0, 143, 1210, 4725, 0, 3742, 1141, 0, 0, 0, 2000, 1218,
0, 0, 4917, 4855, 3545, 191, 1006, 1561, 1085, 2623, 2694, 0, 0, 2040, 1319, 5012,
0, 4691, 0, 0, 229, 1083, 168, 3386, 3675, 0, 2101, 0, 0, 454, 2282, 2179,
0, 0, 4680, 1577, 0, 3012, 0, 0, 1978, 1783, 236, 0, 2229, 0, 0, 2320,
0, 0, 0, 0, 1267, 2193, 0, 1553, 0, 4700, 1494, 0, 0, 0, 0, 0,
63, 784, 2218, 0, 0, 1437, 0, 1699, 0, 1559, 0, 812, 0, 1996, 1995, 126,
0, 1841, 0, 0, 0, 1889, 0, 720, 139, 3614, 5005, 0, 1370, 727, 1360, 4116,
893, 1044, 351, 491, 4795, 0, 0, 3566, 0, 199, 0, 0, 4423, 1286, 0, 4260,
1350, 0, 0, 495, 1488, 1655, 0, 608, 0, 0, 146, 0, 1131, 0, 725, 4827,
0, 3222, 161, 0, 0, 510, 307, 319, 481, 0, 0, 0, 3016, 502, 402, 112,
0, 1960, 0, 0, 0, 5046, 4263, 210, 0, 0, 1434, 3677, 75, 0, 3689, 449,
0, 4803, 0, 0, 0, 0, 1623, 0, 0, 991, 2005, 1484, 417, 736, 4435, 0,
0, 0, 2076, 0, 0, 1041, 2622, 0, 96, 0, 0, 0, 4618, 0, 0, 2335,
0, 3751, 1408, 5002, 465, 27, 0, 0, 0, 0, 871, 0, 0, 7, 5006, 0,
39, 0, 383, 0, 3316, 2288, 0, 0, 0, 1332, 0, 0, 0, 2089, 0, 3981,
0, 980, 540, 2200, 0, 812, 644, 4281, 1788, 4740, 160, 942, 1600, 0, 1485, 2473,
0, 395, 516, 103, 0, 1528, 2029, 2094, 681, 3331, 1102, 821, 994, 1315, 823, 2010,
1563, 1323, 1535, 0, 2298, 1573, 0, 0, 553, 621, 1096, 0, 3085, 4752, 693, 0,
1151, 2075, 1229, 1786, 0, 0, 1025, 1688, 4674, 5036, 0, 525, 341, 1247, 0, 0,
0, 2901, 698, 2072, 0, 0, 0, 2325, 0, 944, 4064, 1104, 0, 0, 0, 650,
0, 1324, 0, 649, 1644, 1016, 1535, 0, 468, 5082, 4451, 3644, 2935, 0, 4321, 0,
0, 2128, 0, 995, 1084, 144, 0, 0, 0, 3993, 4158, 1843, 0, 2253, 993, 697,
1367, 1349, 4452, 0, 0, 1008, 3459, 0, 1704, 0, 0, 548, 0, 3732, 854, 1519,
0, 287, 0, 1566, 373, 0, 432, 709, 661, 0, 0, 106, 0, 3599, 51, 0,
2118, 0, 302, 0, 633, 0, 3749, 2332, 0, 0, 0, 0, 4980, 1785, 1382, 189,
1842, 4122, 1861, 0, 1952, 491, 0, 1730, 0, 0, 4656, 194, 1917, 2358, 0, 4537,
448, 0, 0, 4903, 4438, 0, 0, 2558, 0, 1803, 0, 0, 1954, 3484, 0, 0,
750, 967, 608, 0, 3442, 0, 0, 949, 3542, 1257, 837, 4187, 2153, 52, 0, 0,
0, 0, 0, 2132, 1082, 3915, 0, 2884, 97, 0, 0, 2783, 2931, 304, 577, 0,
0, 1074, 2052, 873, 0, 1619, 3362, 0, 592, 0, 0, 2562, 446, 3929, 0, 0,
606, 394, 4774, 761, 974, 0, 3529, 0, 180, 4732, 0, 2056, 3255, 1687, 544, 1863,
1359, 3946, 2186, 0, 0, 0, 0, 0, 0, 3024, 1127, 4895, 470, 315, 0, 0,
2865, 0, 98, 0, 0, 1747, 324, 0, 781, 2095, 0, 0, 0, 0, 488, 0,
0, 162, 407, 3144, 2194, 0, 863, 0, 0, 693, 3953, 0, 0, 0, 0, 3389,
2736, 5001, 923, 115, 0, 0, 0, 2049, 4447, 978, 140, 0, 1163, 0, 0, 1780,
0, 335, 0, 1443, 4253, 3000, 237, 270, 1171, 751, 0, 544, 1448, 1916, 3985, 1593,
1329, 2332, 672, 1101, 5023, 407, 1793, 0, 1778, 1683, 4403, 0, 1393, 0, 0, 5062,
1279, 1696, 4218, 0, 3989, 0, 4257, 0, 4230, 0, 2312, 1928, 0, 0, 0, 2962,
0, 0, 3996, 271, 0, 0, 0, 0, 0, 0, 527, 1544, 0, 23, 0, 4577,
663, 332, 1615, 0, 0, 1419, 0, 0, 550, 1618, 1570, 0, 529, 3817, 0, 0,
4677, 1305, 3477, 125, 0, 2206, 5045, 459, 1700, 0, 0, 875, 430, 1238, 192, 2901,
1995, 563, 0, 0, 727, 4313, 1244, 0, 561, 0, 3651, 0, 0, 0, 1249, 0,
0, 0, 0, 5002, 4660, 0, 3220, 897, 2285, 617, 4625, 0, 1218, 3826, 412, 0,
0, 792, 0, 0, 4304, 351, 0, 2803, 0, 0, 1045, 0, 218, 1243, 0, 0,
4323, 0, 3484, 2117, 0, 0, 0, 0, 855, 1235, 1834, 4054, 0, 426, 1498, 796,
55, 0, 421, 0, 4966, 2921, 777, 0, 3751, 1902, 3999, 0, 0, 0, 1564, 0,
389, 1322, 3425, 1207, 0, 0, 270, 2256, 0, 0, 1106, 0, 198, 923, 1896, 0,
0, 1034, 2313, 2270, 4432, 905, 1447, 3141, 0, 0, 1773, 0, 0, 0, 1558, 372,
249, 0, 2138, 0, 5075, 620, 0, 0, 1, 4410, 4630, 0, 542, 398, 0, 0,
4677, 735, 0, 15, 0, 1551, 390, 0, 0, 3914, 877, 392, 1166, 3572, 0, 0,
1041, 121, 4063, 1693, 0, 1542, 1067, 0, 1873, 612, 0, 0, 1439, 0, 1330, 0,
3746, 1272, 4399, 1223, 2216, 2080, 1482, 0, 2070, 0, 1634, 812, 0, 20, 4942, 5022,
1155, 4246, 1075, 1271, 1094, 0, 1628, 1918, 4913, 413, 0, 0, 0, 4958, 0, 1461,
273, 4628, 3261, 411, 0, 0, 2882, 3801, 535, 3565, 429, 0, 3998, 4260, 4769, 741,
626, 4061, 2104, 0, 667, 0, 1171, 3024, 632, 1160, 0, 796, 0, 513, 1812, 1328,
1506, 3742, 0, 180, 2298, 1657, 1870, 0, 572, 0, 0, 1752, 0, 0, 906, 179,
584, 0, 0, 0, 0, 0, 1574, 0, 2388, 0, 575, 1868, 2891, 0, 162, 2590,
231, 0, 0, 0, 0, 0, 1552, 0, 2660, 3575, 3598, 0, 482, 1373, 2570, 1191,
0, 916, 1202, 2144, 1821, 0, 1608, 1652, 3630, 0, 0, 0, 0, 0, 0, 4120,
107, 0, 0, 0, 0, 489, 4743, 0, 0, 0, 1200, 1122, 0, 914, 4183, 3414,
582, 4040, 646, 0, 45, 0, 0, 0, 0, 2067, 0, 1625, 1147, 452, 1296, 0,
0, 10, 1055, 932, 2032, 849, 866, 0, 2008, 4718, 2227, 1764, 0, 541, 1802, 50,
0, 214, 0, 450, 177, 731, 0, 1132, 809, 0, 0, 1684, 1094, 0, 667, 1012,
0, 0, 4697, 0, 0, 0, 0, 764, 0, 0, 2204, 707, 4872, 0, 0, 0,
0, 917, 598, 353, 354, 0, 2064, 0, 5070, 1411, 4843, 1181, 0, 53, 2239, 0,
2244, 986, 0, 0, 0, 242, 1372, 467, 0, 2190, 4634, 339, 0, 0, 0, 4724,
0, 130, 3878, 914, 0, 0, 1733, 4886, 0, 118, 457, 0, 0, 1625, 0, 4495,
0, 5071, 2927, 2114, 0, 749, 0, 989, 2322, 606, 0, 1195, 1188, 3304, 0, 3216,
137, 0, 4943, 0, 0, 2632, 4973, 310, 2464, 1967, 4015, 872, 4960, 0, 0, 0,
518, 0, 77, 0, 607, 0, 434, 0, 1516, 4172, 1709, 1248, 0, 165, 1668, 219,
1458, 1340, 1367, 0, 0, 0, 2324, 2812, 0, 0, 2654, 444, 1800, 1678, 0, 872,
0, 4484, 1983, 894, 4464, 1352, 1683, 367, 2163, 0, 0, 64, 0, 4907, 1427, 876,
459, 0, 776, 0, 0, 3454, 0, 1277, 0, 2211, 84, 0, 560, 724, 0, 414,
0, 1711, 839, 3090, 3940, 4508, 0, 843, 1302, 0, 0, 500, 0, 0, 2482, 1020,
0, 951, 1872, 546, 4092, 2249, 0, 0, 0, 5032, 0, 104, 1004, 0, 425, 982,
0, 501, 764, 57, 0, 1621, 4707, 0, 0, 1791, 0, 1346, 2213, 0, 1899, 0,
981, 1141, 0, 0, 0, 122, 1369, 0, 1432, 0, 1310, 4756, 0, 0, 4984, 0,
0, 212, 0, 2115, 0, 0, 2209, 2588, 0, 0, 925, 0, 399, 0, 4015, 0,
0, 0, 1881, 0, 0, 1184, 1728, 431, 344, 2010, 1272, 4460, 0, 1932, 1452, 1031,
147, 0, 0, 3026, 0, 4481, 2608, 0, 0, 0, 581, 0, 2032, 4242, 817, 0,
0, 0, 2021, 547, 0, 1192, 2482, 4942, 0, 0, 0, 0, 1177, 978, 575, 113,
2261, 1409, 0, 1601, 4523, 902, 0, 4722, 1988, 0, 159, 2194, 1389, 469, 3603, 4822,
1192, 0, 0, 1780, 852, 2453, 1504, 0, 0, 676, 0, 0, 1285, 9, 0, 0,
764, 767, 0, 0, 0, 200, 0, 622, 2312, 0, 0, 1502, 806, 1973, 108, 2840,
1127, 876, 0, 994, 0, 0, 4584, 718, 985, 1129, 319, 0, 2603, 505, 0, 0,
0, 1315, 0, 3926, 830, 0, 1873, 0, 2575, 0, 0, 0, 2250, 0, 0, 0,
4006, 1033, 480, 0, 1287, 0, 4706, 975, 0, 987, 4732, 4444, 0, 0, 565, 2262,
0, 0, 2171, 1119, 0, 2965, 961, 1800, 1438, 761, 3925, 2162, 1896, 4609, 0, 0,
0, 811, 0, 0, 0, 0, 0, 641, 0, 3378, 1623, 0, 0, 0, 0, 1530,
0, 939, 1986, 0, 0, 1138, 1718, 1658, 2274, 1413, 1149, 721, 40, 0, 0, 940,
68, 4284, 0, 0, 1259, 2161, 809, 4730, 874, 271, 4942, 1360, 0, 1053, 0, 307,
1511, 0, 2124, 0, 0, 0, 0, 1352, 0, 1182, 164, 1598, 122, 0, 4716, 0,
0, 0, 3850, 0, 0, 4923, 1615, 2264, 1875, 3993, 17, 0, 2183, 2937, 1861, 205,
4060, 4955, 913, 0, 2843, 0, 331, 4891, 0, 3931, 40, 2125, 4489, 770, 0, 1939,
210, 4756, 51, 1648, 2214, 0, 745, 0, 1535, 1253, 1141, 0, 0, 0, 0, 231,
1645, 0, 175, 2081, 0, 0, 0, 0, 930, 0, 2274, 137, 965, 2323, 0, 0,
5083, 0, 2061, 1705, 0, 600, 0, 0, 0, 3063, 1490, 455, 0, 0, 0, 2233,
876, 1125, 1362, 0, 256, 0, 4001, 0, 0, 279, 0, 0, 0, 0, 0, 4728,
4743, 1287, 0, 1799, 4349, 0, 0, 0, 4207, 59, 265, 2495, 924, 3104, 2276, 1205,
0, 4503, 0, 0, 0, 0, 0, 0, 0, 4229, 0, 0, 1583, 0, 0, 18,
0, 1929, 1301, 1097, 0, 1282, 170, 0, 0, 1975, 973, 1548, 0, 1843, 727, 2126,
0, 0, 0, 4132, 0, 774, 92};
int HashG(const char *key, const int *T) int HashG(const char *key, const int *T)
{ {
...@@ -173,7 +358,7 @@ int HashG(const char *key, const int *T) ...@@ -173,7 +358,7 @@ int HashG(const char *key, const int *T)
for (int i = 0; key[i] != '\0'; i++) for (int i = 0; key[i] != '\0'; i++)
{ {
sum += T[i] * key[i]; sum += T[i] * key[i];
sum %= 2131; sum %= 5095;
} }
return kG[sum]; return kG[sum];
} }
...@@ -183,7 +368,7 @@ int PerfectHash(const char *key) ...@@ -183,7 +368,7 @@ int PerfectHash(const char *key)
if (strlen(key) > 37) if (strlen(key) > 37)
return 0; return 0;
return (HashG(key, kT1) + HashG(key, kT2)) % 2131; return (HashG(key, kT1) + HashG(key, kT2)) % 5095;
} }
} // namespace } // namespace
......
...@@ -253,7 +253,13 @@ enum TOperator ...@@ -253,7 +253,13 @@ enum TOperator
// Geometry only // Geometry only
EOpEmitVertex, EOpEmitVertex,
EOpEndPrimitive EOpEndPrimitive,
// Desktop GLSL functions
EOpFTransform,
EOpFma,
EOpPackDouble2x32,
EOpUnpackDouble2x32,
}; };
// Returns the string corresponding to the operator in GLSL // Returns the string corresponding to the operator in GLSL
......
...@@ -21,42 +21,42 @@ namespace BuiltInGroup ...@@ -21,42 +21,42 @@ namespace BuiltInGroup
bool isTextureOffsetNoBias(const TFunction *func) bool isTextureOffsetNoBias(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 677 && id <= 746; return id >= 1113 && id <= 1259;
} }
bool isTextureOffsetBias(const TFunction *func) bool isTextureOffsetBias(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 747 && id <= 766; return id >= 1260 && id <= 1294;
} }
bool isTextureGatherOffset(const TFunction *func) bool isTextureGatherOffset(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 844 && id <= 857; return id >= 1346 && id <= 1388;
} }
bool isTextureGather(const TFunction *func) bool isTextureGather(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 820 && id <= 857; return id >= 1308 && id <= 1388;
} }
bool isAtomicMemory(const TFunction *func) bool isAtomicMemory(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 874 && id <= 891; return id >= 1450 && id <= 1467;
} }
bool isImageLoad(const TFunction *func) bool isImageLoad(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 916 && id <= 927; return id >= 2104 && id <= 2136;
} }
bool isImageStore(const TFunction *func) bool isImageStore(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 928 && id <= 939; return id >= 2137 && id <= 2169;
} }
bool isImage(const TFunction *func) bool isImage(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 892 && id <= 939; return id >= 1468 && id <= 2169;
} }
} // namespace BuiltInGroup } // namespace BuiltInGroup
......
...@@ -69,6 +69,7 @@ TSymbolTable::TSymbolTable() ...@@ -69,6 +69,7 @@ TSymbolTable::TSymbolTable()
: mGlobalInvariant(false), : mGlobalInvariant(false),
mUniqueIdCounter(0), mUniqueIdCounter(0),
mShaderType(GL_FRAGMENT_SHADER), mShaderType(GL_FRAGMENT_SHADER),
mShaderSpec(SH_GLES2_SPEC),
mGlInVariableWithArraySize(nullptr) mGlInVariableWithArraySize(nullptr)
{} {}
...@@ -359,6 +360,7 @@ void TSymbolTable::initializeBuiltIns(sh::GLenum type, ...@@ -359,6 +360,7 @@ void TSymbolTable::initializeBuiltIns(sh::GLenum type,
const ShBuiltInResources &resources) const ShBuiltInResources &resources)
{ {
mShaderType = type; mShaderType = type;
mShaderSpec = spec;
mResources = resources; mResources = resources;
// We need just one precision stack level for predefined precisions. // We need just one precision stack level for predefined precisions.
......
...@@ -44,17 +44,6 @@ ...@@ -44,17 +44,6 @@
namespace sh namespace sh
{ {
// Define ESymbolLevel as int rather than an enum so that we can do arithmetic on it.
typedef int ESymbolLevel;
const int COMMON_BUILTINS = 0;
const int ESSL1_BUILTINS = 1;
const int ESSL3_BUILTINS = 2;
const int ESSL3_1_BUILTINS = 3;
// GLSL_BUILTINS are desktop GLSL builtins that don't exist in ESSL but are used to implement
// features in ANGLE's GLSL backend. They're not visible to the parser.
const int GLSL_BUILTINS = 4;
const int LAST_BUILTIN_LEVEL = GLSL_BUILTINS;
struct UnmangledBuiltIn struct UnmangledBuiltIn
{ {
constexpr UnmangledBuiltIn(TExtension extension) : extension(extension) {} constexpr UnmangledBuiltIn(TExtension extension) : extension(extension) {}
...@@ -186,6 +175,7 @@ class TSymbolTable : angle::NonCopyable, TSymbolTableBase ...@@ -186,6 +175,7 @@ class TSymbolTable : angle::NonCopyable, TSymbolTableBase
static const int kLastBuiltInId; static const int kLastBuiltInId;
sh::GLenum mShaderType; sh::GLenum mShaderType;
ShShaderSpec mShaderSpec;
ShBuiltInResources mResources; ShBuiltInResources mResources;
// Indexed by unique id. Map instead of vector since the variables are fairly sparse. // Indexed by unique id. Map instead of vector since the variables are fairly sparse.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -18,8 +18,13 @@ ...@@ -18,8 +18,13 @@
// DEFAULT METADATA {"op": "CallBuiltInFunction"} // DEFAULT METADATA {"op": "CallBuiltInFunction"}
// //
// Supported function metadata properties are: // Supported function metadata properties are:
// "level" // "essl_level"
// string, one of COMMON_BUILTINS, ESSL1_BUILTINS, ESSL3_BUILTINS and ESSL3_1_BUILTINS. // string, one of COMMON_BUILTINS, ESSL1_BUILTINS, ESSL3_BUILTINS and ESSL3_1_BUILTINS.
// "glsl_level"
// string, one of COMMON_BUILTINS, COMMON_BUILTINS, GLSL1_2_BUILTINS, GLSL1_3_BUILTINS,
// GLSL1_4_BUILTINS, GLSL1_5_BUILTINS, GLSL3_3_BUILTINS, GLSL4_BUILTINS, GLSL4_1_BUILTINS,
// GLSL4_2_BUILTINS, GLSL4_3_BUILTINS, GLSL4_4_BUILTINS, GLSL4_5_BUILTINS, and
// GLSL4_6_BUILTINS.
// "op" // "op"
// string, either EOp code or "auto", in which case the op is derived from the function // string, either EOp code or "auto", in which case the op is derived from the function
// name. // name.
...@@ -40,7 +45,7 @@ ...@@ -40,7 +45,7 @@
// Parameter types can have "out" or "inout" qualifiers. // Parameter types can have "out" or "inout" qualifiers.
GROUP BEGIN Trigonometric GROUP BEGIN Trigonometric
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType radians(genType); genType radians(genType);
genType degrees(genType); genType degrees(genType);
genType sin(genType); genType sin(genType);
...@@ -50,7 +55,7 @@ GROUP BEGIN Trigonometric ...@@ -50,7 +55,7 @@ GROUP BEGIN Trigonometric
genType acos(genType); genType acos(genType);
genType atan(genType, genType); genType atan(genType, genType);
genType atan(genType); genType atan(genType);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genType sinh(genType); genType sinh(genType);
genType cosh(genType); genType cosh(genType);
genType tanh(genType); genType tanh(genType);
...@@ -60,119 +65,222 @@ GROUP BEGIN Trigonometric ...@@ -60,119 +65,222 @@ GROUP BEGIN Trigonometric
GROUP END Trigonometric GROUP END Trigonometric
GROUP BEGIN Exponential GROUP BEGIN Exponential
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType pow(genType, genType); genType pow(genType, genType);
genType exp(genType); genType exp(genType);
genType log(genType); genType log(genType);
genType exp2(genType); genType exp2(genType);
genType log2(genType); genType log2(genType);
genType sqrt(genType); genType sqrt(genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType sqrt(genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType inversesqrt(genType); genType inversesqrt(genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType inversesqrt(genDType);
GROUP END Exponential GROUP END Exponential
GROUP BEGIN Common GROUP BEGIN Common
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType abs(genType); genType abs(genType);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genIType abs(genIType); genIType abs(genIType);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "auto"} DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType abs(genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType sign(genType); genType sign(genType);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genIType sign(genIType); genIType sign(genIType);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "auto"} DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType sign(genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType floor(genType); genType floor(genType);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "auto"} DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType floor(genDType);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genType trunc(genType); genType trunc(genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType trunc(genDType);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genType round(genType); genType round(genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType round(genDType);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genType roundEven(genType); genType roundEven(genType);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "auto"} DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType roundEven(genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType ceil(genType); genType ceil(genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType ceil(genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType fract(genType); genType fract(genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType fract(genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType mod(genType, float); genType mod(genType, float);
genType mod(genType, genType); genType mod(genType, genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType mod(genDType, double);
genDType mod(genDType, genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType min(genType, float); genType min(genType, float);
genType min(genType, genType); genType min(genType, genType);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "auto"} DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType min(genDType, genDType);
genDType min(genDType, double);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genIType min(genIType, genIType); genIType min(genIType, genIType);
genIType min(genIType, int); genIType min(genIType, int);
genUType min(genUType, genUType); genUType min(genUType, genUType);
genUType min(genUType, uint); genUType min(genUType, uint);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType max(genType, float); genType max(genType, float);
genType max(genType, genType); genType max(genType, genType);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "auto"} DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType max(genDType, genDType);
genDType max(genDType, double);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genIType max(genIType, genIType); genIType max(genIType, genIType);
genIType max(genIType, int); genIType max(genIType, int);
genUType max(genUType, genUType); genUType max(genUType, genUType);
genUType max(genUType, uint); genUType max(genUType, uint);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType clamp(genType, float, float); genType clamp(genType, float, float);
genType clamp(genType, genType, genType); genType clamp(genType, genType, genType);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "auto"} DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType clamp(genDType, double, double);
genDType clamp(genDType, genDType, genDType);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genIType clamp(genIType, int, int); genIType clamp(genIType, int, int);
genIType clamp(genIType, genIType, genIType); genIType clamp(genIType, genIType, genIType);
genUType clamp(genUType, uint, uint); genUType clamp(genUType, uint, uint);
genUType clamp(genUType, genUType, genUType); genUType clamp(genUType, genUType, genUType);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType mix(genType, genType, float); genType mix(genType, genType, float);
genType mix(genType, genType, genType); genType mix(genType, genType, genType);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "auto"} DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType mix(genDType, genDType, double);
genDType mix(genDType, genDType, genDType);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genType mix(genType, genType, genBType); genType mix(genType, genType, genBType);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "auto"} DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType mix(genDType, genDType, genBType);
DEFAULT METADATA {"glsl_level": "GLSL4_5_BUILTINS", "op": "auto"}
genIType mix(genIType, genIType, genBType);
genUType mix(genUType, genUType, genBType);
genBType mix(genBType, genBType, genBType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType step(genType, genType); genType step(genType, genType);
genType step(float, genType); genType step(float, genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType step(genDType, genDType);
genDType step(double, genDType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType smoothstep(genDType, genDType, genDType);
genDType smoothstep(double, double, genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType smoothstep(genType, genType, genType); genType smoothstep(genType, genType, genType);
genType smoothstep(float, float, genType); genType smoothstep(float, float, genType);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genType modf(genType, out genType); genType modf(genType, out genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType modf(genDType, out genDType);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genBType isnan(genType); genBType isnan(genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genBType isnan(genDType);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
genBType isinf(genType); genBType isinf(genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genBType isinf(genDType);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL3_3_BUILTINS", "op": "auto"}
genIType floatBitsToInt(genType); genIType floatBitsToInt(genType);
genUType floatBitsToUint(genType); genUType floatBitsToUint(genType);
genType intBitsToFloat(genIType); genType intBitsToFloat(genIType);
genType uintBitsToFloat(genUType); genType uintBitsToFloat(genUType);
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "auto"} DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genType fma(genType, genType, genType);
genType fma(genDType, genDType, genDType);
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genType frexp(genType, out genIType); genType frexp(genType, out genIType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType frexp(genDType, out genIType);
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genType ldexp(genType, genIType); genType ldexp(genType, genIType);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "auto"} DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType ldexp(genDType, genIType);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL4_2_BUILTINS", "op": "auto"}
uint packSnorm2x16(vec2); uint packSnorm2x16(vec2);
uint packUnorm2x16(vec2);
uint packHalf2x16(vec2); uint packHalf2x16(vec2);
vec2 unpackSnorm2x16(uint); vec2 unpackSnorm2x16(uint);
vec2 unpackUnorm2x16(uint);
vec2 unpackHalf2x16(uint); vec2 unpackHalf2x16(uint);
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto"}
uint packUnorm2x16(vec2);
vec2 unpackUnorm2x16(uint);
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto"}
uint packUnorm4x8(vec4); uint packUnorm4x8(vec4);
uint packSnorm4x8(vec4); uint packSnorm4x8(vec4);
vec4 unpackUnorm4x8(uint); vec4 unpackUnorm4x8(uint);
vec4 unpackSnorm4x8(uint); vec4 unpackSnorm4x8(uint);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
double packDouble2x32(uvec2);
uvec2 unpackDouble2x32(double);
GROUP END Common GROUP END Common
GROUP BEGIN Geometric GROUP BEGIN Geometric
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
float length(genType); float length(genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
double length(genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
float distance(genType, genType); float distance(genType, genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
double distance(genDType, genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
float dot(genType, genType); float dot(genType, genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
double dot(genDType, genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
vec3 cross(vec3, vec3); vec3 cross(vec3, vec3);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
dvec3 cross(dvec3, dvec3);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType normalize(genType); genType normalize(genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType normalize(genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType faceforward(genType, genType, genType); genType faceforward(genType, genType, genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType faceforward(genDType, genDType, genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType reflect(genType, genType); genType reflect(genType, genType);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType reflect(genDType, genDType);
DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
genType refract(genType, genType, float); genType refract(genType, genType, float);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genDType refract(genDType, genDType, float);
GROUP END Geometric GROUP END Geometric
GROUP BEGIN GeometricVS {"condition": "shaderType == GL_VERTEX_SHADER"}
DEFAULT METADATA {"glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
vec4 ftransform();
GROUP END GeometricVS
GROUP BEGIN Matrix GROUP BEGIN Matrix
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "MulMatrixComponentWise"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "MulMatrixComponentWise"}
mat2 matrixCompMult(mat2, mat2); mat2 matrixCompMult(mat2, mat2);
mat3 matrixCompMult(mat3, mat3); mat3 matrixCompMult(mat3, mat3);
mat4 matrixCompMult(mat4, mat4); mat4 matrixCompMult(mat4, mat4);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "MulMatrixComponentWise"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "MulMatrixComponentWise"}
mat2x3 matrixCompMult(mat2x3, mat2x3); mat2x3 matrixCompMult(mat2x3, mat2x3);
mat3x2 matrixCompMult(mat3x2, mat3x2); mat3x2 matrixCompMult(mat3x2, mat3x2);
mat2x4 matrixCompMult(mat2x4, mat2x4); mat2x4 matrixCompMult(mat2x4, mat2x4);
mat4x2 matrixCompMult(mat4x2, mat4x2); mat4x2 matrixCompMult(mat4x2, mat4x2);
mat3x4 matrixCompMult(mat3x4, mat3x4); mat3x4 matrixCompMult(mat3x4, mat3x4);
mat4x3 matrixCompMult(mat4x3, mat4x3); mat4x3 matrixCompMult(mat4x3, mat4x3);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_2_BUILTINS", "op": "auto"}
mat2 outerProduct(vec2, vec2); mat2 outerProduct(vec2, vec2);
mat3 outerProduct(vec3, vec3); mat3 outerProduct(vec3, vec3);
mat4 outerProduct(vec4, vec4); mat4 outerProduct(vec4, vec4);
...@@ -191,58 +299,60 @@ GROUP BEGIN Matrix ...@@ -191,58 +299,60 @@ GROUP BEGIN Matrix
mat4x2 transpose(mat2x4); mat4x2 transpose(mat2x4);
mat3x4 transpose(mat4x3); mat3x4 transpose(mat4x3);
mat4x3 transpose(mat3x4); mat4x3 transpose(mat3x4);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "auto"}
float determinant(mat2); float determinant(mat2);
float determinant(mat3); float determinant(mat3);
float determinant(mat4); float determinant(mat4);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_4_BUILTINS", "op": "auto"}
mat2 inverse(mat2); mat2 inverse(mat2);
mat3 inverse(mat3); mat3 inverse(mat3);
mat4 inverse(mat4); mat4 inverse(mat4);
GROUP END Matrix GROUP END Matrix
GROUP BEGIN Vector GROUP BEGIN Vector
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "LessThanComponentWise"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "LessThanComponentWise"}
bvec lessThan(vec, vec); bvec lessThan(vec, vec);
bvec lessThan(ivec, ivec); bvec lessThan(ivec, ivec);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "LessThanComponentWise"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "LessThanComponentWise"}
bvec lessThan(uvec, uvec); bvec lessThan(uvec, uvec);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "LessThanEqualComponentWise"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "LessThanEqualComponentWise"}
bvec lessThanEqual(vec, vec); bvec lessThanEqual(vec, vec);
bvec lessThanEqual(ivec, ivec); bvec lessThanEqual(ivec, ivec);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "LessThanEqualComponentWise"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "LessThanEqualComponentWise"}
bvec lessThanEqual(uvec, uvec); bvec lessThanEqual(uvec, uvec);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "GreaterThanComponentWise"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "GreaterThanComponentWise"}
bvec greaterThan(vec, vec); bvec greaterThan(vec, vec);
bvec greaterThan(ivec, ivec); bvec greaterThan(ivec, ivec);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "GreaterThanComponentWise"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "GreaterThanComponentWise"}
bvec greaterThan(uvec, uvec); bvec greaterThan(uvec, uvec);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "GreaterThanEqualComponentWise"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "GreaterThanEqualComponentWise"}
bvec greaterThanEqual(vec, vec); bvec greaterThanEqual(vec, vec);
bvec greaterThanEqual(ivec, ivec); bvec greaterThanEqual(ivec, ivec);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "GreaterThanEqualComponentWise"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "GreaterThanEqualComponentWise"}
bvec greaterThanEqual(uvec, uvec); bvec greaterThanEqual(uvec, uvec);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "EqualComponentWise"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "EqualComponentWise"}
bvec equal(vec, vec); bvec equal(vec, vec);
bvec equal(ivec, ivec); bvec equal(ivec, ivec);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "EqualComponentWise"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "EqualComponentWise"}
bvec equal(uvec, uvec); bvec equal(uvec, uvec);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "EqualComponentWise"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "EqualComponentWise"}
bvec equal(bvec, bvec); bvec equal(bvec, bvec);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "NotEqualComponentWise"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "NotEqualComponentWise"}
bvec notEqual(vec, vec); bvec notEqual(vec, vec);
bvec notEqual(ivec, ivec); bvec notEqual(ivec, ivec);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "NotEqualComponentWise"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "NotEqualComponentWise"}
bvec notEqual(uvec, uvec); bvec notEqual(uvec, uvec);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "NotEqualComponentWise"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "NotEqualComponentWise"}
bvec notEqual(bvec, bvec); bvec notEqual(bvec, bvec);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
bool any(bvec); bool any(bvec);
bool all(bvec); bool all(bvec);
DEFAULT METADATA {"level": "COMMON_BUILTINS", "op": "LogicalNotComponentWise", "suffix": "Func"} DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "LogicalNotComponentWise", "suffix": "Func"}
bvec not(bvec); bvec not(bvec);
GROUP END Vector GROUP END Vector
GROUP BEGIN Integer GROUP BEGIN Integer
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto"}
genIType bitfieldExtract(genIType, int, int); genIType bitfieldExtract(genIType, int, int);
genUType bitfieldExtract(genUType, int, int); genUType bitfieldExtract(genUType, int, int);
genIType bitfieldInsert(genIType, genIType, int, int); genIType bitfieldInsert(genIType, genIType, int, int);
...@@ -261,13 +371,23 @@ GROUP BEGIN Integer ...@@ -261,13 +371,23 @@ GROUP BEGIN Integer
void imulExtended(genIType, genIType, out genIType, out genIType); void imulExtended(genIType, genIType, out genIType, out genIType);
GROUP END Integer GROUP END Integer
GROUP BEGIN TextureESSL100 GROUP BEGIN TextureFirstVersions
DEFAULT METADATA {"level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
vec4 texture2D(sampler2D, vec2); vec4 texture2D(sampler2D, vec2);
vec4 texture2DProj(sampler2D, vec3); vec4 texture2DProj(sampler2D, vec3);
vec4 texture2DProj(sampler2D, vec4); vec4 texture2DProj(sampler2D, vec4);
vec4 textureCube(samplerCube, vec3); vec4 textureCube(samplerCube, vec3);
GROUP END TextureESSL100 DEFAULT METADATA {"glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
vec4 texture1D(sampler1D, float);
vec4 texture1DProj(sampler1D, vec2);
vec4 texture1DProj(sampler1D, vec4);
vec4 texture3D(sampler3D, vec3);
vec4 texture3DProj(sampler3D, vec4);
vec4 shadow1D(sampler1DShadow, vec3);
vec4 shadow1DProj(sampler1DShadow, vec4);
vec4 shadow2D(sampler2DShadow, vec3);
vec4 shadow2DProj(sampler2DShadow, vec4);
GROUP END TextureFirstVersions
// These are extension functions from OES_EGL_image_external and // These are extension functions from OES_EGL_image_external and
// NV_EGL_stream_consumer_external. We don't have a way to mark a built-in with two alternative // NV_EGL_stream_consumer_external. We don't have a way to mark a built-in with two alternative
...@@ -276,18 +396,18 @@ GROUP END TextureESSL100 ...@@ -276,18 +396,18 @@ GROUP END TextureESSL100
// created if one of the extensions is enabled. // created if one of the extensions is enabled.
// TODO(oetuaho): Consider implementing a cleaner solution. // TODO(oetuaho): Consider implementing a cleaner solution.
GROUP BEGIN EGL_image_external GROUP BEGIN EGL_image_external
DEFAULT METADATA {"level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction"}
vec4 texture2D(samplerExternalOES, vec2); vec4 texture2D(samplerExternalOES, vec2);
vec4 texture2DProj(samplerExternalOES, vec3); vec4 texture2DProj(samplerExternalOES, vec3);
vec4 texture2DProj(samplerExternalOES, vec4); vec4 texture2DProj(samplerExternalOES, vec4);
GROUP END EGL_image_external GROUP END EGL_image_external
GROUP BEGIN ARB_texture_rectangle GROUP BEGIN ARB_texture_rectangle
DEFAULT METADATA {"level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "extension": "ARB_texture_rectangle"} DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "extension": "ARB_texture_rectangle"}
vec4 texture2DRect(sampler2DRect, vec2); vec4 texture2DRect(sampler2DRect, vec2);
vec4 texture2DRectProj(sampler2DRect, vec3); vec4 texture2DRectProj(sampler2DRect, vec3);
vec4 texture2DRectProj(sampler2DRect, vec4); vec4 texture2DRectProj(sampler2DRect, vec4);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "ARB_texture_rectangle"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "ARB_texture_rectangle"}
// We don't have a rectangle texture extension for OpenGL ES however based on the behavior of // We don't have a rectangle texture extension for OpenGL ES however based on the behavior of
// rectangle texture in desktop OpenGL, they should be sampled with a "texture" overload in // rectangle texture in desktop OpenGL, they should be sampled with a "texture" overload in
// GLSL version that have such an overload. This is the case for ESSL3 and above. // GLSL version that have such an overload. This is the case for ESSL3 and above.
...@@ -299,63 +419,116 @@ GROUP END ARB_texture_rectangle ...@@ -299,63 +419,116 @@ GROUP END ARB_texture_rectangle
// The *Grad* variants are new to both vertex and fragment shaders; the fragment // The *Grad* variants are new to both vertex and fragment shaders; the fragment
// shader specific pieces are added separately below. // shader specific pieces are added separately below.
GROUP BEGIN EXT_shader_texture_lod GROUP BEGIN EXT_shader_texture_lod
DEFAULT METADATA {"level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "extension": "EXT_shader_texture_lod"} DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "extension": "EXT_shader_texture_lod"}
vec4 texture2DGradEXT(sampler2D, vec2, vec2, vec2); vec4 texture2DGradEXT(sampler2D, vec2, vec2, vec2);
vec4 texture2DProjGradEXT(sampler2D, vec3, vec2, vec2); vec4 texture2DProjGradEXT(sampler2D, vec3, vec2, vec2);
vec4 texture2DProjGradEXT(sampler2D, vec4, vec2, vec2); vec4 texture2DProjGradEXT(sampler2D, vec4, vec2, vec2);
vec4 textureCubeGradEXT(samplerCube, vec3, vec3, vec3); vec4 textureCubeGradEXT(samplerCube, vec3, vec3, vec3);
GROUP END EXT_shader_texture_lod GROUP END EXT_shader_texture_lod
GROUP BEGIN TextureESSL100FS {"condition": "shaderType == GL_FRAGMENT_SHADER"} GROUP BEGIN TextureFirstVersionsFS {"condition": "shaderType == GL_FRAGMENT_SHADER"}
DEFAULT METADATA {"level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
vec4 texture2D(sampler2D, vec2, float); vec4 texture2D(sampler2D, vec2, float);
vec4 texture2DProj(sampler2D, vec3, float); vec4 texture2DProj(sampler2D, vec3, float);
vec4 texture2DProj(sampler2D, vec4, float); vec4 texture2DProj(sampler2D, vec4, float);
vec4 textureCube(samplerCube, vec3, float); vec4 textureCube(samplerCube, vec3, float);
DEFAULT METADATA {"level": "ESSL1_BUILTINS", "op": "auto", "extension": "OES_standard_derivatives", "hasSideEffects": "true", "suffix": "Ext"} DEFAULT METADATA {"glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
vec4 texture3D(sampler3D, vec3, float);
vec4 texture3DProj(sampler3D, vec4, float);
vec4 texture3DLod(sampler3D, vec3, float);
vec4 texture3DProjLod(sampler3D, vec4, float);
vec4 texture1D(sampler1D, float, float);
vec4 texture1DProj(sampler1D, vec2, float);
vec4 texture1DProj(sampler1D, vec4, float);
vec4 shadow1D(sampler1DShadow, vec3, float);
vec4 shadow1DProj(sampler1DShadow, vec4, float);
vec4 shadow2D(sampler2DShadow, vec3, float);
vec4 shadow2DProj(sampler2DShadow, vec4, float);
GROUP END TextureFirstVersionsFS
GROUP BEGIN TextureFirstVersionsFSExt {"condition": "shaderType == GL_FRAGMENT_SHADER"}
DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "auto", "extension": "OES_standard_derivatives", "hasSideEffects": "true", "suffix": "Ext"}
genType dFdx(genType); genType dFdx(genType);
genType dFdy(genType); genType dFdy(genType);
genType fwidth(genType); genType fwidth(genType);
DEFAULT METADATA {"level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "extension": "EXT_shader_texture_lod"} DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "extension": "EXT_shader_texture_lod"}
vec4 texture2DLodEXT(sampler2D, vec2, float); vec4 texture2DLodEXT(sampler2D, vec2, float);
vec4 texture2DProjLodEXT(sampler2D, vec3, float); vec4 texture2DProjLodEXT(sampler2D, vec3, float);
vec4 texture2DProjLodEXT(sampler2D, vec4, float); vec4 texture2DProjLodEXT(sampler2D, vec4, float);
vec4 textureCubeLodEXT(samplerCube, vec3, float); vec4 textureCubeLodEXT(samplerCube, vec3, float);
DEFAULT METADATA {"level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_texture_3D"} DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_texture_3D"}
vec4 texture3D(sampler3D, vec3); vec4 texture3D(sampler3D, vec3);
vec4 texture3D(sampler3D, vec3, float);
vec4 texture3DProj(sampler3D, vec4); vec4 texture3DProj(sampler3D, vec4);
DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_texture_3D"}
vec4 texture3D(sampler3D, vec3, float);
vec4 texture3DProj(sampler3D, vec4, float); vec4 texture3DProj(sampler3D, vec4, float);
DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_texture_3D"}
vec4 texture3DLod(sampler3D, vec3, float); vec4 texture3DLod(sampler3D, vec3, float);
vec4 texture3DProjLod(sampler3D, vec4, float); vec4 texture3DProjLod(sampler3D, vec4, float);
GROUP END TextureESSL100FS GROUP END TextureFirstVersionsFSExt
GROUP BEGIN TextureESSL100VS {"condition": "shaderType == GL_VERTEX_SHADER"} GROUP BEGIN TextureFirstVersionsVS {"condition": "shaderType == GL_VERTEX_SHADER"}
DEFAULT METADATA {"level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
vec4 texture2DLod(sampler2D, vec2, float); vec4 texture2DLod(sampler2D, vec2, float);
vec4 texture2DProjLod(sampler2D, vec3, float); vec4 texture2DProjLod(sampler2D, vec3, float);
vec4 texture2DProjLod(sampler2D, vec4, float); vec4 texture2DProjLod(sampler2D, vec4, float);
vec4 textureCubeLod(samplerCube, vec3, float); vec4 textureCubeLod(samplerCube, vec3, float);
GROUP END TextureESSL100VS DEFAULT METADATA {"glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
vec4 texture1DLod(sampler1D, float, float);
vec4 texture1DProjLod(sampler1D, vec2, float);
vec4 texture1DProjLod(sampler1D, vec4, float);
vec4 shadow1DLod(sampler1DShadow, vec3, float);
vec4 shadow1DProjLod(sampler1DShadow, vec4, float);
vec4 shadow2DLod(sampler2DShadow, vec3, float);
vec4 shadow2DProjLod(sampler2DShadow, vec4, float);
GROUP END TextureFirstVersionsVS
GROUP BEGIN TextureESSL300 GROUP BEGIN TextureNoBias
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texture(gsampler2D, vec2); gvec4 texture(gsampler2D, vec2);
gvec4 texture(gsampler3D, vec3); gvec4 texture(gsampler3D, vec3);
gvec4 texture(gsamplerCube, vec3); gvec4 texture(gsamplerCube, vec3);
gvec4 texture(gsampler2DArray, vec3); gvec4 texture(gsampler2DArray, vec3);
float texture(sampler2DShadow, vec3);
float texture(samplerCubeShadow, vec4);
float texture(sampler2DArrayShadow, vec4);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texture(gsampler1D, float);
float texture(sampler1DShadow, vec3);
gvec4 texture(gsampler1DArray, vec3);
float texture(sampler1DArrayShadow, vec3);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texture(gsampler2DRect, vec2);
float texture(sampler2DRectShadow, vec3);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
float texture(samplerCubeArrayShadow, vec4, float);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProj(gsampler2D, vec3); gvec4 textureProj(gsampler2D, vec3);
gvec4 textureProj(gsampler2D, vec4); gvec4 textureProj(gsampler2D, vec4);
gvec4 textureProj(gsampler3D, vec4); gvec4 textureProj(gsampler3D, vec4);
float textureProj(sampler2DShadow, vec4);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProj(gsampler1D, vec2);
gvec4 textureProj(gsampler1D, vec4);
float textureProj(sampler1DShadow, vec4);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProj(gsampler2DRect, vec3);
gvec4 textureProj(gsampler2DRect, vec4);
float textureProj(sampler2DRectShadow, vec4);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureLod(gsampler2D, vec2, float); gvec4 textureLod(gsampler2D, vec2, float);
gvec4 textureLod(gsampler3D, vec3, float); gvec4 textureLod(gsampler3D, vec3, float);
gvec4 textureLod(gsamplerCube, vec3, float); gvec4 textureLod(gsamplerCube, vec3, float);
gvec4 textureLod(gsampler2DArray, vec3, float); gvec4 textureLod(gsampler2DArray, vec3, float);
float texture(sampler2DShadow, vec3);
float texture(samplerCubeShadow, vec4);
float texture(sampler2DArrayShadow, vec4);
float textureProj(sampler2DShadow, vec4);
float textureLod(sampler2DShadow, vec3, float); float textureLod(sampler2DShadow, vec3, float);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureLod(gsampler1D, float, float);
float textureLod(sampler1DShadow, vec3, float);
gvec4 textureLod(gsampler1DArray, vec2, float);
float textureLod(sampler1DArrayShadow, vec3, float);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureLod(gsamplerCubeArray, vec4, float);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
ivec2 textureSize(gsampler2D, int); ivec2 textureSize(gsampler2D, int);
ivec3 textureSize(gsampler3D, int); ivec3 textureSize(gsampler3D, int);
ivec2 textureSize(gsamplerCube, int); ivec2 textureSize(gsamplerCube, int);
...@@ -363,87 +536,296 @@ GROUP BEGIN TextureESSL300 ...@@ -363,87 +536,296 @@ GROUP BEGIN TextureESSL300
ivec2 textureSize(sampler2DShadow, int); ivec2 textureSize(sampler2DShadow, int);
ivec2 textureSize(samplerCubeShadow, int); ivec2 textureSize(samplerCubeShadow, int);
ivec3 textureSize(sampler2DArrayShadow, int); ivec3 textureSize(sampler2DArrayShadow, int);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
int textureSize(gsampler1D, int);
int textureSize(sampler1DShadow, int);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
ivec3 textureSize(gsamplerCubeArray, int);
ivec3 textureSize(samplerCubeArrayShadow, int);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
ivec2 textureSize(gsampler2DRect);
ivec2 textureSize(sampler2DRectShadow);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
ivec2 textureSize(gsampler1DArray, int);
ivec2 textureSize(sampler1DArrayShadow, int);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
int textureSize(gsamplerBuffer);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjLod(gsampler2D, vec3, float); gvec4 textureProjLod(gsampler2D, vec3, float);
gvec4 textureProjLod(gsampler2D, vec4, float); gvec4 textureProjLod(gsampler2D, vec4, float);
gvec4 textureProjLod(gsampler3D, vec4, float); gvec4 textureProjLod(gsampler3D, vec4, float);
float textureProjLod(sampler2DShadow, vec4, float); float textureProjLod(sampler2DShadow, vec4, float);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjLod(gsampler1D, vec2, float);
gvec4 textureProjLod(gsampler1D, vec4, float);
float textureProjLod(sampler1DShadow, vec4, float);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetch(gsampler2D, ivec2, int); gvec4 texelFetch(gsampler2D, ivec2, int);
gvec4 texelFetch(gsampler3D, ivec3, int); gvec4 texelFetch(gsampler3D, ivec3, int);
gvec4 texelFetch(gsampler2DArray, ivec3, int); gvec4 texelFetch(gsampler2DArray, ivec3, int);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetch(gsampler1D, int, int);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetch(gsampler2DRect, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetch(gsampler1DArray, ivec2, int);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetch(gsamplerBuffer, int);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureGrad(gsampler2D, vec2, vec2, vec2); gvec4 textureGrad(gsampler2D, vec2, vec2, vec2);
gvec4 textureGrad(gsampler3D, vec3, vec3, vec3); gvec4 textureGrad(gsampler3D, vec3, vec3, vec3);
gvec4 textureGrad(gsamplerCube, vec3, vec3, vec3); gvec4 textureGrad(gsamplerCube, vec3, vec3, vec3);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureGrad(gsampler2D, float, float, float);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureGrad(gsampler2DRect, vec2, vec2, vec2);
gvec4 textureGrad(sampler2DRectShadow, vec3, vec2, vec2);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
float textureGrad(sampler2DShadow, vec3, vec2, vec2); float textureGrad(sampler2DShadow, vec3, vec2, vec2);
float textureGrad(samplerCubeShadow, vec4, vec3, vec3); float textureGrad(samplerCubeShadow, vec4, vec3, vec3);
gvec4 textureGrad(gsampler2DArray, vec3, vec2, vec2); gvec4 textureGrad(gsampler2DArray, vec3, vec2, vec2);
float textureGrad(sampler2DArrayShadow, vec4, vec2, vec2); float textureGrad(sampler2DArrayShadow, vec4, vec2, vec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
float textureGrad(sampler1DShadow, vec3, float, float);
gvec4 textureGrad(gsampler1DArray, vec2, float, float);
float textureGrad(sampler1DArrayShadow, vec3, float, float);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureGrad(gsamplerCubeArray, vec4, vec3, vec3);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjGrad(gsampler2D, vec3, vec2, vec2); gvec4 textureProjGrad(gsampler2D, vec3, vec2, vec2);
gvec4 textureProjGrad(gsampler2D, vec4, vec2, vec2); gvec4 textureProjGrad(gsampler2D, vec4, vec2, vec2);
gvec4 textureProjGrad(gsampler3D, vec4, vec3, vec3); gvec4 textureProjGrad(gsampler3D, vec4, vec3, vec3);
float textureProjGrad(sampler2DShadow, vec4, vec2, vec2); float textureProjGrad(sampler2DShadow, vec4, vec2, vec2);
GROUP END TextureESSL300 DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjGrad(gsampler1D, vec2, float, float);
gvec4 textureProjGrad(gsampler1D, vec4, float, float);
float textureProjGrad(sampler1DShadow, vec4, float, float);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjGrad(gsampler2DRect, vec3, vec2, vec2);
gvec4 textureProjGrad(gsampler2DRect, vec4, vec2, vec2);
float textureProjGrad(sampler2DRectShadow, vec4, vec2, vec2);
DEFAULT METADATA {"glsl_level": "GLSL4_3_BUILTINS", "op": "CallBuiltInFunction"}
int textureQueryLevels(gsampler1D);
int textureQueryLevels(gsampler2D);
int textureQueryLevels(gsampler3D);
int textureQueryLevels(gsamplerCube);
int textureQueryLevels(gsampler1DArray);
int textureQueryLevels(gsampler2DArray);
int textureQueryLevels(gsamplerCubeArray);
int textureQueryLevels(sampler1DShadow);
int textureQueryLevels(sampler2DShadow);
int textureQueryLevels(samplerCubeShadow);
int textureQueryLevels(sampler1DArrayShadow);
int textureQueryLevels(sampler2DArrayShadow);
int textureQueryLevels(samplerCubeArrayShadow);
DEFAULT METADATA {"glsl_level": "GLSL4_5_BUILTINS", "op": "CallBuiltInFunction"}
int textureSamples(gsampler2DMS);
int textureSamples(gsampler2DMSArray);
GROUP END TextureNoBias
GROUP BEGIN TextureSizeMS GROUP BEGIN TextureSizeMS
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction"}
ivec2 textureSize(gsampler2DMS); ivec2 textureSize(gsampler2DMS);
GROUP END TextureSizeMS GROUP END TextureSizeMS
GROUP BEGIN TextureSizeMSExt GROUP BEGIN TextureSizeMSExt
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "ANGLE_texture_multisample", "suffix": "Ext"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "ANGLE_texture_multisample", "suffix": "Ext"}
ivec2 textureSize(gsampler2DMS); ivec2 textureSize(gsampler2DMS);
GROUP END TextureSizeMSExt GROUP END TextureSizeMSExt
GROUP BEGIN TextureSizeMSArray GROUP BEGIN TextureSizeMSArray
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_texture_storage_multisample_2d_array"} DEFAULT METADATA {"glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction"}
ivec3 textureSize(gsampler2DMSArray); ivec3 textureSize(gsampler2DMSArray);
GROUP END TextureSizeMSArray GROUP END TextureSizeMSArray
GROUP BEGIN TextureSizeMSArrayExt
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_texture_storage_multisample_2d_array", "suffix": "Ext"}
ivec3 textureSize(gsampler2DMSArray);
GROUP END TextureSizeMSArrayExt
GROUP BEGIN TexelFetchMS
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetch(gsampler2DMS, ivec2, int);
GROUP END TexelFetchMS
GROUP BEGIN TexelFetchMSExt
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "ANGLE_texture_multisample", "suffix": "Ext"}
gvec4 texelFetch(gsampler2DMS, ivec2, int);
GROUP END TexelFetchMSExt
GROUP BEGIN TexelFetchMSArray
DEFAULT METADATA {"glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetch(gsampler2DMSArray, ivec3, int);
GROUP END TexelFetchMSArray
GROUP BEGIN TexelFetchMSArrayExt
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_texture_storage_multisample_2d_array", "suffix": "Ext"}
gvec4 texelFetch(gsampler2DMSArray, ivec3, int);
GROUP END TexelFetchMSArrayExt
GROUP BEGIN TextureBias {"condition": "shaderType == GL_FRAGMENT_SHADER"}
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texture(gsampler2D, vec2, float);
gvec4 texture(gsampler3D, vec3, float);
gvec4 texture(gsamplerCube, vec3, float);
gvec4 texture(gsampler2DArray, vec3, float);
gvec4 textureProj(gsampler2D, vec3, float);
gvec4 textureProj(gsampler2D, vec4, float);
gvec4 textureProj(gsampler3D, vec4, float);
float texture(sampler2DShadow, vec3, float);
float texture(samplerCubeShadow, vec4, float);
float textureProj(sampler2DShadow, vec4, float);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texture(gsampler1D, float, float);
float texture(sampler1DShadow, vec3, float);
gvec4 texture(gsampler1DArray, vec3, float);
float texture(sampler1DArrayShadow, vec3, float);
float texture(sampler2DArrayShadow, vec4, float);
gvec4 textureProj(gsampler1D, vec2, float);
gvec4 textureProj(gsampler1D, vec4, float);
float textureProj(sampler1DShadow, vec4, float);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_EGL_image_external_essl3"}
vec4 texture(samplerExternalOES, vec2, float);
vec4 textureProj(samplerExternalOES, vec3, float);
vec4 textureProj(samplerExternalOES, vec4, float);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "EXT_YUV_target"}
vec4 texture(samplerExternal2DY2YEXT, vec2, float);
vec4 textureProj(samplerExternal2DY2YEXT, vec3, float);
vec4 textureProj(samplerExternal2DY2YEXT, vec4, float);
GROUP END TextureBias
GROUP BEGIN TextureQueryLod {"condition": "shaderType == GL_FRAGMENT_SHADER"}
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
vec2 textureQueryLod(gsampler1D, float);
vec2 textureQueryLod(gsampler2D, vec2);
vec2 textureQueryLod(gsampler3D, vec3);
vec2 textureQueryLod(gsamplerCube, vec3);
vec2 textureQueryLod(gsampler1DArray, float);
vec2 textureQueryLod(gsampler2DArray, vec2);
vec2 textureQueryLod(gsamplerCubeArray, vec3);
vec2 textureQueryLod(sampler1DShadow, float);
vec2 textureQueryLod(sampler2DShadow, vec2);
vec2 textureQueryLod(samplerCubeShadow, vec3);
vec2 textureQueryLod(sampler1DArrayShadow, float);
vec2 textureQueryLod(sampler2DArrayShadow, vec2);
vec2 textureQueryLod(samplerCubeArrayShadow, vec3);
GROUP END TextureQueryLod
GROUP BEGIN TextureOffsetNoBias {"queryFunction": true} GROUP BEGIN TextureOffsetNoBias {"queryFunction": true}
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureOffset(gsampler2D, vec2, ivec2); gvec4 textureOffset(gsampler2D, vec2, ivec2);
gvec4 textureOffset(gsampler3D, vec3, ivec3); gvec4 textureOffset(gsampler3D, vec3, ivec3);
float textureOffset(sampler2DShadow, vec3, ivec2); float textureOffset(sampler2DShadow, vec3, ivec2);
gvec4 textureOffset(gsampler2DArray, vec3, ivec2); gvec4 textureOffset(gsampler2DArray, vec3, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureOffset(gsampler1D, float, int);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureOffset(gsampler2DRect, vec2, ivec2);
float textureOffset(sampler2DRectShadow, vec3, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
float textureOffset(sampler1DShadow, vec3, int);
gvec4 textureOffset(gsampler1DArray, vec2, int);
float textureOffset(sampler1DArrayShadow, vec3, int);
DEFAULT METADATA {"glsl_level": "GLSL4_3_BUILTINS", "op": "CallBuiltInFunction"}
float textureOffset(sampler2DArrayShadow, vec4, ivec2);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjOffset(gsampler2D, vec3, ivec2); gvec4 textureProjOffset(gsampler2D, vec3, ivec2);
gvec4 textureProjOffset(gsampler2D, vec4, ivec2); gvec4 textureProjOffset(gsampler2D, vec4, ivec2);
gvec4 textureProjOffset(gsampler3D, vec4, ivec3); gvec4 textureProjOffset(gsampler3D, vec4, ivec3);
float textureProjOffset(sampler2DShadow, vec4, ivec2); float textureProjOffset(sampler2DShadow, vec4, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjOffset(gsampler1D, vec2, int);
gvec4 textureProjOffset(gsampler1D, vec4, int);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjOffset(gsampler2DRect, vec3, ivec2);
gvec4 textureProjOffset(gsampler2DRect, vec4, ivec2);
float textureProjOffset(sampler2DRectShadow, vec4, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
float textureProjOffset(sampler1DShadow, vec4, int);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureLodOffset(gsampler2D, vec2, float, ivec2); gvec4 textureLodOffset(gsampler2D, vec2, float, ivec2);
gvec4 textureLodOffset(gsampler3D, vec3, float, ivec3); gvec4 textureLodOffset(gsampler3D, vec3, float, ivec3);
float textureLodOffset(sampler2DShadow, vec3, float, ivec2); float textureLodOffset(sampler2DShadow, vec3, float, ivec2);
gvec4 textureLodOffset(gsampler2DArray, vec3, float, ivec2); gvec4 textureLodOffset(gsampler2DArray, vec3, float, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureLodOffset(gsampler1D, float, float, int);
float textureLodOffset(sampler1DShadow, vec3, float, int);
gvec4 textureLodOffset(gsampler1DArray, vec2, float, int);
float textureLodOffset(sampler1DArrayShadow, vec3, float, int);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjLodOffset(gsampler2D, vec3, float, ivec2); gvec4 textureProjLodOffset(gsampler2D, vec3, float, ivec2);
gvec4 textureProjLodOffset(gsampler2D, vec4, float, ivec2); gvec4 textureProjLodOffset(gsampler2D, vec4, float, ivec2);
gvec4 textureProjLodOffset(gsampler3D, vec4, float, ivec3); gvec4 textureProjLodOffset(gsampler3D, vec4, float, ivec3);
float textureProjLodOffset(sampler2DShadow, vec4, float, ivec2); float textureProjLodOffset(sampler2DShadow, vec4, float, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjLodOffset(gsampler1D, vec2, float, int);
gvec4 textureProjLodOffset(gsampler1D, vec4, float, int);
float textureProjLodOffset(sampler1DShadow, vec4, float, int);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetchOffset(gsampler2D, ivec2, int, ivec2); gvec4 texelFetchOffset(gsampler2D, ivec2, int, ivec2);
gvec4 texelFetchOffset(gsampler3D, ivec3, int, ivec3); gvec4 texelFetchOffset(gsampler3D, ivec3, int, ivec3);
gvec4 texelFetchOffset(gsampler2DArray, ivec3, int, ivec2); gvec4 texelFetchOffset(gsampler2DArray, ivec3, int, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetchOffset(gsampler1D, int, int, int);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetchOffset(gsampler2DRect, ivec2, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetchOffset(gsampler1DArray, ivec2, int, int);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureGradOffset(gsampler2D, vec2, vec2, vec2, ivec2); gvec4 textureGradOffset(gsampler2D, vec2, vec2, vec2, ivec2);
gvec4 textureGradOffset(gsampler3D, vec3, vec3, vec3, ivec3); gvec4 textureGradOffset(gsampler3D, vec3, vec3, vec3, ivec3);
float textureGradOffset(sampler2DShadow, vec3, vec2, vec2, ivec2); float textureGradOffset(sampler2DShadow, vec3, vec2, vec2, ivec2);
gvec4 textureGradOffset(gsampler2DArray, vec3, vec2, vec2, ivec2); gvec4 textureGradOffset(gsampler2DArray, vec3, vec2, vec2, ivec2);
float textureGradOffset(sampler2DArrayShadow, vec4, vec2, vec2, ivec2); float textureGradOffset(sampler2DArrayShadow, vec4, vec2, vec2, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureGradOffset(gsampler1D, float, float, float, int);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureGradOffset(gsampler2DRect, vec2, vec2, vec2, ivec2);
float textureGradOffset(sampler2DRectShadow, vec3, vec2, vec2, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
float textureGradOffset(sampler1DShadow, vec3, float, float, int);
gvec4 textureGradOffset(gsampler1DArray, vec2, float, float, int);
float textureGradOffset(sampler1DArrayShadow, vec3, float, float, int);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjGradOffset(gsampler2D, vec3, vec2, vec2, ivec2); gvec4 textureProjGradOffset(gsampler2D, vec3, vec2, vec2, ivec2);
gvec4 textureProjGradOffset(gsampler2D, vec4, vec2, vec2, ivec2); gvec4 textureProjGradOffset(gsampler2D, vec4, vec2, vec2, ivec2);
gvec4 textureProjGradOffset(gsampler3D, vec4, vec3, vec3, ivec3); gvec4 textureProjGradOffset(gsampler3D, vec4, vec3, vec3, ivec3);
float textureProjGradOffset(sampler2DShadow, vec4, vec2, vec2, ivec2); float textureProjGradOffset(sampler2DShadow, vec4, vec2, vec2, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjGradOffset(gsampler1D, vec2, float, float, int);
gvec4 textureProjGradOffset(gsampler1D, vec4, float, float, int);
DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjGradOffset(gsampler2DRect, vec3, vec2, vec2, ivec2);
gvec4 textureProjGradOffset(gsampler2DRect, vec4, vec2, vec2, ivec2);
float textureProjGradOffset(sampler2DRectShadow, vec4, vec2, vec2, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
float textureProjGradOffset(sampler1DShadow, vec4, float, float, int);
GROUP END TextureOffsetNoBias GROUP END TextureOffsetNoBias
GROUP BEGIN TextureOffsetBias {"queryFunction": true, "condition": "shaderType == GL_FRAGMENT_SHADER"} GROUP BEGIN TextureOffsetBias {"queryFunction": true, "condition": "shaderType == GL_FRAGMENT_SHADER"}
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureOffset(gsampler2D, vec2, ivec2, float); gvec4 textureOffset(gsampler2D, vec2, ivec2, float);
gvec4 textureOffset(gsampler3D, vec3, ivec3, float); gvec4 textureOffset(gsampler3D, vec3, ivec3, float);
float textureOffset(sampler2DShadow, vec3, ivec2, float); float textureOffset(sampler2DShadow, vec3, ivec2, float);
gvec4 textureOffset(gsampler2DArray, vec3, ivec2, float); gvec4 textureOffset(gsampler2DArray, vec3, ivec2, float);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureOffset(gsampler1D, float, int, float);
float textureOffset(sampler1DShadow, vec3, int, float);
gvec4 textureOffset(gsampler1DArray, vec2, int, float);
float textureOffset(sampler1DArrayShadow, vec3, int, float);
DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjOffset(gsampler2D, vec3, ivec2, float); gvec4 textureProjOffset(gsampler2D, vec3, ivec2, float);
gvec4 textureProjOffset(gsampler2D, vec4, ivec2, float); gvec4 textureProjOffset(gsampler2D, vec4, ivec2, float);
gvec4 textureProjOffset(gsampler3D, vec4, ivec3, float); gvec4 textureProjOffset(gsampler3D, vec4, ivec3, float);
float textureProjOffset(sampler2DShadow, vec4, ivec2, float); float textureProjOffset(sampler2DShadow, vec4, ivec2, float);
DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureProjOffset(gsampler1D, vec2, int, float);
gvec4 textureProjOffset(gsampler1D, vec4, int, float);
float textureProjOffset(sampler1DShadow, vec4, int, float);
GROUP END TextureOffsetBias GROUP END TextureOffsetBias
GROUP BEGIN EGL_image_external_essl3 GROUP BEGIN EGL_image_external_essl3
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_EGL_image_external_essl3"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_EGL_image_external_essl3"}
vec4 texture(samplerExternalOES, vec2); vec4 texture(samplerExternalOES, vec2);
vec4 textureProj(samplerExternalOES, vec3); vec4 textureProj(samplerExternalOES, vec3);
vec4 textureProj(samplerExternalOES, vec4); vec4 textureProj(samplerExternalOES, vec4);
...@@ -452,7 +834,7 @@ GROUP BEGIN EGL_image_external_essl3 ...@@ -452,7 +834,7 @@ GROUP BEGIN EGL_image_external_essl3
GROUP END EGL_image_external_essl3 GROUP END EGL_image_external_essl3
GROUP BEGIN EXT_yuv_target GROUP BEGIN EXT_yuv_target
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "EXT_YUV_target"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "EXT_YUV_target"}
vec4 texture(samplerExternal2DY2YEXT, vec2); vec4 texture(samplerExternal2DY2YEXT, vec2);
vec4 textureProj(samplerExternal2DY2YEXT, vec3); vec4 textureProj(samplerExternal2DY2YEXT, vec3);
vec4 textureProj(samplerExternal2DY2YEXT, vec4); vec4 textureProj(samplerExternal2DY2YEXT, vec4);
...@@ -462,84 +844,108 @@ GROUP BEGIN EXT_yuv_target ...@@ -462,84 +844,108 @@ GROUP BEGIN EXT_yuv_target
vec4 texelFetch(samplerExternal2DY2YEXT, ivec2, int); vec4 texelFetch(samplerExternal2DY2YEXT, ivec2, int);
GROUP END EXT_yuv_target GROUP END EXT_yuv_target
GROUP BEGIN TextureESSL300FS {"condition": "shaderType == GL_FRAGMENT_SHADER"}
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texture(gsampler2D, vec2, float);
gvec4 texture(gsampler3D, vec3, float);
gvec4 texture(gsamplerCube, vec3, float);
gvec4 texture(gsampler2DArray, vec3, float);
gvec4 textureProj(gsampler2D, vec3, float);
gvec4 textureProj(gsampler2D, vec4, float);
gvec4 textureProj(gsampler3D, vec4, float);
float texture(sampler2DShadow, vec3, float);
float texture(samplerCubeShadow, vec4, float);
float textureProj(sampler2DShadow, vec4, float);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_EGL_image_external_essl3"}
vec4 texture(samplerExternalOES, vec2, float);
vec4 textureProj(samplerExternalOES, vec3, float);
vec4 textureProj(samplerExternalOES, vec4, float);
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "EXT_YUV_target"}
vec4 texture(samplerExternal2DY2YEXT, vec2, float);
vec4 textureProj(samplerExternal2DY2YEXT, vec3, float);
vec4 textureProj(samplerExternal2DY2YEXT, vec4, float);
GROUP END TextureESSL300FS
GROUP BEGIN TexelFetchMS
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetch(gsampler2DMS, ivec2, int);
GROUP END TexelFetchMS
GROUP BEGIN TexelFetchMSExt
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "extension": "ANGLE_texture_multisample", "suffix": "Ext"}
gvec4 texelFetch(gsampler2DMS, ivec2, int);
GROUP END TexelFetchMSExt
GROUP BEGIN TexelFetchMSArray
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_texture_storage_multisample_2d_array"}
gvec4 texelFetch(gsampler2DMSArray, ivec3, int);
GROUP END TexelFetchMSArray
GROUP BEGIN TextureGather {"queryFunction": true} GROUP BEGIN TextureGather {"queryFunction": true}
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureGather(gsampler2D, vec2); gvec4 textureGather(gsampler2D, vec2);
gvec4 textureGather(gsampler2D, vec2, int); gvec4 textureGather(gsampler2D, vec2, int);
gvec4 textureGather(gsampler2DArray, vec3); gvec4 textureGather(gsampler2DArray, vec3);
gvec4 textureGather(gsampler2DArray, vec3, int); gvec4 textureGather(gsampler2DArray, vec3, int);
gvec4 textureGather(gsamplerCube, vec3); gvec4 textureGather(gsamplerCube, vec3);
gvec4 textureGather(gsamplerCube, vec3, int); gvec4 textureGather(gsamplerCube, vec3, int);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureGather(gsamplerCubeArray, vec4);
gvec4 textureGather(gsamplerCubeArray, vec4, int);
gvec4 textureGather(gsampler2DRect, vec3);
gvec4 textureGather(gsampler2DRect, vec3, int);
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
vec4 textureGather(sampler2DShadow, vec2); vec4 textureGather(sampler2DShadow, vec2);
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
vec4 textureGather(sampler2DShadow, vec2, float); vec4 textureGather(sampler2DShadow, vec2, float);
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
vec4 textureGather(sampler2DArrayShadow, vec3); vec4 textureGather(sampler2DArrayShadow, vec3);
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
vec4 textureGather(sampler2DArrayShadow, vec3, float); vec4 textureGather(sampler2DArrayShadow, vec3, float);
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
vec4 textureGather(samplerCubeShadow, vec3); vec4 textureGather(samplerCubeShadow, vec3);
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
vec4 textureGather(samplerCubeShadow, vec3, float); vec4 textureGather(samplerCubeShadow, vec3, float);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
vec4 textureGather(samplerCubeArrayShadow, vec4, float);
vec4 textureGather(sampler2DRectShadow, vec2, float);
GROUP BEGIN Offset {"queryFunction": true} GROUP BEGIN Offset {"queryFunction": true}
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureGatherOffset(gsampler2D, vec2, ivec2); gvec4 textureGatherOffset(gsampler2D, vec2, ivec2);
gvec4 textureGatherOffset(gsampler2D, vec2, ivec2, int); gvec4 textureGatherOffset(gsampler2D, vec2, ivec2, int);
gvec4 textureGatherOffset(gsampler2DArray, vec3, ivec2); gvec4 textureGatherOffset(gsampler2DArray, vec3, ivec2);
gvec4 textureGatherOffset(gsampler2DArray, vec3, ivec2, int); gvec4 textureGatherOffset(gsampler2DArray, vec3, ivec2, int);
vec4 textureGatherOffset(sampler2DShadow, vec2, float, ivec2); vec4 textureGatherOffset(sampler2DShadow, vec2, float, ivec2);
vec4 textureGatherOffset(sampler2DArrayShadow, vec3, float, ivec2); vec4 textureGatherOffset(sampler2DArrayShadow, vec3, float, ivec2);
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 textureGatherOffset(gsampler2DRect, vec2, ivec2);
gvec4 textureGatherOffset(gsampler2DRect, vec2, ivec2, int);
vec4 textureGatherOffset(sampler2DRectShadow, vec2, float, ivec2);
gvec4 textureGatherOffsets(gsampler2D, vec2, ivec2[4]);
gvec4 textureGatherOffsets(gsampler2D, vec2, ivec2[4], int);
gvec4 textureGatherOffsets(gsampler2DArray, vec3, ivec2[4]);
gvec4 textureGatherOffsets(gsampler2DArray, vec3, ivec2[4], int);
gvec4 textureGatherOffsets(gsampler2DRect, vec2, ivec2[4]);
gvec4 textureGatherOffsets(gsampler2DRect, vec2, ivec2[4], int);
vec4 textureGatherOffsets(sampler2DShadow, vec2, float, ivec2[4]);
vec4 textureGatherOffsets(sampler2DArrayShadow, vec3, float, ivec2[4]);
vec4 textureGatherOffsets(sampler2DRectShadow, vec2, float, ivec2[4]);
GROUP END Offset GROUP END Offset
GROUP END TextureGather GROUP END TextureGather
GROUP BEGIN DerivativesESSL300FS {"condition": "shaderType == GL_FRAGMENT_SHADER"} GROUP BEGIN DerivativesFS {"condition": "shaderType == GL_FRAGMENT_SHADER"}
DEFAULT METADATA {"level": "ESSL3_BUILTINS", "op": "auto", "hasSideEffects": "true"} DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto", "hasSideEffects": "true"}
genType dFdx(genType); genType dFdx(genType);
genType dFdy(genType); genType dFdy(genType);
genType fwidth(genType); genType fwidth(genType);
GROUP END DerivativesESSL300FS DEFAULT METADATA {"glsl_level": "GLSL4_5_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": "true"}
genType dFdxFine(genType);
genType dFdyFine(genType);
genType dFdxCoarse(genType);
genType dFdyCoarse(genType);
genType fwidthFine(genType);
genType fwidthCoarse(genType);
GROUP END DerivativesFS
GROUP BEGIN InterpolationFS {"condition": "shaderType == GL_FRAGMENT_SHADER"}
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
float interpolateAtCentroid(float);
vec2 interpolateAtCentroid(vec2);
vec3 interpolateAtCentroid(vec3);
vec4 interpolateAtCentroid(vec4);
float interpolateAtSample(float, int);
vec2 interpolateAtSample(vec2, int);
vec3 interpolateAtSample(vec3, int);
vec4 interpolateAtSample(vec4, int);
float interpolateAtOffset(float, vec2);
vec2 interpolateAtOffset(vec2, vec2);
vec3 interpolateAtOffset(vec3, vec2);
vec4 interpolateAtOffset(vec4, vec2);
GROUP END InterpolationFS
GROUP BEGIN AtomicCounter GROUP BEGIN AtomicCounter
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
uint atomicCounter(atomic_uint); uint atomicCounter(atomic_uint);
uint atomicCounterIncrement(atomic_uint); uint atomicCounterIncrement(atomic_uint);
uint atomicCounterDecrement(atomic_uint); uint atomicCounterDecrement(atomic_uint);
DEFAULT METADATA {"glsl_level": "GLSL4_6_BUILTINS", "op": "CallBuiltInFunction"}
uint atomicCounterAdd(atomic_uint, uint);
uint atomicCounterSubtract(atomic_uint, uint);
uint atomicCounterMin(atomic_uint, uint);
uint atomicCounterMax(atomic_uint, uint);
uint atomicCounterAnd(atomic_uint, uint);
uint atomicCounterOr(atomic_uint, uint);
uint atomicCounterXor(atomic_uint, uint);
uint atomicCounterExchange(atomic_uint, uint);
uint atomicCounterCompSwap(atomic_uint, uint, uint);
GROUP END AtomicCounter GROUP END AtomicCounter
GROUP BEGIN AtomicMemory {"queryFunction": true} GROUP BEGIN AtomicMemory {"queryFunction": true}
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "auto"} DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_3_BUILTINS", "op": "auto"}
uint atomicAdd(inout uint, uint); uint atomicAdd(inout uint, uint);
int atomicAdd(inout int, int); int atomicAdd(inout int, int);
uint atomicMin(inout uint, uint); uint atomicMin(inout uint, uint);
...@@ -559,42 +965,115 @@ GROUP BEGIN AtomicMemory {"queryFunction": true} ...@@ -559,42 +965,115 @@ GROUP BEGIN AtomicMemory {"queryFunction": true}
GROUP END AtomicMemory GROUP END AtomicMemory
GROUP BEGIN Image {"queryFunction": true} GROUP BEGIN Image {"queryFunction": true}
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
GROUP BEGIN Store {"queryFunction": true} GROUP BEGIN Store {"queryFunction": true}
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
void imageStore(gimage2D, ivec2, gvec4); void imageStore(gimage2D, ivec2, gvec4);
void imageStore(gimage3D, ivec3, gvec4); void imageStore(gimage3D, ivec3, gvec4);
void imageStore(gimage2DArray, ivec3, gvec4); void imageStore(gimage2DArray, ivec3, gvec4);
void imageStore(gimageCube, ivec3, gvec4); void imageStore(gimageCube, ivec3, gvec4);
DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
void imageStore(writeonly IMAGE_PARAMS, gvec4);
GROUP END Store GROUP END Store
GROUP BEGIN Load {"queryFunction": true} GROUP BEGIN Load {"queryFunction": true}
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 imageLoad(gimage2D, ivec2); gvec4 imageLoad(gimage2D, ivec2);
gvec4 imageLoad(gimage3D, ivec3); gvec4 imageLoad(gimage3D, ivec3);
gvec4 imageLoad(gimage2DArray, ivec3); gvec4 imageLoad(gimage2DArray, ivec3);
gvec4 imageLoad(gimageCube, ivec3); gvec4 imageLoad(gimageCube, ivec3);
DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 imageLoad(readonly IMAGE_PARAMS);
GROUP END Load GROUP END Load
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
ivec2 imageSize(gimage2D); ivec2 imageSize(gimage2D);
ivec3 imageSize(gimage3D); ivec3 imageSize(gimage3D);
ivec3 imageSize(gimage2DArray); ivec3 imageSize(gimage2DArray);
ivec2 imageSize(gimageCube); ivec2 imageSize(gimageCube);
DEFAULT METADATA {"glsl_level": "GLSL4_3_BUILTINS", "op": "CallBuiltInFunction"}
int imageSize(readonly writeonly gimage1D);
ivec2 imageSize(readonly writeonly gimage2D);
ivec3 imageSize(readonly writeonly gimage3D);
ivec2 imageSize(readonly writeonly gimageCube);
ivec3 imageSize(readonly writeonly gimageCubeArray);
ivec2 imageSize(readonly writeonly gimageRect);
ivec2 imageSize(readonly writeonly gimage1DArray);
ivec3 imageSize(readonly writeonly gimage2DArray);
int imageSize(readonly writeonly gimageBuffer);
ivec2 imageSize(readonly writeonly gimage2DMS);
ivec3 imageSize(readonly writeonly gimage2DMSArray);
DEFAULT METADATA {"glsl_level": "GLSL4_5_BUILTINS", "op": "CallBuiltInFunction"}
int imageSamples(readonly writeonly gimage2DMS);
int imageSamples(readonly writeonly gimage2DMSArray);
DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
uint imageAtomicAdd(IMAGE_PARAMS, uint);
int imageAtomicAdd(IMAGE_PARAMS, int);
uint imageAtomicMin(IMAGE_PARAMS, uint);
int imageAtomicMin(IMAGE_PARAMS, int);
uint imageAtomicMax(IMAGE_PARAMS, uint);
int imageAtomicMax(IMAGE_PARAMS, int);
uint imageAtomicAnd(IMAGE_PARAMS, uint);
int imageAtomicAnd(IMAGE_PARAMS, int);
uint imageAtomicOr(IMAGE_PARAMS, uint);
int imageAtomicOr(IMAGE_PARAMS, int);
uint imageAtomicXor(IMAGE_PARAMS, uint);
int imageAtomicXor(IMAGE_PARAMS, int);
uint imageAtomicExchange(IMAGE_PARAMS, uint);
int imageAtomicExchange(IMAGE_PARAMS, int);
DEFAULT METADATA {"glsl_level": "GLSL4_5_BUILTINS", "op": "CallBuiltInFunction"}
int imageAtomicExchange(IMAGE_PARAMS, float);
DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
uint imageAtomicCompSwap(IMAGE_PARAMS, uint, uint);
int imageAtomicCompSwap(IMAGE_PARAMS, int, int);
GROUP END Image GROUP END Image
GROUP BEGIN Noise
DEFAULT METADATA {"glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
float noise1(genType);
vec2 noise2(genType);
vec3 noise3(genType);
vec4 noise4(genType);
GROUP END Noise
GROUP BEGIN Barrier GROUP BEGIN Barrier
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "auto", "hasSideEffects": true} DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_2_BUILTINS", "op": "auto", "hasSideEffects": true}
void memoryBarrier(); void memoryBarrier();
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_3_BUILTINS", "op": "auto", "hasSideEffects": true}
void memoryBarrierAtomicCounter(); void memoryBarrierAtomicCounter();
void memoryBarrierBuffer(); void memoryBarrierBuffer();
void memoryBarrierImage(); void memoryBarrierImage();
GROUP END Barrier GROUP END Barrier
GROUP BEGIN ESSL310CS {"condition": "shaderType == GL_COMPUTE_SHADER"} GROUP BEGIN ESSL310CS {"condition": "shaderType == GL_COMPUTE_SHADER"}
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "auto", "hasSideEffects": true} DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto", "hasSideEffects": true}
void barrier(); void barrier();
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_3_BUILTINS", "op": "auto", "hasSideEffects": true}
void memoryBarrierShared(); void memoryBarrierShared();
void groupMemoryBarrier(); void groupMemoryBarrier();
GROUP END ESSL310CS GROUP END ESSL310CS
GROUP BEGIN ESSL310GS {"condition": "shaderType == GL_GEOMETRY_SHADER_EXT"} GROUP BEGIN ESSL310GS {"condition": "shaderType == GL_GEOMETRY_SHADER_EXT"}
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "auto", "extension": "EXT_geometry_shader", "hasSideEffects": true} DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "auto", "extension": "EXT_geometry_shader", "hasSideEffects": true}
void EmitVertex(); void EmitVertex();
void EndPrimitive(); void EndPrimitive();
GROUP END ESSL310GS GROUP END ESSL310GS
GROUP BEGIN GLSLGS {"condition": "shaderType == GL_GEOMETRY_SHADER"}
DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": "true"}
void EmitStreamVertex(int);
void EndStreamPrimitive(int);
DEFAULT METADATA {"glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": "true"}
void EmitVertex();
void EndPrimitive();
GROUP END GLSLGS
GROUP BEGIN SubpassInput
DEFAULT METADATA {"glsl_level": "GLSL4_6_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": true}
gvec4 subpassLoad(gsubpassInput);
gvec4 subpassLoad(gsubpassInputMS, int);
GROUP END SubpassInput
GROUP BEGIN ShaderInvocationGroup
DEFAULT METADATA {"glsl_level": "GLSL4_6_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": true}
bool anyInvocation(bool);
bool allInvocations(bool);
bool allInvocationsEqual(bool);
GROUP END ShaderInvocationGroup
\ No newline at end of file
...@@ -338,14 +338,98 @@ namespace BuiltInGroup ...@@ -338,14 +338,98 @@ namespace BuiltInGroup
parsed_variables = None parsed_variables = None
basic_types_enumeration = [ basic_types_enumeration = [
'Void', 'Float', 'Int', 'UInt', 'Bool', 'AtomicCounter', 'YuvCscStandardEXT', 'Sampler2D', 'Void',
'Sampler3D', 'SamplerCube', 'Sampler2DArray', 'SamplerExternalOES', 'SamplerExternal2DY2YEXT', 'Float',
'Sampler2DRect', 'Sampler2DMS', 'Sampler2DMSArray', 'ISampler2D', 'ISampler3D', 'ISamplerCube', 'Double',
'ISampler2DArray', 'ISampler2DMS', 'ISampler2DMSArray', 'USampler2D', 'USampler3D', 'Int',
'USamplerCube', 'USampler2DArray', 'USampler2DMS', 'USampler2DMSArray', 'Sampler2DShadow', 'UInt',
'SamplerCubeShadow', 'Sampler2DArrayShadow', 'Image2D', 'IImage2D', 'UImage2D', 'Image3D', 'Bool',
'IImage3D', 'UImage3D', 'Image2DArray', 'IImage2DArray', 'UImage2DArray', 'ImageCube', 'AtomicCounter',
'IImageCube', 'UImageCube' 'YuvCscStandardEXT',
'Sampler2D',
'Sampler3D',
'SamplerCube',
'Sampler2DArray',
'SamplerExternalOES',
'SamplerExternal2DY2YEXT',
'Sampler2DRect',
'Sampler2DMS',
'Sampler2DMSArray',
'ISampler2D',
'ISampler3D',
'ISamplerCube',
'ISampler2DArray',
'ISampler2DMS',
'ISampler2DMSArray',
'USampler2D',
'USampler3D',
'USamplerCube',
'USampler2DArray',
'USampler2DMS',
'USampler2DMSArray',
'Sampler2DShadow',
'SamplerCubeShadow',
'Sampler2DArrayShadow',
'Sampler1D',
'Sampler1DArray',
'Sampler1DArrayShadow',
'SamplerBuffer',
'SamplerCubeArray',
'SamplerCubeArrayShadow',
'Sampler1DShadow',
'Sampler2DRectShadow',
'ISampler1D',
'ISampler1DArray',
'ISampler2DRect',
'ISamplerBuffer',
'ISamplerCubeArray',
'USampler1D',
'USampler1DArray',
'USampler2DRect',
'USamplerBuffer',
'USamplerCubeArray',
'Image2D',
'IImage2D',
'UImage2D',
'Image3D',
'IImage3D',
'UImage3D',
'Image2DArray',
'IImage2DArray',
'UImage2DArray',
'ImageCube',
'IImageCube',
'UImageCube',
'Image1D',
'IImage1D',
'UImage1D',
'Image1DArray',
'IImage1DArray',
'UImage1DArray',
'Image2DMS',
'IImage2DMS',
'UImage2DMS',
'Image2DMSArray',
'IImage2DMSArray',
'UImage2DMSArray',
'Image2DRect',
'IImage2DRect',
'UImage2DRect',
'ImageCubeArray',
'IImageCubeArray',
'UImageCubeArray',
'ImageRect',
'IImageRect',
'UImageRect',
'ImageBuffer',
'IImageBuffer',
'UImageBuffer',
'SubpassInput',
'ISubpassInput',
'USubpassInput',
'SubpassInputMS',
'ISubpassInputMS',
'USubpassInputMS',
] ]
id_counter = 0 id_counter = 0
...@@ -360,13 +444,24 @@ def get_basic_mangled_name(basic): ...@@ -360,13 +444,24 @@ def get_basic_mangled_name(basic):
index = basic_types_enumeration.index(basic) index = basic_types_enumeration.index(basic)
if index < 26: if index < 26:
return '0' + chr(ord('A') + index) return '0' + chr(ord('A') + index)
if index < 52:
return '0' + chr(ord('a') + index - 26) return '0' + chr(ord('a') + index - 26)
if index < 78:
return '1' + chr(ord('A') + index - 52)
return '1' + chr(ord('a') + index - 78)
levels = ['ESSL3_1_BUILTINS', 'ESSL3_BUILTINS', 'ESSL1_BUILTINS', 'COMMON_BUILTINS'] essl_levels = ['ESSL3_1_BUILTINS', 'ESSL3_BUILTINS', 'ESSL1_BUILTINS', 'COMMON_BUILTINS']
glsl_levels = [
'GLSL4_6_BUILTINS', 'GLSL4_5_BUILTINS', 'GLSL4_4_BUILTINS', 'GLSL4_3_BUILTINS',
'GLSL4_2_BUILTINS', 'GLSL4_1_BUILTINS', 'GLSL4_BUILTINS', 'GLSL3_3_BUILTINS',
'GLSL1_5_BUILTINS', 'GLSL1_4_BUILTINS', 'GLSL1_3_BUILTINS', 'GLSL1_2_BUILTINS',
'GLSL1_1_BUILTINS', 'COMMON_BUILTINS'
]
def get_shader_version_condition_for_level(level): def get_essl_shader_version_condition_for_level(level):
if level == 'ESSL3_1_BUILTINS': if level == 'ESSL3_1_BUILTINS':
return 'shaderVersion >= 310' return 'shaderVersion >= 310'
elif level == 'ESSL3_BUILTINS': elif level == 'ESSL3_BUILTINS':
...@@ -379,6 +474,66 @@ def get_shader_version_condition_for_level(level): ...@@ -379,6 +474,66 @@ def get_shader_version_condition_for_level(level):
raise Exception('Unsupported symbol table level') raise Exception('Unsupported symbol table level')
def get_glsl_shader_version_condition_for_level(level):
if level == 'GLSL1_1_BUILTINS':
return 'shaderVersion == 110'
elif level == 'GLSL1_2_BUILTINS':
return 'shaderVersion >= 120'
elif level == 'GLSL1_3_BUILTINS':
return 'shaderVersion >= 130'
elif level == 'GLSL1_4_BUILTINS':
return 'shaderVersion >= 140'
elif level == 'GLSL1_5_BUILTINS':
return 'shaderVersion >= 150'
elif level == 'GLSL3_3_BUILTINS':
return 'shaderVersion >= 330'
elif level == 'GLSL4_BUILTINS':
return 'shaderVersion >= 400'
elif level == 'GLSL4_1_BUILTINS':
return 'shaderVersion >= 410'
elif level == 'GLSL4_2_BUILTINS':
return 'shaderVersion >= 420'
elif level == 'GLSL4_3_BUILTINS':
return 'shaderVersion >= 430'
elif level == 'GLSL4_4_BUILTINS':
return 'shaderVersion >= 440'
elif level == 'GLSL4_5_BUILTINS':
return 'shaderVersion >= 450'
elif level == 'GLSL4_6_BUILTINS':
return 'shaderVersion >= 460'
elif level == 'COMMON_BUILTINS':
return ''
else:
raise Exception('Unsupported symbol table level')
def get_specific_switch_code(level_dict, hashfn, script_generated_hash_tests):
code = []
for condition, objs in level_dict.iteritems():
if len(objs) > 0:
if condition != 'NO_CONDITION':
condition_header = ' if ({condition})\n {{'.format(condition=condition)
code.append(condition_header.replace('shaderType', 'mShaderType'))
switch = {}
for name, obj in objs.iteritems():
name_hash = mangledNameHash(name, hashfn, script_generated_hash_tests)
if name_hash not in switch:
switch[name_hash] = []
switch[name_hash].append(obj['hash_matched_code'])
code.append('switch(nameHash) {')
for name_hash, obj in sorted(switch.iteritems()):
code.append('case 0x' + ('%08x' % name_hash) + 'u:\n{')
code += obj
code.append('break;\n}')
code.append('}')
if condition != 'NO_CONDITION':
code.append('}')
return code
class GroupedList: class GroupedList:
""""Class for storing a list of objects grouped by symbol table level and condition.""" """"Class for storing a list of objects grouped by symbol table level and condition."""
...@@ -386,28 +541,55 @@ class GroupedList: ...@@ -386,28 +541,55 @@ class GroupedList:
self.objs = OrderedDict() self.objs = OrderedDict()
self.max_name_length = 0 self.max_name_length = 0
# We need to add all the levels here instead of lazily since they must be in a specific order. # We need to add all the levels here instead of lazily since they must be in a specific order.
for l in levels: self.objs['essl'] = OrderedDict()
self.objs[l] = OrderedDict() for l in essl_levels:
self.objs['essl'][l] = OrderedDict()
def add_obj(self, level, condition, name, obj): self.objs['glsl'] = OrderedDict()
if (level not in levels): for l in glsl_levels:
raise Exception('Unexpected level: ' + str(level)) self.objs['glsl'][l] = OrderedDict()
if condition not in self.objs[level]:
self.objs[level][condition] = OrderedDict() def add_obj(self, essl_level, glsl_level, condition, name, obj):
self.objs[level][condition][name] = obj if essl_level:
if essl_level not in essl_levels:
raise Exception('Unexpected essl level: ' + str(essl_level))
if condition not in self.objs['essl'][essl_level]:
self.objs['essl'][essl_level][condition] = OrderedDict()
self.objs['essl'][essl_level][condition][name] = obj
if len(name) > self.max_name_length: if len(name) > self.max_name_length:
self.max_name_length = len(name) self.max_name_length = len(name)
def has_key(self, level, condition, name): if glsl_level:
if (level not in levels): if glsl_level not in glsl_levels:
raise Exception('Unexpected level: ' + str(level)) raise Exception('Unexpected glsl level: ' + str(glsl_level))
if condition not in self.objs[level]: if condition not in self.objs['glsl'][glsl_level]:
return False self.objs['glsl'][glsl_level][condition] = OrderedDict()
return (name in self.objs[level][condition]) self.objs['glsl'][glsl_level][condition][name] = obj
if len(name) > self.max_name_length:
self.max_name_length = len(name)
def get(self, level, condition, name): def has_key(self, essl_level, glsl_level, condition, name):
if self.has_key(level, condition, name): if essl_level:
return self.objs[level][condition][name] if essl_level not in essl_levels:
raise Exception('Unexpected essl level: ' + str(essl_level))
if condition not in self.objs['essl'][essl_level]:
return False
if name not in self.objs['essl'][essl_level][condition]:
return False
if glsl_level:
if glsl_level not in glsl_levels:
raise Exception('Unexpected glsl level: ' + str(glsl_level))
if condition not in self.objs['glsl'][glsl_level]:
return False
if name not in self.objs['glsl'][glsl_level][condition]:
return False
return True
def get(self, essl_level, glsl_level, condition, name):
if self.has_key(essl_level, glsl_level, condition, name):
if essl_level:
return self.objs['essl'][essl_level][condition][name]
if glsl_level:
return self.objs['glsl'][glsl_level][condition][name]
return None return None
def get_max_name_length(self): def get_max_name_length(self):
...@@ -415,38 +597,38 @@ class GroupedList: ...@@ -415,38 +597,38 @@ class GroupedList:
def get_switch_code(self, hashfn, script_generated_hash_tests): def get_switch_code(self, hashfn, script_generated_hash_tests):
code = [] code = []
for level in levels: code.append('if (!IsDesktopGLSpec(mShaderSpec))\n {')
if len(self.objs[level]) == 0: for level in essl_levels:
if len(self.objs['essl'][level]) == 0:
continue continue
level_condition = get_shader_version_condition_for_level(level) level_condition = get_essl_shader_version_condition_for_level(level)
if level_condition != '': if level_condition != '':
code.append('if ({condition})\n {{'.format(condition=level_condition)) code.append('if ({condition})\n {{'.format(condition=level_condition))
for condition, objs in self.objs[level].iteritems(): code.extend(
if len(objs) > 0: get_specific_switch_code(self.objs['essl'][level], hashfn,
if condition != 'NO_CONDITION': script_generated_hash_tests))
condition_header = ' if ({condition})\n {{'.format(condition=condition)
code.append(condition_header.replace('shaderType', 'mShaderType'))
switch = {} if level_condition != '':
for name, obj in objs.iteritems():
name_hash = mangledNameHash(name, hashfn, script_generated_hash_tests)
if name_hash not in switch:
switch[name_hash] = []
switch[name_hash].append(obj['hash_matched_code'])
code.append('switch(nameHash) {')
for name_hash, obj in sorted(switch.iteritems()):
code.append('case 0x' + ('%08x' % name_hash) + 'u:\n{')
code += obj
code.append('break;\n}')
code.append('}') code.append('}')
if condition != 'NO_CONDITION': code.append('}\nelse\n{')
code.append('}')
for level in glsl_levels:
if len(self.objs['glsl'][level]) == 0:
continue
level_condition = get_glsl_shader_version_condition_for_level(level)
if level_condition != '':
code.append('if ({condition})\n {{'.format(condition=level_condition))
code.extend(
get_specific_switch_code(self.objs['glsl'][level], hashfn,
script_generated_hash_tests))
if level_condition != '': if level_condition != '':
code.append('}') code.append('}')
code.append('}')
code.append('return nullptr;') code.append('return nullptr;')
return '\n'.join(code) return '\n'.join(code)
...@@ -491,7 +673,6 @@ class TType: ...@@ -491,7 +673,6 @@ class TType:
mangled_name += chr(ord('0') + size_key) mangled_name += chr(ord('0') + size_key)
else: else:
mangled_name += chr(ord('A') + size_key - 10) mangled_name += chr(ord('A') + size_key - 10)
mangled_name += get_basic_mangled_name(self.data['basic']) mangled_name += get_basic_mangled_name(self.data['basic'])
return mangled_name return mangled_name
...@@ -511,8 +692,8 @@ class TType: ...@@ -511,8 +692,8 @@ class TType:
def get_object_size(self): def get_object_size(self):
return self.data['primarySize'] * self.data['secondarySize'] return self.data['primarySize'] * self.data['secondarySize']
def specific_sampler_or_image_type(self, basic_type_prefix): def specific_sampler_or_image_or_subpass_type(self, basic_type_prefix):
if 'genType' in self.data: if 'genType' in self.data and self.data['genType'] == 'sampler_or_image_or_subpass':
type = {} type = {}
if 'basic' not in self.data: if 'basic' not in self.data:
type['basic'] = {'': 'Float', 'I': 'Int', 'U': 'UInt'}[basic_type_prefix] type['basic'] = {'': 'Float', 'I': 'Int', 'U': 'UInt'}[basic_type_prefix]
...@@ -536,6 +717,18 @@ class TType: ...@@ -536,6 +717,18 @@ class TType:
return self return self
def parse_type(self, glsl_header_type): def parse_type(self, glsl_header_type):
if glsl_header_type.startswith('readonly writeonly '):
type_obj = self.parse_type(glsl_header_type[19:])
type_obj['qualifier'] = 'Readonly Writeonly'
return type_obj
if glsl_header_type.startswith('readonly '):
type_obj = self.parse_type(glsl_header_type[9:])
type_obj['qualifier'] = 'Readonly'
return type_obj
if glsl_header_type.startswith('writeonly '):
type_obj = self.parse_type(glsl_header_type[10:])
type_obj['qualifier'] = 'Writeonly'
return type_obj
if glsl_header_type.startswith('out '): if glsl_header_type.startswith('out '):
type_obj = self.parse_type(glsl_header_type[4:]) type_obj = self.parse_type(glsl_header_type[4:])
type_obj['qualifier'] = 'Out' type_obj['qualifier'] = 'Out'
...@@ -549,6 +742,7 @@ class TType: ...@@ -549,6 +742,7 @@ class TType:
'float': 'Float', 'float': 'Float',
'int': 'Int', 'int': 'Int',
'uint': 'UInt', 'uint': 'UInt',
'double': 'Double',
'bool': 'Bool', 'bool': 'Bool',
'void': 'Void', 'void': 'Void',
'atomic_uint': 'AtomicCounter', 'atomic_uint': 'AtomicCounter',
...@@ -560,9 +754,18 @@ class TType: ...@@ -560,9 +754,18 @@ class TType:
type_obj = {} type_obj = {}
basic_type_prefix_map = {'': 'Float', 'i': 'Int', 'u': 'UInt', 'b': 'Bool', 'v': 'Void'} basic_type_prefix_map = {
'': 'Float',
'i': 'Int',
'u': 'UInt',
'd': 'Double',
'b': 'Bool',
'v': 'Void'
}
vec_re = re.compile(r'^([iub]?)vec([234]?)$') # textureGatherOffsets in GLSL has an ivec2[4] parameter that this needs to parse
# treating it as a mat4x2
vec_re = re.compile(r'^([iudb]?)vec([234]?)((\[[234]\])?)$')
vec_match = vec_re.match(glsl_header_type) vec_match = vec_re.match(glsl_header_type)
if vec_match: if vec_match:
type_obj['basic'] = basic_type_prefix_map[vec_match.group(1)] type_obj['basic'] = basic_type_prefix_map[vec_match.group(1)]
...@@ -571,6 +774,11 @@ class TType: ...@@ -571,6 +774,11 @@ class TType:
type_obj['genType'] = 'vec' type_obj['genType'] = 'vec'
else: else:
# vec with specific size # vec with specific size
if vec_match.group(3) != '':
# vec array
type_obj['primarySize'] = int(vec_match.group(3)[1])
type_obj['secondarySize'] = int(vec_match.group(2))
else:
type_obj['primarySize'] = int(vec_match.group(2)) type_obj['primarySize'] = int(vec_match.group(2))
return type_obj return type_obj
...@@ -587,7 +795,7 @@ class TType: ...@@ -587,7 +795,7 @@ class TType:
type_obj['secondarySize'] = int(mat_match.group(3)) type_obj['secondarySize'] = int(mat_match.group(3))
return type_obj return type_obj
gen_re = re.compile(r'^gen([IUB]?)Type$') gen_re = re.compile(r'^gen([IUDB]?)Type$')
gen_match = gen_re.match(glsl_header_type) gen_match = gen_re.match(glsl_header_type)
if gen_match: if gen_match:
type_obj['basic'] = basic_type_prefix_map[gen_match.group(1).lower()] type_obj['basic'] = basic_type_prefix_map[gen_match.group(1).lower()]
...@@ -598,15 +806,19 @@ class TType: ...@@ -598,15 +806,19 @@ class TType:
type_obj['basic'] = glsl_header_type[0].upper() + glsl_header_type[1:] type_obj['basic'] = glsl_header_type[0].upper() + glsl_header_type[1:]
return type_obj return type_obj
if glsl_header_type.startswith('gsampler') or glsl_header_type.startswith('gimage'): if glsl_header_type.startswith('gsampler') or glsl_header_type.startswith(
'gimage') or glsl_header_type.startswith('gsubpassInput'):
type_obj['basic'] = glsl_header_type[1].upper() + glsl_header_type[2:] type_obj['basic'] = glsl_header_type[1].upper() + glsl_header_type[2:]
type_obj['genType'] = 'sampler_or_image' type_obj['genType'] = 'sampler_or_image_or_subpass'
return type_obj return type_obj
if glsl_header_type == 'gvec4': if glsl_header_type == 'gvec4':
return {'primarySize': 4, 'genType': 'sampler_or_image'} return {'primarySize': 4, 'genType': 'sampler_or_image_or_subpass'}
if glsl_header_type == 'gvec3': if glsl_header_type == 'gvec3':
return {'primarySize': 3, 'genType': 'sampler_or_image'} return {'primarySize': 3, 'genType': 'sampler_or_image_or_subpass'}
if glsl_header_type == 'IMAGE_PARAMS':
return {'genType': 'image_params'}
raise Exception('Unrecognized type: ' + str(glsl_header_type)) raise Exception('Unrecognized type: ' + str(glsl_header_type))
...@@ -704,7 +916,7 @@ def get_function_names(group, mangled_names): ...@@ -704,7 +916,7 @@ def get_function_names(group, mangled_names):
for function_props in group['functions']: for function_props in group['functions']:
function_name = function_props['name'] function_name = function_props['name']
mangled_names.append(function_name) mangled_names.append(function_name)
function_variants = gen_function_variants(function_name, function_props) function_variants = gen_function_variants(function_props)
for function_props in function_variants: for function_props in function_variants:
parameters = get_parameters(function_props) parameters = get_parameters(function_props)
mangled_names.append(get_function_mangled_name(function_name, parameters)) mangled_names.append(get_function_mangled_name(function_name, parameters))
...@@ -812,36 +1024,69 @@ def define_constexpr_variable(template_args, variable_declarations): ...@@ -812,36 +1024,69 @@ def define_constexpr_variable(template_args, variable_declarations):
variable_declarations.append(template_variable_declaration.format(**template_args)) variable_declarations.append(template_variable_declaration.format(**template_args))
def gen_function_variants(function_name, function_props): def gen_function_variants(function_props):
function_variants = [] function_variants = []
parameters = get_parameters(function_props) parameters = get_parameters(function_props)
function_is_gen_type = False function_is_gen_type = False
gen_type = set() gen_type = set()
for param in parameters: image_params_index = 0
for param in parameters + [function_props['returnType']]:
if 'genType' in param.data: if 'genType' in param.data:
if param.data['genType'] not in ['sampler_or_image', 'vec', 'yes']: if param.data['genType'] not in [
raise Exception('Unexpected value of genType "' + str(param.data['genType']) + 'sampler_or_image_or_subpass', 'vec', 'yes', 'image_params'
'" should be "sampler_or_image", "vec", or "yes"') ]:
raise Exception(
'Unexpected value of genType "' + str(param.data['genType']) +
'" should be "sampler_or_image_or_subpass", "vec", "yes", or "image_params"')
gen_type.add(param.data['genType']) gen_type.add(param.data['genType'])
if len(gen_type) > 1: if param.data['genType'] == 'image_params':
raise Exception('Unexpected multiple values of genType set on the same function: ' image_params_index = parameters.index(param)
+ str(list(gen_type)))
if len(gen_type) == 0: if len(gen_type) == 0:
function_variants.append(function_props) function_variants.append(function_props)
return function_variants return function_variants
# If we have a gsampler_or_image then we're generating variants for float, int and uint # If we have image_params then we're generating variants for 33 separate functions,
# each for a different type of image variable
if 'image_params' in gen_type:
variants = [['gimage2D', 'ivec2'], ['gimage3D', 'ivec3'], ['gimageCube', 'ivec3'],
['gimageBuffer', 'int'], ['gimage2DArray', 'ivec3'],
['gimageCubeArray', 'ivec3'], ['gimage1D', 'int'], ['gimage1DArray', 'ivec2'],
['gimage2DRect', 'ivec2'], ['gimage2DMS', 'ivec2', 'int'],
['gimage2DMSArray', 'ivec3', 'int']]
for variant in variants:
image_variant_parameters = []
for param in parameters:
if parameters.index(param) == image_params_index:
for variant_param in variant:
image_variant_parameters.append(TType(variant_param))
else:
image_variant_parameters.append(param)
types = ['', 'I', 'U']
for type in types:
variant_props = function_props.copy()
variant_parameters = []
for param in image_variant_parameters:
variant_parameters.append(
param.specific_sampler_or_image_or_subpass_type(type))
variant_props['parameters'] = variant_parameters
variant_props['returnType'] = function_props[
'returnType'].specific_sampler_or_image_or_subpass_type(type)
function_variants.append(variant_props)
return function_variants
# If we have a gsampler_or_image_or_subpass then we're generating variants for float, int and uint
# samplers. # samplers.
if 'sampler_or_image' in gen_type: if 'sampler_or_image_or_subpass' in gen_type:
types = ['', 'I', 'U'] types = ['', 'I', 'U']
for type in types: for type in types:
variant_props = function_props.copy() variant_props = function_props.copy()
variant_parameters = [] variant_parameters = []
for param in parameters: for param in parameters:
variant_parameters.append(param.specific_sampler_or_image_type(type)) variant_parameters.append(param.specific_sampler_or_image_or_subpass_type(type))
variant_props['parameters'] = variant_parameters variant_props['parameters'] = variant_parameters
variant_props['returnType'] = function_props[ variant_props['returnType'] = function_props[
'returnType'].specific_sampler_or_image_type(type) 'returnType'].specific_sampler_or_image_or_subpass_type(type)
function_variants.append(variant_props) function_variants.append(variant_props)
return function_variants return function_variants
...@@ -873,18 +1118,20 @@ def process_single_function_group( ...@@ -873,18 +1118,20 @@ def process_single_function_group(
for function_props in group['functions']: for function_props in group['functions']:
function_name = function_props['name'] function_name = function_props['name']
level = function_props['level'] essl_level = function_props['essl_level'] if 'essl_level' in function_props else None
glsl_level = function_props['glsl_level'] if 'glsl_level' in function_props else None
extension = get_extension(function_props) extension = get_extension(function_props)
template_args = { template_args = {
'name': function_name, 'name': function_name,
'name_with_suffix': function_name + get_suffix(function_props), 'name_with_suffix': function_name + get_suffix(function_props),
'level': level, 'essl_level': essl_level,
'glsl_level': glsl_level,
'extension': extension, 'extension': extension,
'op': get_op(function_name, function_props), 'op': get_op(function_name, function_props),
'known_to_not_have_side_effects': get_known_to_not_have_side_effects(function_props) 'known_to_not_have_side_effects': get_known_to_not_have_side_effects(function_props)
} }
function_variants = gen_function_variants(function_name, function_props) function_variants = gen_function_variants(function_props)
template_name_declaration = 'constexpr const ImmutableString {name_with_suffix}("{name}");' template_name_declaration = 'constexpr const ImmutableString {name_with_suffix}("{name}");'
name_declaration = template_name_declaration.format(**template_args) name_declaration = template_name_declaration.format(**template_args)
...@@ -897,15 +1144,16 @@ def process_single_function_group( ...@@ -897,15 +1144,16 @@ def process_single_function_group(
}}""" }}"""
unmangled_if = template_unmangled_if.format(**template_args) unmangled_if = template_unmangled_if.format(**template_args)
unmangled_builtin_no_condition = unmangled_function_if_statements.get( unmangled_builtin_no_condition = unmangled_function_if_statements.get(
level, 'NO_CONDITION', function_name) essl_level, glsl_level, 'NO_CONDITION', function_name)
if unmangled_builtin_no_condition != None and unmangled_builtin_no_condition[ if unmangled_builtin_no_condition != None and unmangled_builtin_no_condition[
'extension'] == 'UNDEFINED': 'extension'] == 'UNDEFINED':
# We already have this unmangled name without a condition nor extension on the same level. No need to add a duplicate with a condition. # We already have this unmangled name without a condition nor extension on the same level. No need to add a duplicate with a condition.
pass pass
elif (not unmangled_function_if_statements.has_key( elif (not unmangled_function_if_statements.has_key(
level, condition, function_name)) or extension == 'UNDEFINED': essl_level, glsl_level, condition, function_name)) or extension == 'UNDEFINED':
# We don't have this unmangled builtin recorded yet or we might replace an unmangled builtin from an extension with one from core. # We don't have this unmangled builtin recorded yet or we might replace an unmangled builtin from an extension with one from core.
unmangled_function_if_statements.add_obj(level, condition, function_name, { unmangled_function_if_statements.add_obj(essl_level, glsl_level, condition,
function_name, {
'hash_matched_code': unmangled_if, 'hash_matched_code': unmangled_if,
'extension': extension 'extension': extension
}) })
...@@ -920,17 +1168,27 @@ def process_single_function_group( ...@@ -920,17 +1168,27 @@ def process_single_function_group(
template_args['unique_name'] = get_unique_identifier_name( template_args['unique_name'] = get_unique_identifier_name(
template_args['name_with_suffix'], parameters) template_args['name_with_suffix'], parameters)
if template_args['unique_name'] in defined_function_variants:
continue
defined_function_variants.add(template_args['unique_name'])
template_args['param_count'] = len(parameters) template_args['param_count'] = len(parameters)
template_args['return_type'] = function_props['returnType'].get_statictype_string() template_args['return_type'] = function_props['returnType'].get_statictype_string()
template_args['mangled_name'] = get_function_mangled_name(function_name, parameters) template_args['mangled_name'] = get_function_mangled_name(function_name, parameters)
template_args['human_readable_name'] = get_function_human_readable_name( template_args['human_readable_name'] = get_function_human_readable_name(
template_args['name_with_suffix'], parameters) template_args['name_with_suffix'], parameters)
template_args['mangled_name_length'] = len(template_args['mangled_name']) template_args['mangled_name_length'] = len(template_args['mangled_name'])
template_args['extension_condition'] = ' && mResources.{extension}'.format(
**template_args) if template_args['extension'] != 'UNDEFINED' else ''
template_mangled_if = """if (name == BuiltInName::{unique_name}{extension_condition})
{{
return &BuiltInFunction::kFunction_{unique_name};
}}"""
mangled_if = template_mangled_if.format(**template_args)
get_builtin_if_statements.add_obj(essl_level, glsl_level, condition,
template_args['mangled_name'],
{'hash_matched_code': mangled_if})
if template_args['unique_name'] in defined_function_variants:
continue
defined_function_variants.add(template_args['unique_name'])
template_builtin_id_declaration = ' static constexpr const TSymbolUniqueId {human_readable_name} = TSymbolUniqueId({id});' template_builtin_id_declaration = ' static constexpr const TSymbolUniqueId {human_readable_name} = TSymbolUniqueId({id});'
builtin_id_declarations.append(template_builtin_id_declaration.format(**template_args)) builtin_id_declarations.append(template_builtin_id_declaration.format(**template_args))
...@@ -976,13 +1234,6 @@ def process_single_function_group( ...@@ -976,13 +1234,6 @@ def process_single_function_group(
template_mangled_name_declaration = 'constexpr const ImmutableString {unique_name}("{mangled_name}");' template_mangled_name_declaration = 'constexpr const ImmutableString {unique_name}("{mangled_name}");'
name_declarations.add(template_mangled_name_declaration.format(**template_args)) name_declarations.add(template_mangled_name_declaration.format(**template_args))
template_mangled_if = """if (name == BuiltInName::{unique_name})
{{
return &BuiltInFunction::kFunction_{unique_name};
}}"""
mangled_if = template_mangled_if.format(**template_args)
get_builtin_if_statements.add_obj(level, condition, template_args['mangled_name'],
{'hash_matched_code': mangled_if})
id_counter += 1 id_counter += 1
...@@ -1168,7 +1419,8 @@ def process_single_variable_group(condition, group_name, group, builtin_id_decla ...@@ -1168,7 +1419,8 @@ def process_single_variable_group(condition, group_name, group, builtin_id_decla
return &BuiltInVariable::kVar_{name_with_suffix}; return &BuiltInVariable::kVar_{name_with_suffix};
}}""" }}"""
name_if = template_name_if.format(**template_args) name_if = template_name_if.format(**template_args)
get_builtin_if_statements.add_obj(level, condition, template_args['name'], get_builtin_if_statements.add_obj(level, 'COMMON_BUILTINS', condition,
template_args['name'],
{'hash_matched_code': name_if}) {'hash_matched_code': name_if})
if is_member: if is_member:
...@@ -1193,14 +1445,13 @@ def process_single_variable_group(condition, group_name, group, builtin_id_decla ...@@ -1193,14 +1445,13 @@ def process_single_variable_group(condition, group_name, group, builtin_id_decla
declare_member_variables.append( declare_member_variables.append(
template_declare_member_variable.format(**template_args)) template_declare_member_variable.format(**template_args))
if level != 'GLSL_BUILTINS':
template_name_if = """if (name == BuiltInName::{name}) template_name_if = """if (name == BuiltInName::{name})
{{{condition_comment} {{{condition_comment}
return mVar_{name_with_suffix}; return mVar_{name_with_suffix};
}}""" }}"""
name_if = template_name_if.format(**template_args) name_if = template_name_if.format(**template_args)
get_builtin_if_statements.add_obj(level, get_condition, variable_name, get_builtin_if_statements.add_obj(level, 'COMMON_BUILTINS', get_condition,
{'hash_matched_code': name_if}) variable_name, {'hash_matched_code': name_if})
id_counter += 1 id_counter += 1
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment