Edit

kc3-lang/angle/src/compiler/translator/ImmutableString_ESSL_autogen.cpp

Branch :

  • Show log

    Commit

  • Author : Jonah Ryan-Davis
    Date : 2020-04-01 16:53:31
    Hash : eadc387c
    Message : GL: Support GL_OES_texture_cube_map_array in shader translator GL_OES_texture_cube_map_array is core in 3.2. This CL adds support for this extension in the shader translator. Now passes dEQP.KHR_GLES31/core_texture_cube_map_array.*, dEQP.GLES31/functional_fbo_color_texcubearray_*, and dEQP.GLES31/functional_opaque_type_indexing*samplercubearray* with GL backend. Bug: angleproject:3584 Change-Id: I1a8485c7d9d3fffb9b5109d292b35b0c56a3c665 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2133086 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>

  • src/compiler/translator/ImmutableString_ESSL_autogen.cpp
  • // GENERATED FILE - DO NOT EDIT.
    // Generated by gen_builtin_symbols.py using data from builtin_variables.json and
    // builtin_function_declarations.txt.
    //
    // Copyright 2020 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    // ImmutableString_ESSL_autogen.cpp: Wrapper for static or pool allocated char arrays, that are
    // guaranteed to be valid and unchanged for the duration of the compilation. Implements
    // mangledNameHash using perfect hash function from gen_builtin_symbols.py
    
    #include "compiler/translator/ImmutableString.h"
    
    std::ostream &operator<<(std::ostream &os, const sh::ImmutableString &str)
    {
        return os.write(str.data(), str.length());
    }
    
    #if defined(_MSC_VER)
    #    pragma warning(disable : 4309)  // truncation of constant value
    #endif
    
    namespace
    {
    
    constexpr int mangledkT1[] = {1687, 1918, 1635, 89,   1810, 832, 422,  1932, 1379, 706,
                                  1114, 534,  457,  343,  605,  691, 62,   1004, 626,  1437,
                                  1528, 643,  320,  761,  1619, 653, 1176, 1843, 1558, 646,
                                  1281, 751,  996,  1673, 6,    389, 1399};
    constexpr int mangledkT2[] = {24,   908,  260,  250,  1791, 819,  1942, 1246, 344, 255,
                                  830,  1865, 1511, 411,  312,  236,  326,  828,  951, 441,
                                  1520, 422,  1792, 1138, 106,  1636, 763,  1503, 287, 149,
                                  856,  1312, 1508, 1052, 251,  1939, 897};
    constexpr int mangledkG[]  = {
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    193,  0,    0,    1354,
        0,    0,    0,    0,    0,    0,    1121, 0,    1738, 0,    1207, 0,    0,    0,    0,    1720,
        0,    0,    1097, 0,    0,    0,    0,    0,    0,    0,    1859, 0,    0,    0,    0,    0,
        0,    0,    0,    1604, 0,    0,    0,    215,  0,    1963, 0,    0,    1397, 0,    52,   0,
        0,    0,    0,    0,    0,    1606, 0,    0,    0,    0,    350,  0,    1235, 212,  0,    0,
        0,    0,    0,    0,    1595, 0,    0,    602,  16,   0,    713,  1126, 0,    0,    0,    0,
        0,    1739, 0,    0,    474,  0,    0,    1520, 0,    1856, 0,    0,    0,    0,    0,    0,
        1572, 0,    0,    0,    0,    1368, 0,    119,  0,    1818, 0,    797,  0,    0,    0,    0,
        0,    0,    0,    824,  0,    0,    0,    0,    0,    0,    1667, 0,    0,    1956, 0,    149,
        0,    805,  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    423,
        0,    0,    1315, 1801, 0,    0,    969,  0,    0,    0,    0,    229,  0,    831,  0,    190,
        0,    0,    0,    0,    640,  0,    0,    0,    0,    0,    0,    1928, 59,   720,  897,  0,
        0,    0,    552,  0,    0,    1079, 0,    0,    0,    0,    0,    0,    0,    0,    693,  0,
        0,    0,    922,  0,    0,    0,    0,    228,  0,    0,    0,    0,    0,    1044, 1407, 0,
        0,    54,   0,    0,    697,  0,    630,  980,  300,  0,    450,  693,  0,    0,    0,    0,
        0,    0,    769,  0,    11,   0,    1728, 0,    0,    1591, 723,  0,    1508, 1928, 0,    0,
        154,  0,    1088, 0,    1573, 0,    0,    0,    0,    98,   0,    708,  0,    0,    207,  1198,
        0,    0,    0,    1649, 404,  0,    0,    0,    0,    0,    267,  0,    242,  130,  0,    0,
        99,   0,    598,  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    10,   949,
        0,    0,    112,  959,  536,  695,  1237, 0,    0,    179,  1911, 0,    0,    0,    0,    1812,
        0,    0,    0,    0,    0,    816,  532,  624,  0,    0,    0,    0,    0,    0,    810,  0,
        0,    973,  1068, 0,    0,    0,    127,  0,    0,    1201, 0,    1866, 0,    0,    0,    0,
        628,  0,    0,    0,    0,    1910, 0,    1976, 835,  0,    405,  0,    0,    1220, 0,    1923,
        305,  0,    0,    0,    955,  851,  0,    0,    0,    997,  0,    0,    0,    0,    1680, 395,
        2,    0,    969,  668,  1411, 1876, 951,  0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    873,  0,    0,    701,  0,    0,    525,  998,  1713, 0,    0,    537,  0,    0,    0,
        0,    0,    0,    0,    1571, 0,    327,  0,    0,    1409, 1757, 0,    647,  1681, 0,    1861,
        0,    0,    78,   0,    306,  523,  23,   1412, 1225, 223,  0,    0,    75,   0,    948,  0,
        167,  1394, 0,    0,    0,    0,    254,  0,    0,    0,    0,    0,    332,  1156, 130,  0,
        0,    370,  282,  0,    0,    420,  0,    297,  553,  0,    0,    0,    777,  0,    0,    9,
        192,  537,  1909, 1153, 67,   0,    1881, 823,  0,    0,    10,   0,    603,  0,    187,  0,
        0,    1604, 798,  827,  1474, 1302, 0,    1349, 893,  0,    1700, 1194, 0,    1444, 0,    0,
        458,  680,  973,  0,    0,    0,    1195, 0,    0,    0,    220,  1053, 100,  731,  1797, 0,
        0,    0,    680,  0,    215,  0,    1580, 470,  0,    0,    177,  685,  0,    0,    52,   0,
        1783, 1547, 11,   446,  0,    523,  0,    0,    0,    1650, 787,  0,    1965, 0,    744,  0,
        0,    0,    126,  0,    30,   0,    0,    0,    0,    1364, 0,    156,  1580, 1320, 0,    333,
        0,    0,    0,    0,    0,    0,    699,  0,    990,  368,  1812, 0,    105,  0,    0,    148,
        0,    0,    0,    759,  0,    310,  0,    0,    0,    0,    0,    0,    0,    1894, 697,  137,
        211,  913,  328,  861,  1462, 0,    0,    885,  0,    0,    438,  0,    739,  1328, 647,  1898,
        0,    268,  0,    0,    0,    731,  0,    1349, 1872, 0,    0,    0,    205,  0,    0,    0,
        0,    0,    1030, 562,  0,    297,  0,    629,  835,  921,  0,    0,    344,  1740, 0,    0,
        495,  0,    371,  0,    283,  457,  908,  361,  0,    1806, 1411, 863,  0,    0,    796,  146,
        0,    0,    1590, 0,    0,    0,    1832, 0,    0,    0,    904,  901,  81,   938,  0,    896,
        903,  1408, 17,   918,  0,    1827, 0,    1737, 0,    0,    1190, 0,    0,    0,    0,    0,
        0,    1744, 0,    514,  666,  674,  0,    0,    881,  90,   1423, 515,  473,  910,  0,    0,
        1134, 0,    425,  0,    609,  189,  682,  0,    1699, 0,    628,  156,  0,    0,    0,    0,
        1124, 0,    0,    0,    1895, 419,  0,    0,    1767, 0,    101,  0,    0,    0,    425,  749,
        127,  1690, 0,    1900, 0,    533,  1100, 0,    1879, 0,    0,    655,  0,    116,  0,    1734,
        1051, 0,    521,  0,    0,    1730, 0,    1449, 0,    0,    0,    0,    1903, 0,    0,    311,
        1006, 0,    0,    1576, 551,  142,  0,    677,  1364, 1515, 0,    0,    0,    0,    0,    1725,
        1469, 0,    0,    351,  0,    0,    0,    793,  0,    0,    541,  1934, 636,  1010, 0,    1370,
        0,    0,    0,    618,  1334, 1839, 0,    1002, 0,    431,  1440, 635,  0,    920,  0,    0,
        0,    403,  0,    1945, 0,    74,   0,    0,    0,    1466, 1095, 0,    981,  0,    0,    0,
        262,  0,    0,    1495, 0,    0,    0,    0,    1534, 1933, 0,    46,   0,    0,    0,    1393,
        398,  1105, 0,    735,  371,  115,  39,   613,  255,  0,    1906, 0,    0,    0,    1844, 946,
        242,  0,    0,    129,  0,    1856, 1145, 1186, 0,    939,  1693, 0,    1581, 0,    1961, 0,
        65,   139,  984,  1401, 0,    0,    1576, 142,  1937, 0,    0,    987,  130,  889,  0,    347,
        975,  1463, 0,    456,  1825, 1232, 103,  647,  1609, 0,    0,    0,    123,  267,  642,  0,
        718,  0,    893,  0,    0,    1198, 602,  285,  1670, 105,  0,    0,    1247, 0,    872,  0,
        113,  236,  0,    1227, 1217, 0,    0,    391,  0,    1959, 729,  700,  0,    1011, 0,    0,
        0,    315,  283,  1897, 238,  0,    598,  687,  0,    0,    857,  0,    0,    637,  139,  0,
        0,    0,    980,  695,  106,  0,    373,  269,  0,    774,  757,  0,    0,    1022, 0,    746,
        1802, 2,    509,  0,    454,  0,    0,    934,  1615, 0,    0,    77,   0,    355,  0,    1518,
        1138, 1333, 0,    0,    0,    0,    0,    0,    471,  441,  0,    396,  0,    682,  246,  894,
        0,    1784, 1647, 677,  0,    847,  0,    0,    0,    0,    0,    0,    327,  0,    203,  1171,
        266,  1459, 919,  1091, 1126, 515,  0,    1656, 469,  183,  0,    1797, 0,    809,  0,    1523,
        71,   0,    1387, 0,    347,  0,    539,  301,  56,   110,  21,   1776, 0,    0,    0,    0,
        0,    0,    0,    0,    0,    274,  0,    298,  1875, 0,    1362, 448,  0,    1052, 1964, 0,
        0,    678,  0,    0,    501,  0,    0,    765,  923,  0,    539,  410,  885,  0,    261,  1240,
        0,    446,  339,  876,  0,    616,  1186, 0,    1454, 0,    0,    876,  653,  87,   78,   406,
        938,  1335, 0,    0,    6,    0,    0,    0,    1594, 0,    1072, 83,   0,    0,    0,    0,
        0,    1152, 0,    995,  0,    346,  0,    366,  305,  1274, 0,    163,  0,    0,    1756, 0,
        363,  234,  0,    280,  0,    0,    1660, 897,  0,    125,  1548, 312,  1290, 907,  0,    80,
        0,    714,  161,  0,    0,    264,  0,    0,    0,    534,  0,    216,  0,    0,    0,    638,
        0,    49,   0,    803,  0,    1441, 0,    475,  0,    0,    137,  1965, 1181, 0,    883,  0,
        501,  13,   1693, 0,    924,  0,    0,    0,    536,  248,  0,    672,  0,    0,    513,  908,
        1045, 0,    142,  374,  128,  0,    210,  1580, 833,  1602, 278,  660,  0,    0,    303,  0,
        1569, 0,    0,    200,  0,    0,    1085, 0,    0,    0,    1896, 0,    1929, 0,    0,    451,
        791,  0,    147,  412,  1221, 0,    970,  410,  0,    50,   13,   939,  93,   0,    774,  90,
        0,    0,    820,  71,   987,  948,  0,    1779, 0,    1318, 475,  1759, 0,    0,    0,    104,
        0,    0,    467,  12,   1410, 0,    909,  723,  143,  1853, 1481, 0,    773,  0,    107,  0,
        491,  656,  0,    0,    0,    1778, 1468, 630,  0,    316,  0,    1866, 0,    1139, 919,  1848,
        0,    1296, 4,    0,    0,    0,    633,  987,  0,    0,    0,    683,  133,  0,    728,  997,
        190,  230,  1861, 0,    585,  634,  0,    1326, 895,  1335, 0,    0,    0,    422,  667,  221,
        79,   1937, 0,    0,    457,  845,  1736, 500,  903,  498,  370,  1635, 1409, 9,    15,   0,
        0,    522,  0,    518,  118,  841,  417,  0,    929,  827,  802,  0,    0,    0,    184,  1639,
        0,    0,    1731, 261,  0,    0,    0,    886,  454,  0,    1742, 3,    0,    0,    111,  0,
        0,    0,    552,  0,    0,    376,  966,  0,    0,    516,  254,  900,  0,    0,    0,    0,
        499,  0,    0,    0,    889,  705,  0,    0,    255,  0,    0,    1907, 0,    1898, 0,    814,
        0,    605,  0,    412,  222,  790,  335,  0,    0,    142,  794,  0,    0,    972,  0,    0,
        628,  0,    109,  1553, 1153, 335,  748,  1512, 892,  1355, 1943, 801,  115,  0,    934,  228,
        428,  0,    0,    0,    255,  0,    1865, 1531, 0,    0,    0,    0,    962,  979,  1268, 237,
        108,  673,  0,    1560, 0,    0,    712,  1749, 0,    651,  289,  0,    108,  0,    157,  1623,
        0,    120,  77,   990,  1706, 350,  567,  1837, 1488, 0,    169,  1498, 0,    630,  217,  200,
        0,    0,    1818, 0,    0,    0,    0,    0,    0,    270,  1599, 632,  1505, 172,  963,  546,
        0,    613,  929,  0,    0,    214,  1539, 0,    82,   1768, 482,  0,    0,    1957, 0,    96,
        970,  398,  797,  688,  0,    723,  1379, 952,  661,  0,    1897, 0,    1675, 348,  0,    0,
        0,    1027, 0,    0,    0,    0,    865,  1550, 1452, 0,    537,  0,    64,   0,    965,  408,
        1303, 1236, 871,  0,    0,    27,   0,    0,    436,  493,  1723, 577,  1555, 0,    1868, 0,
        400,  0,    0,    0,    0,    0,    0,    597,  303,  745,  790,  629,  1482, 1010, 737,  0,
        0,    0,    0,    0,    0,    0,    949,  63,   1460, 753,  0,    0,    0,    435,  326,  0,
        130,  0,    82,   703,  0,    1759, 826,  0,    0,    0,    0,    1889, 0,    114,  607,  390,
        506,  0,    557,  1799, 921,  560,  5,    1109, 0,    430,  529,  0,    350,  573,  1399, 0,
        1050, 592,  0,    0,    118,  446,  830,  1365, 501,  1289, 376,  232,  0,    90,   1956, 0,
        723,  123,  0,    166,  609,  744,  0,    0,    0,    0,    956,  62,   0,    302,  530,  288,
        0,    727,  0,    1023, 0,    1388, 1335, 0,    0,    880,  496,  315,  1521, 478,  667,  898,
        86,   1735, 0,    1683, 178,  566,  1495, 27,   0,    0,    0,    0,    245,  266,  394,  73,
        0,    780,  280,  577,  0,    1902, 631,  0,    1922, 60,   358,  0,    0,    836,  0,    937,
        0,    75,   0,    526,  698,  0,    742,  1253, 0,    302,  1938, 506,  0,    862,  41,   0,
        0,    0,    746,  102,  696,  0,    0,    473,  159,  161,  1885, 0,    15,   1035, 0,    275,
        0,    301,  19,   0,    762,  0,    563,  286,  1117, 0,    1944, 184,  0,    1175, 760,  0,
        0,    1737, 0,    86,   1429, 1594, 1868, 440,  560,  1114, 0,    521,  0,    599,  808,  0,
        0,    1229, 331,  0,    316,  649,  492,  514,  425,  0,    563,  870,  479,  684,  549,  0,
        1736, 976,  595,  786,  0,    0,    63,   0,    929,  664,  0,    0,    98,   0,    819,  590,
        0,    1612, 0,    1444, 0,    0,    184,  297,  882,  1322, 702,  219,  1053, 247,  0,    393,
        1705, 41,   874,  231,  0,    55,   236,  0,    411,  0,    0,    539,  0,    0,    0,    620,
        878,  942,  329,  1729, 0,    782,  558,  0,    87,   0,    1844, 719,  0,    0,    0,    1261,
        0,    0,    0,    234,  0,    0,    109,  351,  0,    0,    187,  0,    0,    1944, 852,  0,
        1703, 68,   958,  5,    296,  0,    1809, 0,    427,  0,    1731, 1757, 0,    357,  1876, 697,
        174,  0,    51,   0,    0,    0,    30,   0,    0,    0,    0,    415,  824,  1251, 0,    1648,
        675,  389,  0,    597,  0,    724,  0,    0,    0,    0,    252,  923,  408,  0,    296,  1143,
        0,    148,  1573, 0,    384,  893,  0,    772,  1843, 0,    375,  232,  882,  0,    619,  0,
        690,  0,    1374, 516,  356,  0,    1889, 0,    2,    0,    0,    0,    0,    492,  86,   3,
        0,    953,  1190, 0,    307,  433,  0,    0,    1104};
    
    int MangledHashG(const char *key, const int *T)
    {
        int sum = 0;
    
        for (int i = 0; key[i] != '\0'; i++)
        {
            sum += T[i] * key[i];
            sum %= 1977;
        }
        return mangledkG[sum];
    }
    
    int MangledPerfectHash(const char *key)
    {
        if (strlen(key) > 37)
            return 0;
    
        return (MangledHashG(key, mangledkT1) + MangledHashG(key, mangledkT2)) % 1977;
    }
    
    constexpr int unmangledkT1[] = {163, 200, 23,  188, 228, 164, 235, 223, 155, 227, 190, 135, 61,
                                    36,  102, 226, 161, 44,  69,  138, 105, 177, 44,  180, 41,  256};
    constexpr int unmangledkT2[] = {185, 17,  279, 66, 39, 191, 246, 40,  267, 239, 253, 57,  237,
                                    78,  238, 45,  82, 49, 8,   23,  206, 264, 108, 23,  272, 147};
    constexpr int unmangledkG[]  = {
        0,   0,   0,   0,   0,   88,  0,   159, 0,   0,   56,  0,   142, 0,   0,   0,   80,  0,   0,
        0,   24,  0,   0,   24,  64,  178, 0,   0,   0,   0,   0,   0,   31,  16,  129, 0,   0,   0,
        0,   267, 0,   120, 0,   0,   84,  0,   270, 263, 101, 0,   77,  149, 0,   0,   0,   0,   0,
        0,   0,   0,   0,   0,   0,   87,  82,  0,   113, 0,   0,   255, 92,  0,   155, 136, 0,   25,
        52,  0,   95,  0,   91,  0,   0,   0,   169, 253, 9,   16,  104, 6,   0,   0,   0,   229, 0,
        102, 254, 40,  0,   75,  6,   117, 253, 0,   0,   138, 0,   147, 0,   0,   0,   0,   0,   0,
        0,   0,   47,  0,   0,   72,  0,   149, 0,   272, 62,  128, 0,   71,  169, 106, 0,   121, 57,
        279, 0,   0,   0,   0,   98,  0,   0,   251, 55,  0,   12,  0,   143, 0,   201, 243, 58,  207,
        0,   160, 52,  0,   0,   0,   0,   3,   0,   190, 0,   22,  0,   0,   67,  10,  56,  0,   268,
        259, 151, 112, 0,   52,  145, 19,  104, 0,   99,  0,   0,   255, 118, 61,  0,   16,  83,  0,
        0,   54,  16,  15,  141, 21,  0,   259, 145, 186, 92,  253, 1,   254, 97,  0,   15,  0,   212,
        111, 18,  215, 50,  0,   0,   27,  36,  59,  157, 256, 272, 0,   267, 180, 0,   31,  0,   13,
        0,   208, 109, 0,   0,   279, 13,  0,   0,   67,  0,   65,  84,  0,   215, 0,   0,   176, 131,
        0,   136, 0,   273, 235, 0,   251, 43,  35,  251, 118, 49,  39,  66,  0,   180, 87,  0,   62,
        191, 0,   8,   158, 203, 196, 58,  185, 136, 139, 126, 0,   0,   0,   0};
    
    int UnmangledHashG(const char *key, const int *T)
    {
        int sum = 0;
    
        for (int i = 0; key[i] != '\0'; i++)
        {
            sum += T[i] * key[i];
            sum %= 281;
        }
        return unmangledkG[sum];
    }
    
    int UnmangledPerfectHash(const char *key)
    {
        if (strlen(key) > 26)
            return 0;
    
        return (UnmangledHashG(key, unmangledkT1) + UnmangledHashG(key, unmangledkT2)) % 281;
    }
    
    }  // namespace
    
    namespace sh
    {
    
    template <>
    const size_t ImmutableString::FowlerNollVoHash<4>::kFnvPrime = 16777619u;
    
    template <>
    const size_t ImmutableString::FowlerNollVoHash<4>::kFnvOffsetBasis = 0x811c9dc5u;
    
    template <>
    const size_t ImmutableString::FowlerNollVoHash<8>::kFnvPrime =
        static_cast<size_t>(1099511628211ull);
    
    template <>
    const size_t ImmutableString::FowlerNollVoHash<8>::kFnvOffsetBasis =
        static_cast<size_t>(0xcbf29ce484222325ull);
    
    uint32_t ImmutableString::mangledNameHash() const
    {
        return MangledPerfectHash(data());
    }
    
    uint32_t ImmutableString::unmangledNameHash() const
    {
        return UnmangledPerfectHash(data());
    }
    
    }  // namespace sh