зеркало из https://github.com/AvaloniaUI/angle.git
Don't build symbol table for GLSL built-ins if on Android
The GLSL + ESSL autogenerated symbol table is too large for android, and android also doesn't need desktop GL functionality If on android, compile the ESSL only symbol table Bug: chromium:996286 Change-Id: I14dfc7748dae389e78c35f82a390c67962665356 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1757372 Commit-Queue: Clemen Deng <clemendeng@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
This commit is contained in:
Родитель
1d5aaa6cd9
Коммит
d7d425404b
|
@ -21,7 +21,7 @@ If you're only interested in function declarations or global variables, they're
|
|||
|
||||
TIntermTraverser has member functions to insert and replace nodes. To remove a node, replace it with an empty list. Usually visit functions queue replacements and then updateTree() is called after the traversal is complete - this way the replacement doesn't affect the current traversal. For some transformations of nested AST structures you may need to do multiple traversals.
|
||||
|
||||
**BuiltIn_autogen.h**: With the helpers here you can easily and cheaply create references to built-in variables that are stored as constexpr.
|
||||
**BuiltIn.h**: With the helpers here you can easily and cheaply create references to built-in variables that are stored as constexpr.
|
||||
|
||||
**IntermNode_utils.h**: These utilities can do things like create a zero node with an arbitrary type, create bool nodes, index nodes, or operations on temporary variables.
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"src/compiler/translator/ImmutableString_autogen.cpp":
|
||||
"81004ecca353bdce6999ba864615e10f",
|
||||
"src/compiler/translator/ParseContext_autogen.h":
|
||||
"48f878f5878e8ab239af7c14e5878b62",
|
||||
"src/compiler/translator/SymbolTable_autogen.cpp":
|
||||
"e101aa202c0397caf48482853bb90d02",
|
||||
"src/compiler/translator/SymbolTable_autogen.h":
|
||||
"3b7cc472d076136a048d6b6f9c28460c",
|
||||
"src/compiler/translator/builtin_function_declarations.txt":
|
||||
"fc9b0b050448d015482c9f13cab1df67",
|
||||
"src/compiler/translator/builtin_variables.json":
|
||||
"34906b1c84fe40824e412607f9f1c501",
|
||||
"src/compiler/translator/gen_builtin_symbols.py":
|
||||
"a671720ef20bf7d7a7f719a42f9ae7b6",
|
||||
"src/compiler/translator/tree_util/BuiltIn_autogen.h":
|
||||
"80a911c6701baded2fd8d5567c605669",
|
||||
"src/tests/compiler_tests/ImmutableString_test_autogen.cpp":
|
||||
"181c3209ad287d1a9477313ea0332445"
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
"src/compiler/translator/emulated_builtin_function_data_hlsl.json":
|
||||
"002ad46d144c51fe98d73478aa554ba7",
|
||||
"src/compiler/translator/emulated_builtin_functions_hlsl_autogen.cpp":
|
||||
"1c759ffdd27a86fd8f2d590b2f3dcb56",
|
||||
"2d43e80d277a8fcc05212a94438883f2",
|
||||
"src/compiler/translator/gen_emulated_builtin_function_tables.py":
|
||||
"5991de4f43758f59d9d042581ae04eab"
|
||||
"1c51fee50b5431779b1cdbfd910c3aca"
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"src/compiler/translator/ImmutableString_ESSL_autogen.cpp":
|
||||
"0a6f36eed915883baf3cb9f864905823",
|
||||
"src/compiler/translator/ImmutableString_autogen.cpp":
|
||||
"81004ecca353bdce6999ba864615e10f",
|
||||
"src/compiler/translator/ParseContext_ESSL_autogen.h":
|
||||
"dadb27b8d2dc56310e448ad131d651dd",
|
||||
"src/compiler/translator/ParseContext_complete_autogen.h":
|
||||
"a4209c68899e9cf3bcce81be2cb5f39f",
|
||||
"src/compiler/translator/SymbolTable_ESSL_autogen.cpp":
|
||||
"2a7b72848c39b080bd561068ea17f7a2",
|
||||
"src/compiler/translator/SymbolTable_autogen.cpp":
|
||||
"787c440bd5b5eaf27abdcd571a71cce9",
|
||||
"src/compiler/translator/SymbolTable_autogen.h":
|
||||
"3b7cc472d076136a048d6b6f9c28460c",
|
||||
"src/compiler/translator/builtin_function_declarations.txt":
|
||||
"fc9b0b050448d015482c9f13cab1df67",
|
||||
"src/compiler/translator/builtin_variables.json":
|
||||
"34906b1c84fe40824e412607f9f1c501",
|
||||
"src/compiler/translator/gen_builtin_symbols.py":
|
||||
"3c867ef8bd6d80fa3d237c601b98407d",
|
||||
"src/compiler/translator/tree_util/BuiltIn_ESSL_autogen.h":
|
||||
"3a69c3e1090d1b38f193e481aba976fb",
|
||||
"src/compiler/translator/tree_util/BuiltIn_complete_autogen.h":
|
||||
"f3ec88a26be22805453fd711910f2040",
|
||||
"src/tests/compiler_tests/ImmutableString_test_ESSL_autogen.cpp":
|
||||
"b8c43b7c4825633f275c7c0bc1f597ad",
|
||||
"src/tests/compiler_tests/ImmutableString_test_autogen.cpp":
|
||||
"181c3209ad287d1a9477313ea0332445"
|
||||
}
|
|
@ -107,8 +107,8 @@ generators = {
|
|||
'src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py',
|
||||
'Emulated HLSL functions':
|
||||
'src/compiler/translator/gen_emulated_builtin_function_tables.py',
|
||||
'ESSL static builtins':
|
||||
'src/compiler/translator/gen_builtin_symbols.py',
|
||||
'Static builtins':
|
||||
'src/compiler/translator/gen_builtin_symbols.py'
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@ angle_translator_sources = [
|
|||
"src/compiler/translator/FunctionLookup.h",
|
||||
"src/compiler/translator/HashNames.cpp",
|
||||
"src/compiler/translator/HashNames.h",
|
||||
"src/compiler/translator/ImmutableString_autogen.cpp",
|
||||
"src/compiler/translator/ImmutableString.h",
|
||||
"src/compiler/translator/ImmutableStringBuilder.cpp",
|
||||
"src/compiler/translator/ImmutableStringBuilder.h",
|
||||
|
@ -65,7 +64,9 @@ angle_translator_sources = [
|
|||
"src/compiler/translator/OutputTree.h",
|
||||
"src/compiler/translator/ParseContext.cpp",
|
||||
"src/compiler/translator/ParseContext.h",
|
||||
"src/compiler/translator/ParseContext_autogen.h",
|
||||
"src/compiler/translator/ParseContext_interm.h",
|
||||
"src/compiler/translator/ParseContext_complete_autogen.h",
|
||||
"src/compiler/translator/ParseContext_ESSL_autogen.h",
|
||||
"src/compiler/translator/PoolAlloc.cpp",
|
||||
"src/compiler/translator/PoolAlloc.h",
|
||||
"src/compiler/translator/Pragma.h",
|
||||
|
@ -79,7 +80,6 @@ angle_translator_sources = [
|
|||
"src/compiler/translator/Symbol.h",
|
||||
"src/compiler/translator/SymbolTable.cpp",
|
||||
"src/compiler/translator/SymbolTable.h",
|
||||
"src/compiler/translator/SymbolTable_autogen.cpp",
|
||||
"src/compiler/translator/SymbolTable_autogen.h",
|
||||
"src/compiler/translator/SymbolUniqueId.cpp",
|
||||
"src/compiler/translator/SymbolUniqueId.h",
|
||||
|
@ -193,7 +193,9 @@ angle_translator_sources = [
|
|||
"src/compiler/translator/tree_ops/UseInterfaceBlockFields.h",
|
||||
"src/compiler/translator/tree_ops/VectorizeVectorScalarArithmetic.cpp",
|
||||
"src/compiler/translator/tree_ops/VectorizeVectorScalarArithmetic.h",
|
||||
"src/compiler/translator/tree_util/BuiltIn_autogen.h",
|
||||
"src/compiler/translator/tree_util/BuiltIn.h",
|
||||
"src/compiler/translator/tree_util/BuiltIn_complete_autogen.h",
|
||||
"src/compiler/translator/tree_util/BuiltIn_ESSL_autogen.h",
|
||||
"src/compiler/translator/tree_util/FindFunction.cpp",
|
||||
"src/compiler/translator/tree_util/FindFunction.h",
|
||||
"src/compiler/translator/tree_util/FindMain.cpp",
|
||||
|
@ -292,6 +294,17 @@ angle_translator_lib_vulkan_sources = [
|
|||
"src/compiler/translator/TranslatorVulkan.cpp",
|
||||
"src/compiler/translator/TranslatorVulkan.h",
|
||||
]
|
||||
if (is_android) {
|
||||
angle_translator_sources += [
|
||||
"src/compiler/translator/ImmutableString_ESSL_autogen.cpp",
|
||||
"src/compiler/translator/SymbolTable_ESSL_autogen.cpp",
|
||||
]
|
||||
} else {
|
||||
angle_translator_sources += [
|
||||
"src/compiler/translator/ImmutableString_autogen.cpp",
|
||||
"src/compiler/translator/SymbolTable_autogen.cpp",
|
||||
]
|
||||
}
|
||||
angle_preprocessor_sources = [
|
||||
"src/compiler/preprocessor/DiagnosticsBase.cpp",
|
||||
"src/compiler/preprocessor/DiagnosticsBase.h",
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "angle_gl.h"
|
||||
#include "compiler/translator/BuiltInFunctionEmulator.h"
|
||||
#include "compiler/translator/VersionGLSL.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn_autogen.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn.h"
|
||||
|
||||
namespace sh
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "angle_gl.h"
|
||||
#include "compiler/translator/BuiltInFunctionEmulator.h"
|
||||
#include "compiler/translator/VersionGLSL.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn_autogen.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn.h"
|
||||
|
||||
namespace sh
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include "compiler/translator/tree_ops/UnfoldShortCircuitAST.h"
|
||||
#include "compiler/translator/tree_ops/UseInterfaceBlockFields.h"
|
||||
#include "compiler/translator/tree_ops/VectorizeVectorScalarArithmetic.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn_autogen.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn.h"
|
||||
#include "compiler/translator/tree_util/IntermNodePatternMatcher.h"
|
||||
#include "compiler/translator/tree_util/ReplaceShadowingVariables.h"
|
||||
#include "compiler/translator/util.h"
|
||||
|
|
|
@ -0,0 +1,247 @@
|
|||
// GENERATED FILE - DO NOT EDIT.
|
||||
// Generated by gen_builtin_symbols.py using data from builtin_variables.json and
|
||||
// builtin_function_declarations.txt.
|
||||
//
|
||||
// Copyright 2019 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[] = {1565, 313, 287, 949, 1140, 1423, 508, 548, 1149, 1607,
|
||||
810, 340, 1456, 1143, 1562, 1788, 172, 1529, 1200, 1567,
|
||||
56, 1802, 216, 1101, 1543, 1842, 75, 732, 732, 474,
|
||||
903, 1146, 792, 329, 101, 1318, 1200};
|
||||
constexpr int mangledkT2[] = {1578, 1819, 453, 619, 1394, 30, 646, 34, 1060, 790,
|
||||
1071, 30, 1008, 1597, 1733, 413, 119, 1557, 912, 548,
|
||||
98, 237, 1013, 1863, 886, 599, 76, 674, 729, 550,
|
||||
1426, 1318, 233, 1220, 1858, 584, 1130};
|
||||
constexpr int mangledkG[] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 454, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1905, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 526, 0, 0, 0,
|
||||
0, 172, 369, 0, 430, 925, 0, 0, 0, 0, 0, 110, 108, 165, 0, 0,
|
||||
0, 0, 0, 0, 1185, 293, 0, 0, 0, 0, 0, 425, 0, 0, 1713, 0,
|
||||
0, 0, 0, 711, 0, 0, 0, 0, 0, 40, 1877, 0, 1918, 863, 0, 0,
|
||||
0, 0, 223, 0, 0, 871, 0, 0, 0, 0, 0, 0, 0, 1492, 1066, 0,
|
||||
0, 0, 1611, 1627, 0, 764, 0, 657, 179, 1758, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 576, 0, 0, 0, 0, 0, 0, 0, 0, 198, 0, 0, 0, 1784,
|
||||
0, 1552, 0, 0, 690, 0, 730, 0, 254, 0, 0, 0, 793, 1273, 0, 0,
|
||||
204, 0, 0, 0, 0, 0, 1739, 0, 238, 321, 0, 240, 189, 0, 239, 0,
|
||||
0, 0, 970, 0, 681, 0, 0, 0, 680, 0, 541, 1832, 0, 0, 0, 1083,
|
||||
1725, 0, 0, 0, 0, 0, 837, 156, 0, 0, 0, 1112, 0, 358, 108, 0,
|
||||
0, 0, 187, 821, 0, 105, 0, 0, 514, 54, 1739, 1588, 504, 1533, 0, 0,
|
||||
1737, 0, 0, 0, 0, 309, 0, 1710, 902, 0, 0, 1567, 0, 1570, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 45, 790, 0, 967, 0, 818, 77, 0,
|
||||
975, 0, 1063, 0, 0, 0, 0, 0, 0, 387, 1862, 0, 0, 0, 0, 0,
|
||||
0, 0, 797, 0, 1138, 0, 31, 1457, 0, 0, 1077, 0, 0, 315, 0, 0,
|
||||
0, 0, 236, 0, 897, 0, 0, 0, 0, 0, 492, 0, 0, 710, 1414, 0,
|
||||
175, 0, 0, 0, 47, 0, 74, 210, 0, 629, 1564, 473, 0, 177, 1867, 1630,
|
||||
355, 0, 0, 153, 357, 0, 852, 0, 0, 0, 1244, 0, 0, 0, 0, 967,
|
||||
0, 0, 68, 0, 0, 0, 0, 1502, 1837, 0, 0, 1086, 228, 0, 0, 964,
|
||||
0, 0, 0, 0, 0, 0, 0, 973, 0, 402, 382, 0, 725, 0, 1097, 0,
|
||||
0, 760, 0, 81, 0, 1610, 402, 0, 457, 0, 0, 83, 0, 515, 176, 0,
|
||||
331, 0, 0, 1754, 374, 1888, 0, 0, 0, 0, 1378, 0, 0, 178, 118, 0,
|
||||
0, 899, 0, 822, 832, 0, 0, 14, 0, 0, 0, 0, 515, 630, 0, 0,
|
||||
0, 0, 0, 0, 0, 146, 684, 0, 0, 1269, 1785, 0, 627, 0, 1622, 587,
|
||||
152, 659, 0, 958, 0, 1491, 1036, 147, 697, 1081, 0, 0, 0, 0, 0, 0,
|
||||
327, 0, 0, 1174, 811, 0, 0, 0, 0, 294, 0, 1584, 626, 0, 0, 0,
|
||||
0, 90, 0, 857, 0, 0, 309, 1652, 0, 1759, 0, 655, 0, 1864, 0, 337,
|
||||
0, 0, 0, 0, 796, 220, 0, 0, 297, 234, 0, 0, 163, 0, 0, 0,
|
||||
0, 1723, 848, 0, 0, 0, 0, 0, 0, 0, 889, 1667, 127, 0, 0, 856,
|
||||
698, 0, 0, 0, 0, 708, 0, 672, 118, 0, 0, 0, 0, 1676, 0, 0,
|
||||
0, 0, 121, 0, 0, 337, 0, 701, 0, 0, 0, 0, 0, 282, 254, 0,
|
||||
559, 1714, 1555, 556, 650, 0, 0, 1439, 0, 51, 0, 0, 1112, 309, 85, 0,
|
||||
987, 965, 0, 711, 0, 443, 1613, 0, 378, 378, 646, 0, 0, 476, 744, 1755,
|
||||
0, 0, 451, 79, 0, 140, 0, 0, 0, 0, 150, 477, 0, 0, 0, 0,
|
||||
0, 0, 1921, 0, 0, 0, 684, 0, 0, 226, 0, 1281, 332, 67, 225, 1415,
|
||||
1471, 0, 243, 0, 0, 0, 140, 1622, 0, 238, 0, 432, 425, 109, 397, 0,
|
||||
1803, 602, 631, 0, 59, 1642, 0, 824, 1500, 643, 0, 0, 1659, 190, 0, 0,
|
||||
144, 0, 18, 766, 0, 120, 0, 0, 0, 0, 477, 0, 854, 409, 0, 1632,
|
||||
203, 0, 286, 679, 375, 0, 0, 201, 1575, 0, 173, 0, 0, 0, 626, 0,
|
||||
0, 802, 0, 0, 0, 799, 0, 0, 0, 736, 0, 568, 480, 0, 0, 0,
|
||||
988, 1406, 1831, 0, 0, 452, 363, 0, 0, 905, 1191, 592, 594, 0, 0, 581,
|
||||
39, 489, 0, 70, 1637, 364, 385, 0, 399, 0, 1816, 0, 0, 0, 0, 0,
|
||||
0, 0, 254, 531, 1000, 1355, 1727, 0, 238, 0, 0, 832, 847, 1883, 1836, 0,
|
||||
0, 328, 365, 11, 0, 0, 0, 0, 0, 0, 0, 277, 0, 0, 750, 75,
|
||||
0, 72, 260, 0, 0, 0, 0, 1489, 669, 0, 299, 0, 236, 918, 0, 0,
|
||||
0, 1575, 0, 691, 0, 0, 0, 467, 0, 0, 0, 0, 0, 209, 1140, 586,
|
||||
183, 0, 0, 552, 0, 113, 83, 0, 1901, 0, 0, 1557, 714, 1865, 223, 1439,
|
||||
177, 0, 261, 862, 1834, 437, 0, 0, 0, 0, 0, 0, 0, 366, 0, 560,
|
||||
0, 1810, 0, 1416, 515, 0, 47, 1037, 892, 213, 569, 1734, 0, 571, 1614, 0,
|
||||
414, 1687, 276, 0, 0, 0, 0, 548, 541, 1489, 0, 0, 0, 1437, 0, 1097,
|
||||
0, 552, 1359, 0, 0, 0, 60, 174, 0, 0, 0, 0, 707, 0, 221, 0,
|
||||
0, 807, 0, 0, 816, 0, 96, 0, 953, 1803, 843, 32, 1586, 872, 212, 1922,
|
||||
0, 0, 0, 0, 746, 0, 1356, 1921, 154, 0, 71, 162, 0, 0, 0, 398,
|
||||
438, 0, 577, 620, 0, 550, 1724, 916, 816, 371, 0, 903, 204, 0, 0, 0,
|
||||
0, 0, 0, 913, 0, 0, 535, 1641, 1777, 432, 0, 550, 0, 0, 618, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 827, 0, 0, 0, 622, 607, 0, 1336,
|
||||
34, 36, 0, 455, 187, 1323, 316, 0, 0, 347, 333, 39, 782, 1747, 0, 0,
|
||||
0, 1191, 0, 1237, 424, 250, 1887, 0, 1706, 0, 621, 1657, 362, 0, 0, 667,
|
||||
0, 0, 133, 223, 891, 0, 0, 0, 902, 354, 1242, 0, 0, 0, 0, 0,
|
||||
485, 555, 720, 558, 0, 229, 373, 573, 0, 0, 0, 0, 1779, 4, 0, 0,
|
||||
0, 120, 0, 0, 58, 440, 1918, 830, 0, 0, 1510, 272, 0, 351, 0, 0,
|
||||
321, 0, 1683, 262, 0, 459, 0, 0, 0, 1259, 728, 0, 23, 502, 15, 0,
|
||||
707, 0, 0, 772, 268, 1875, 0, 0, 0, 1246, 53, 0, 988, 88, 475, 0,
|
||||
0, 496, 0, 781, 338, 78, 0, 0, 0, 0, 464, 0, 446, 510, 1862, 347,
|
||||
740, 865, 147, 0, 0, 514, 908, 97, 508, 0, 0, 573, 0, 0, 1260, 0,
|
||||
0, 0, 0, 616, 1870, 103, 1828, 842, 1104, 0, 0, 0, 1850, 303, 420, 760,
|
||||
0, 0, 0, 0, 0, 0, 2, 1877, 0, 878, 1867, 0, 0, 439, 0, 0,
|
||||
201, 165, 400, 0, 1084, 0, 1100, 0, 597, 0, 22, 278, 460, 0, 1058, 920,
|
||||
1586, 0, 0, 131, 475, 596, 0, 0, 602, 0, 0, 1562, 0, 873, 42, 0,
|
||||
380, 376, 345, 1785, 0, 474, 0, 0, 0, 1189, 1680, 263, 0, 1904, 0, 99,
|
||||
0, 0, 36, 513, 0, 117, 821, 0, 341, 733, 1293, 86, 191, 1669, 448, 0,
|
||||
588, 673, 0, 95, 0, 0, 0, 649, 1192, 0, 0, 0, 0, 0, 504, 0,
|
||||
647, 1350, 398, 0, 1594, 0, 0, 557, 0, 726, 0, 1675, 0, 0, 0, 1672,
|
||||
733, 0, 1773, 0, 853, 0, 0, 0, 0, 0, 28, 1540, 0, 0, 0, 379,
|
||||
149, 809, 763, 0, 0, 964, 0, 504, 247, 130, 0, 0, 188, 396, 0, 1193,
|
||||
0, 0, 556, 511, 0, 0, 0, 0, 3, 417, 0, 171, 0, 0, 0, 0,
|
||||
0, 340, 1358, 644, 923, 750, 0, 0, 238, 66, 320, 278, 1706, 0, 805, 0,
|
||||
447, 523, 74, 465, 540, 1896, 466, 0, 0, 207, 0, 633, 78, 0, 0, 753,
|
||||
0, 0, 0, 410, 0, 0, 0, 1512, 0, 224, 728, 557, 0, 0, 1752, 1727,
|
||||
822, 0, 0, 0, 0, 0, 1841, 683, 590, 1914, 0, 0, 979, 795, 1290, 333,
|
||||
0, 0, 1410, 0, 0, 238, 0, 1453, 0, 617, 0, 1879, 1827, 0, 1820, 659,
|
||||
0, 345, 770, 325, 0, 0, 800, 253, 0, 0, 514, 158, 0, 1417, 100, 329,
|
||||
1869, 0, 917, 609, 0, 0, 0, 856, 1751, 277, 123, 0, 0, 889, 544, 0,
|
||||
0, 1719, 353, 525, 402, 1366, 1289, 0, 0, 0, 0, 721, 241, 1564, 0, 422,
|
||||
0, 0, 1557, 0, 1686, 106, 373, 0, 313, 1479, 386, 0, 746, 655, 0, 454,
|
||||
1547, 0, 0, 0, 0, 0, 0, 86, 0, 696, 189, 0, 163, 405, 719, 1267,
|
||||
0, 66, 1477, 0, 2, 1159, 1539, 0, 1915, 132, 0, 51, 0, 625, 0, 697,
|
||||
575, 0, 782, 0, 0, 0, 0, 0, 299, 284, 726, 206, 0, 266, 0, 0,
|
||||
0, 21, 0, 737, 0, 0, 1806, 1780, 699, 0, 740, 0, 195, 0, 1550, 1716,
|
||||
0, 350, 0, 0, 295, 87, 0, 0, 1798, 1860, 316, 0, 200, 670, 0, 1879,
|
||||
352, 0, 910, 0, 0, 1475, 1740, 0, 1875, 27, 0, 534, 0, 703, 0, 0,
|
||||
1900, 0, 0, 0, 0, 0, 415, 0, 163, 1778, 106, 1291, 664, 0, 1207, 1315,
|
||||
182, 387, 0, 168, 84, 0, 0, 0, 458, 0, 0, 656, 237, 264, 307, 0,
|
||||
0, 1604, 1086, 228, 1788, 0, 0, 1049, 0, 1734, 0, 1859, 0, 416, 0, 531,
|
||||
0, 202, 0, 204, 0, 0, 0, 0, 708, 0, 196, 1923, 0, 0, 1037, 1464,
|
||||
359, 86, 0, 1856, 0, 97, 882, 0, 1741, 734, 0, 0, 0, 0, 0, 828,
|
||||
0, 0, 0, 925, 0, 737, 390, 0, 362, 363, 967, 889, 550, 457, 0, 42,
|
||||
0, 705, 0, 1655, 875, 649, 0, 0, 1822, 0, 0, 0, 1347, 1689, 0, 412,
|
||||
0, 0, 715, 0, 269, 0, 235, 1076, 0, 578, 280, 193, 396, 748, 0, 149,
|
||||
0, 894, 0, 1311, 7, 0, 856, 0, 0, 0, 601, 1878, 0, 0, 411, 0,
|
||||
176, 1407, 0, 223, 1732, 0, 194, 411, 0, 0, 167, 342, 0, 0, 18, 269,
|
||||
515, 357, 456, 615, 0, 673, 756, 1283, 841, 259, 702, 556, 0, 0, 0, 388,
|
||||
0, 748, 220, 0, 0, 1772, 0, 0, 0, 763, 751, 158, 0, 0, 532, 692,
|
||||
178, 0, 0, 1635, 0, 0, 835, 0, 0, 810, 0, 1876, 0, 0, 1869, 1673,
|
||||
0, 0, 683, 425, 0, 432, 378, 57, 427, 289, 0, 0, 742, 0, 0, 736,
|
||||
16, 1189, 680, 0, 630, 282, 1084, 168, 151, 0, 909, 0, 0, 0, 617, 113,
|
||||
0, 0, 0, 863, 1829, 367, 0, 89, 0, 348, 0, 1554, 0, 545, 427, 0,
|
||||
0, 0, 417, 0, 0, 17, 0, 0, 518, 56, 436, 20, 143, 429, 25, 345,
|
||||
557, 0, 645, 724, 328, 0, 0, 312, 1295, 0, 0, 563, 0, 212, 0, 0,
|
||||
430, 1733, 398, 1697, 0, 1861, 1558, 1763, 469, 847, 0, 0, 505, 0, 0, 0,
|
||||
217, 0, 675, 0, 661, 1351, 443, 0, 1857, 157, 579, 0, 1798, 0, 428, 658,
|
||||
1502, 463, 249, 193, 0, 0, 118, 0, 299, 0, 0, 788, 0, 841, 271, 0,
|
||||
1335, 0, 229, 831, 0, 677, 1158, 0, 0, 1855, 605, 482, 1210, 0, 1780, 1468,
|
||||
0, 0, 415, 652, 0, 1887, 442, 1481, 1239, 0, 294, 0, 0, 0, 1766, 0,
|
||||
159, 172, 0, 0, 96, 876, 218, 0, 1153, 171, 0, 0, 0, 1267, 1810, 15,
|
||||
0, 156, 230, 0, 735, 0, 0, 1478, 342, 0, 722, 304, 393, 0, 578, 1886,
|
||||
0, 1163, 0, 1877, 794};
|
||||
|
||||
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 %= 1925;
|
||||
}
|
||||
return mangledkG[sum];
|
||||
}
|
||||
|
||||
int MangledPerfectHash(const char *key)
|
||||
{
|
||||
if (strlen(key) > 37)
|
||||
return 0;
|
||||
|
||||
return (MangledHashG(key, mangledkT1) + MangledHashG(key, mangledkT2)) % 1925;
|
||||
}
|
||||
|
||||
constexpr int unmangledkT1[] = {104, 115, 230, 189, 197, 210, 40, 117, 33, 19, 181, 77, 107,
|
||||
245, 52, 101, 9, 54, 143, 164, 147, 179, 128, 95, 103, 208};
|
||||
constexpr int unmangledkT2[] = {84, 175, 47, 86, 124, 216, 4, 84, 180, 105, 242, 139, 223,
|
||||
26, 238, 229, 223, 88, 240, 48, 210, 76, 78, 73, 73, 57};
|
||||
constexpr int unmangledkG[] = {
|
||||
0, 0, 0, 0, 0, 0, 107, 0, 0, 0, 94, 36, 239, 0, 1, 116, 0, 217,
|
||||
0, 0, 0, 0, 0, 0, 0, 242, 0, 19, 11, 101, 0, 0, 193, 37, 0, 0,
|
||||
0, 0, 0, 0, 242, 0, 69, 37, 0, 100, 0, 0, 136, 0, 64, 10, 0, 0,
|
||||
119, 0, 0, 0, 0, 0, 121, 0, 0, 19, 36, 0, 0, 0, 63, 191, 80, 14,
|
||||
44, 18, 67, 0, 52, 132, 189, 0, 102, 209, 0, 20, 168, 231, 189, 0, 88, 24,
|
||||
0, 0, 0, 101, 40, 0, 183, 111, 0, 109, 68, 0, 235, 88, 0, 0, 0, 0,
|
||||
0, 0, 0, 9, 0, 220, 18, 139, 55, 88, 79, 0, 0, 56, 130, 0, 114, 22,
|
||||
230, 0, 86, 203, 0, 216, 0, 0, 0, 0, 153, 28, 193, 124, 95, 72, 60, 0,
|
||||
0, 32, 0, 0, 233, 149, 110, 137, 12, 0, 35, 0, 141, 152, 112, 0, 49, 246,
|
||||
80, 0, 33, 0, 83, 82, 118, 0, 16, 31, 116, 166, 0, 136, 156, 5, 0, 26,
|
||||
166, 34, 156, 0, 71, 134, 238, 0, 81, 0, 121, 27, 128, 0, 41, 0, 51, 0,
|
||||
63, 212, 104, 200, 94, 142, 89, 0, 0, 0, 1, 214, 0, 90, 131, 146, 113, 5,
|
||||
209, 115, 0, 39, 218, 1, 133, 85, 60, 214, 0, 94, 0, 235, 1, 227, 69, 0,
|
||||
69, 161, 0, 151, 120, 1, 42, 167, 72, 17, 0, 0, 40, 162, 36};
|
||||
|
||||
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 %= 249;
|
||||
}
|
||||
return unmangledkG[sum];
|
||||
}
|
||||
|
||||
int UnmangledPerfectHash(const char *key)
|
||||
{
|
||||
if (strlen(key) > 26)
|
||||
return 0;
|
||||
|
||||
return (UnmangledHashG(key, unmangledkT1) + UnmangledHashG(key, unmangledkT2)) % 249;
|
||||
}
|
||||
|
||||
} // 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
|
|
@ -12,7 +12,7 @@
|
|||
#include "common/mathutil.h"
|
||||
#include "compiler/preprocessor/SourceLocation.h"
|
||||
#include "compiler/translator/Declarator.h"
|
||||
#include "compiler/translator/ParseContext_autogen.h"
|
||||
#include "compiler/translator/ParseContext_interm.h"
|
||||
#include "compiler/translator/StaticType.h"
|
||||
#include "compiler/translator/ValidateGlobalInitializer.h"
|
||||
#include "compiler/translator/ValidateSwitch.h"
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
// GENERATED FILE - DO NOT EDIT.
|
||||
// Generated by gen_builtin_symbols.py using data from builtin_variables.json and
|
||||
// builtin_function_declarations.txt.
|
||||
//
|
||||
// Copyright 2019 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.
|
||||
//
|
||||
// ParseContext_ESSL_autogen.h:
|
||||
// Helpers for built-in related checks.
|
||||
|
||||
#ifndef COMPILER_TRANSLATOR_PARSECONTEXT_AUTOGEN_H_
|
||||
#define COMPILER_TRANSLATOR_PARSECONTEXT_AUTOGEN_H_
|
||||
|
||||
namespace sh
|
||||
{
|
||||
|
||||
namespace BuiltInGroup
|
||||
{
|
||||
|
||||
bool isTextureOffsetNoBias(const TFunction *func)
|
||||
{
|
||||
int id = func->uniqueId().get();
|
||||
return id >= 3012 && id <= 3081;
|
||||
}
|
||||
bool isTextureOffsetBias(const TFunction *func)
|
||||
{
|
||||
int id = func->uniqueId().get();
|
||||
return id >= 3082 && id <= 3101;
|
||||
}
|
||||
bool isTextureGatherOffset(const TFunction *func)
|
||||
{
|
||||
int id = func->uniqueId().get();
|
||||
return id >= 3139 && id <= 3152;
|
||||
}
|
||||
bool isTextureGather(const TFunction *func)
|
||||
{
|
||||
int id = func->uniqueId().get();
|
||||
return id >= 3115 && id <= 3152;
|
||||
}
|
||||
bool isAtomicMemory(const TFunction *func)
|
||||
{
|
||||
int id = func->uniqueId().get();
|
||||
return id >= 3169 && id <= 3186;
|
||||
}
|
||||
bool isImageLoad(const TFunction *func)
|
||||
{
|
||||
int id = func->uniqueId().get();
|
||||
return id >= 3211 && id <= 3222;
|
||||
}
|
||||
bool isImageStore(const TFunction *func)
|
||||
{
|
||||
int id = func->uniqueId().get();
|
||||
return id >= 3223 && id <= 3234;
|
||||
}
|
||||
bool isImage(const TFunction *func)
|
||||
{
|
||||
int id = func->uniqueId().get();
|
||||
return id >= 3187 && id <= 3234;
|
||||
}
|
||||
|
||||
} // namespace BuiltInGroup
|
||||
|
||||
} // namespace sh
|
||||
|
||||
#endif // COMPILER_TRANSLATOR_PARSECONTEXT_AUTOGEN_H_
|
|
@ -6,7 +6,7 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// ParseContext_autogen.h:
|
||||
// ParseContext_complete_autogen.h:
|
||||
// Helpers for built-in related checks.
|
||||
|
||||
#ifndef COMPILER_TRANSLATOR_PARSECONTEXT_AUTOGEN_H_
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// ParseContext_interm.h:
|
||||
// Chooses ParseContext_complete_autogen.h or ParseContext_ESSL_autogen.h
|
||||
// depending on whether platform is android
|
||||
|
||||
#ifndef COMPILER_TRANSLATOR_PARSECONTEXT_INTERM_H_
|
||||
#define COMPILER_TRANSLATOR_PARSECONTEXT_INTERM_H_
|
||||
|
||||
#if defined(ANDROID)
|
||||
# include "ParseContext_ESSL_autogen.h"
|
||||
#else
|
||||
# include "ParseContext_complete_autogen.h"
|
||||
#endif
|
||||
|
||||
#endif // COMPILER_TRANSLATOR_PARSECONTEXT_INTERM_H_
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -16,7 +16,7 @@
|
|||
#include "compiler/translator/StaticType.h"
|
||||
#include "compiler/translator/Symbol.h"
|
||||
#include "compiler/translator/SymbolTable.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn_autogen.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn.h"
|
||||
|
||||
namespace sh
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "compiler/translator/tree_ops/RewriteDfdy.h"
|
||||
#include "compiler/translator/tree_ops/RewriteRowMajorMatrices.h"
|
||||
#include "compiler/translator/tree_ops/RewriteStructSamplers.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn_autogen.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn.h"
|
||||
#include "compiler/translator/tree_util/FindFunction.h"
|
||||
#include "compiler/translator/tree_util/FindMain.h"
|
||||
#include "compiler/translator/tree_util/IntermNode_util.h"
|
||||
|
@ -220,7 +220,7 @@ ANGLE_NO_DISCARD bool FlipBuiltinVariable(TCompiler *compiler,
|
|||
|
||||
// Create a swizzle to "builtin.y"
|
||||
TVector<int> swizzleOffsetY = {1};
|
||||
TIntermSwizzle *builtinY = new TIntermSwizzle(builtinRef, swizzleOffsetY);
|
||||
TIntermSwizzle *builtinY = new TIntermSwizzle(builtinRef, swizzleOffsetY);
|
||||
|
||||
// Create a symbol reference to our new variable that will hold the modified builtin.
|
||||
const TType *type = StaticType::GetForVec<EbtFloat>(
|
||||
|
@ -300,14 +300,14 @@ ANGLE_NO_DISCARD bool AppendVertexShaderDepthCorrectionToMain(TCompiler *compile
|
|||
|
||||
// Create a swizzle to "gl_Position.z"
|
||||
TVector<int> swizzleOffsetZ = {2};
|
||||
TIntermSwizzle *positionZ = new TIntermSwizzle(positionRef, swizzleOffsetZ);
|
||||
TIntermSwizzle *positionZ = new TIntermSwizzle(positionRef, swizzleOffsetZ);
|
||||
|
||||
// Create a constant "0.5"
|
||||
TIntermConstantUnion *oneHalf = CreateFloatNode(0.5f);
|
||||
|
||||
// Create a swizzle to "gl_Position.w"
|
||||
TVector<int> swizzleOffsetW = {3};
|
||||
TIntermSwizzle *positionW = new TIntermSwizzle(positionRef->deepCopy(), swizzleOffsetW);
|
||||
TIntermSwizzle *positionW = new TIntermSwizzle(positionRef->deepCopy(), swizzleOffsetW);
|
||||
|
||||
// Create the expression "(gl_Position.z + gl_Position.w) * 0.5".
|
||||
TIntermBinary *zPlusW = new TIntermBinary(EOpAdd, positionZ->deepCopy(), positionW->deepCopy());
|
||||
|
@ -521,20 +521,20 @@ ANGLE_NO_DISCARD bool AddLineSegmentRasterizationEmulation(TCompiler *compiler,
|
|||
const TType *vec2Type = StaticType::GetBasic<EbtFloat, 2>();
|
||||
|
||||
// Create a swizzle to "ANGLEUniforms.viewport.xy".
|
||||
TIntermBinary *viewportRef = CreateDriverUniformRef(driverUniforms, kViewport);
|
||||
TIntermBinary *viewportRef = CreateDriverUniformRef(driverUniforms, kViewport);
|
||||
TVector<int> swizzleOffsetXY = {0, 1};
|
||||
TIntermSwizzle *viewportXY = new TIntermSwizzle(viewportRef->deepCopy(), swizzleOffsetXY);
|
||||
TIntermSwizzle *viewportXY = new TIntermSwizzle(viewportRef->deepCopy(), swizzleOffsetXY);
|
||||
|
||||
// Create a swizzle to "ANGLEUniforms.viewport.zw".
|
||||
TVector<int> swizzleOffsetZW = {2, 3};
|
||||
TIntermSwizzle *viewportZW = new TIntermSwizzle(viewportRef, swizzleOffsetZW);
|
||||
TIntermSwizzle *viewportZW = new TIntermSwizzle(viewportRef, swizzleOffsetZW);
|
||||
|
||||
// ANGLEPosition.xy / ANGLEPosition.w
|
||||
TIntermSymbol *position = new TIntermSymbol(anglePosition);
|
||||
TIntermSwizzle *positionXY = new TIntermSwizzle(position, swizzleOffsetXY);
|
||||
TIntermSymbol *position = new TIntermSymbol(anglePosition);
|
||||
TIntermSwizzle *positionXY = new TIntermSwizzle(position, swizzleOffsetXY);
|
||||
TVector<int> swizzleOffsetW = {3};
|
||||
TIntermSwizzle *positionW = new TIntermSwizzle(position->deepCopy(), swizzleOffsetW);
|
||||
TIntermBinary *positionNDC = new TIntermBinary(EOpDiv, positionXY, positionW);
|
||||
TIntermSwizzle *positionW = new TIntermSwizzle(position->deepCopy(), swizzleOffsetW);
|
||||
TIntermBinary *positionNDC = new TIntermBinary(EOpDiv, positionXY, positionW);
|
||||
|
||||
// ANGLEPosition * 0.5
|
||||
TIntermConstantUnion *oneHalf = CreateFloatNode(0.5f);
|
||||
|
@ -584,8 +584,8 @@ ANGLE_NO_DISCARD bool AddLineSegmentRasterizationEmulation(TCompiler *compiler,
|
|||
|
||||
// Create a swizzle to "ba2.yx".
|
||||
TVector<int> swizzleOffsetYX = {1, 0};
|
||||
TIntermSymbol *ba2 = CreateTempSymbolNode(ba2Temp);
|
||||
TIntermSwizzle *ba2YX = new TIntermSwizzle(ba2, swizzleOffsetYX);
|
||||
TIntermSymbol *ba2 = CreateTempSymbolNode(ba2Temp);
|
||||
TIntermSwizzle *ba2YX = new TIntermSwizzle(ba2, swizzleOffsetYX);
|
||||
|
||||
// ba2 + ba2.yx - ba
|
||||
TIntermBinary *ba2PlusBaYX2 = new TIntermBinary(EOpAdd, ba2->deepCopy(), ba2YX);
|
||||
|
@ -598,7 +598,7 @@ ANGLE_NO_DISCARD bool AddLineSegmentRasterizationEmulation(TCompiler *compiler,
|
|||
|
||||
// Create a swizzle to "bp.x".
|
||||
TVector<int> swizzleOffsetX = {0};
|
||||
TIntermSwizzle *bpX = new TIntermSwizzle(bp, swizzleOffsetX);
|
||||
TIntermSwizzle *bpX = new TIntermSwizzle(bp, swizzleOffsetX);
|
||||
|
||||
// Using a small epsilon value ensures that we don't suffer from numerical instability when
|
||||
// lines are exactly vertical or horizontal.
|
||||
|
@ -610,7 +610,7 @@ ANGLE_NO_DISCARD bool AddLineSegmentRasterizationEmulation(TCompiler *compiler,
|
|||
|
||||
// Create a swizzle to "bp.y".
|
||||
TVector<int> swizzleOffsetY = {1};
|
||||
TIntermSwizzle *bpY = new TIntermSwizzle(bp->deepCopy(), swizzleOffsetY);
|
||||
TIntermSwizzle *bpY = new TIntermSwizzle(bp->deepCopy(), swizzleOffsetY);
|
||||
|
||||
// bp.y > epsilon
|
||||
TIntermBinary *checkY = new TIntermBinary(EOpGreaterThan, bpY, epsilon->deepCopy());
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// HLSL code for emulating GLSL builtin functions not present in HLSL.
|
||||
|
||||
#include "compiler/translator/BuiltInFunctionEmulator.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn_autogen.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn.h"
|
||||
|
||||
namespace sh
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@ template_immutablestring_cpp = """// GENERATED FILE - DO NOT EDIT.
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// ImmutableString_autogen.cpp: Wrapper for static or pool allocated char arrays, that are guaranteed to be
|
||||
// ImmutableString_{source_label}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
|
||||
|
||||
|
@ -139,7 +139,7 @@ template_immutablestringtest_cpp = """// GENERATED FILE - DO NOT EDIT.
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// ImmutableString_test_autogen.cpp:
|
||||
// ImmutableString_test_{source_label}autogen.cpp:
|
||||
// Tests for matching script-generated hashes with runtime computed hashes.
|
||||
|
||||
#include "compiler/translator/ImmutableString.h"
|
||||
|
@ -167,7 +167,7 @@ template_builtin_header = """// GENERATED FILE - DO NOT EDIT.
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// BuiltIn_autogen.h:
|
||||
// BuiltIn_{header_label}autogen.h:
|
||||
// Compile-time initialized built-ins.
|
||||
|
||||
#ifndef COMPILER_TRANSLATOR_TREEUTIL_BUILTIN_AUTOGEN_H_
|
||||
|
@ -200,7 +200,7 @@ namespace BuiltInVariable
|
|||
#endif // COMPILER_TRANSLATOR_TREEUTIL_BUILTIN_AUTOGEN_H_
|
||||
"""
|
||||
|
||||
template_symboltable_h = """// GENERATED FILE - DO NOT EDIT.
|
||||
template_symboltable_header = """// GENERATED FILE - DO NOT EDIT.
|
||||
// Generated by {script_name} using data from {variable_data_source_name} and
|
||||
// {function_data_source_name}.
|
||||
//
|
||||
|
@ -238,13 +238,13 @@ template_symboltable_cpp = """// GENERATED FILE - DO NOT EDIT.
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// SymbolTable_autogen.cpp:
|
||||
// SymbolTable_{source_label}autogen.cpp:
|
||||
// Compile-time initialized built-ins.
|
||||
|
||||
#include "compiler/translator/SymbolTable.h"
|
||||
|
||||
#include "angle_gl.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn_autogen.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn.h"
|
||||
#include "compiler/translator/ImmutableString.h"
|
||||
#include "compiler/translator/StaticType.h"
|
||||
#include "compiler/translator/Symbol.h"
|
||||
|
@ -463,7 +463,7 @@ template_parsecontext_header = """// GENERATED FILE - DO NOT EDIT.
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// ParseContext_autogen.h:
|
||||
// ParseContext_{header_label}autogen.h:
|
||||
// Helpers for built-in related checks.
|
||||
|
||||
#ifndef COMPILER_TRANSLATOR_PARSECONTEXT_AUTOGEN_H_
|
||||
|
@ -1102,7 +1102,7 @@ class HashFunction:
|
|||
return (self.G[self.f1(key)] + self.G[self.f2(key)]) % len(self.G)
|
||||
|
||||
|
||||
def get_parsed_functions(functions_txt_filename):
|
||||
def get_parsed_functions(functions_txt_filename, essl_only):
|
||||
|
||||
def parse_function_parameters(parameters):
|
||||
if parameters == '':
|
||||
|
@ -1163,7 +1163,12 @@ def get_parsed_functions(functions_txt_filename):
|
|||
'parameters': parse_function_parameters(parameters)
|
||||
}
|
||||
function_props.update(default_metadata)
|
||||
group_stack[-1]['functions'].append(function_props)
|
||||
if essl_only:
|
||||
# Skip GLSL-only functions
|
||||
if 'essl_level' in function_props:
|
||||
group_stack[-1]['functions'].append(function_props)
|
||||
else:
|
||||
group_stack[-1]['functions'].append(function_props)
|
||||
else:
|
||||
raise Exception('Unexpected function input line: ' + line)
|
||||
|
||||
|
@ -1716,7 +1721,7 @@ def process_single_variable_group(shader_type, group_name, group, builtin_id_dec
|
|||
|
||||
if essl_level != 'GLSL_BUILTINS':
|
||||
obj = '&BuiltInVariable::kVar_{name_with_suffix}'.format(**template_args)
|
||||
# TODO(clemendeng@google.com): Add GLSL level once GLSL built-in vars are added
|
||||
# TODO(http://anglebug.com/3835): Add GLSL level once GLSL built-in vars are added
|
||||
get_builtin_if_statements.add_obj(
|
||||
essl_level, 'COMMON_BUILTINS', shader_type, template_args['name'], obj,
|
||||
template_args['essl_extension'], template_args['glsl_extension'],
|
||||
|
@ -1731,7 +1736,7 @@ def process_single_variable_group(shader_type, group_name, group, builtin_id_dec
|
|||
|
||||
obj = 'mVar_{name_with_suffix}'.format(**template_args)
|
||||
|
||||
# TODO(clemendeng@google.com): Add GLSL level once GLSL built-in vars are added
|
||||
# TODO(http://anglebug.com/3835): Add GLSL level once GLSL built-in vars are added
|
||||
get_builtin_if_statements.add_obj(
|
||||
essl_level, 'COMMON_BUILTINS', shader_type, template_args['name'], obj,
|
||||
template_args['essl_extension'], template_args['glsl_extension'],
|
||||
|
@ -1765,46 +1770,10 @@ def process_variable_group(shader_type, group_name, group, builtin_id_declaratio
|
|||
variable_declarations, get_variable_definitions, script_generated_hash_tests)
|
||||
|
||||
|
||||
def main():
|
||||
random.seed(0)
|
||||
set_working_dir()
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
'--dump-intermediate-json',
|
||||
help='Dump parsed function data as a JSON file builtin_functions.json',
|
||||
action="store_true")
|
||||
parser.add_argument('auto_script_command', nargs='?', default='')
|
||||
args = parser.parse_args()
|
||||
|
||||
test_filename = '../../tests/compiler_tests/ImmutableString_test_autogen.cpp'
|
||||
variables_json_filename = 'builtin_variables.json'
|
||||
functions_txt_filename = 'builtin_function_declarations.txt'
|
||||
|
||||
# auto_script parameters.
|
||||
if args.auto_script_command != '':
|
||||
inputs = [
|
||||
functions_txt_filename,
|
||||
variables_json_filename,
|
||||
]
|
||||
outputs = [
|
||||
'ImmutableString_autogen.cpp',
|
||||
'ParseContext_autogen.h',
|
||||
'SymbolTable_autogen.cpp',
|
||||
'SymbolTable_autogen.h',
|
||||
'tree_util/BuiltIn_autogen.h',
|
||||
test_filename,
|
||||
]
|
||||
|
||||
if args.auto_script_command == 'inputs':
|
||||
print ','.join(inputs)
|
||||
elif args.auto_script_command == 'outputs':
|
||||
print ','.join(outputs)
|
||||
else:
|
||||
print('Invalid script parameters')
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def generate_files(essl_only, args, functions_txt_filename, variables_json_filename,
|
||||
immutablestring_cpp_filename, immutablestringtest_cpp_filename,
|
||||
builtin_header_filename, symboltable_cpp_filename, parsecontext_header_filename,
|
||||
symboltable_header_filename):
|
||||
# Declarations of symbol unique ids
|
||||
builtin_id_declarations = []
|
||||
|
||||
|
@ -1845,10 +1814,11 @@ def main():
|
|||
defined_function_variants = set()
|
||||
defined_parameter_names = set()
|
||||
|
||||
parsed_functions = get_parsed_functions(functions_txt_filename)
|
||||
parsed_functions = get_parsed_functions(functions_txt_filename, essl_only)
|
||||
|
||||
if args.dump_intermediate_json:
|
||||
with open('builtin_functions.json', 'w') as outfile:
|
||||
with open('builtin_functions_ESSL.json' if essl_only else 'builtin_functions.json',
|
||||
'w') as outfile:
|
||||
|
||||
def serialize_obj(obj):
|
||||
if isinstance(obj, TType):
|
||||
|
@ -1861,6 +1831,7 @@ def main():
|
|||
|
||||
parsed_variables = None
|
||||
with open(variables_json_filename) as f:
|
||||
# TODO(http://anglebug.com/3835): skip loading GLSL-only vars when they are added if essl_only
|
||||
parsed_variables = json.load(f, object_pairs_hook=OrderedDict)
|
||||
|
||||
# This script uses a perfect hash function to avoid dealing with collisions
|
||||
|
@ -1983,32 +1954,97 @@ def main():
|
|||
'unmangled_NG':
|
||||
len(unmangled_G),
|
||||
'unmangled_NS':
|
||||
len(unmangled_S1)
|
||||
len(unmangled_S1),
|
||||
'header_label':
|
||||
'ESSL_' if essl_only else 'complete_',
|
||||
'source_label':
|
||||
'ESSL_' if essl_only else ''
|
||||
}
|
||||
|
||||
with open('ImmutableString_autogen.cpp', 'wt') as outfile_cpp:
|
||||
with open(immutablestring_cpp_filename, 'wt') as outfile_cpp:
|
||||
output_cpp = template_immutablestring_cpp.format(**output_strings)
|
||||
outfile_cpp.write(output_cpp)
|
||||
|
||||
with open(test_filename, 'wt') as outfile_cpp:
|
||||
with open(immutablestringtest_cpp_filename, 'wt') as outfile_cpp:
|
||||
output_cpp = template_immutablestringtest_cpp.format(**output_strings)
|
||||
outfile_cpp.write(output_cpp)
|
||||
|
||||
with open('tree_util/BuiltIn_autogen.h', 'wt') as outfile_header:
|
||||
with open(builtin_header_filename, 'wt') as outfile_header:
|
||||
output_header = template_builtin_header.format(**output_strings)
|
||||
outfile_header.write(output_header)
|
||||
|
||||
with open('SymbolTable_autogen.cpp', 'wt') as outfile_cpp:
|
||||
with open(symboltable_cpp_filename, 'wt') as outfile_cpp:
|
||||
output_cpp = template_symboltable_cpp.format(**output_strings)
|
||||
outfile_cpp.write(output_cpp)
|
||||
|
||||
with open('ParseContext_autogen.h', 'wt') as outfile_header:
|
||||
with open(parsecontext_header_filename, 'wt') as outfile_header:
|
||||
output_header = template_parsecontext_header.format(**output_strings)
|
||||
outfile_header.write(output_header)
|
||||
|
||||
with open('SymbolTable_autogen.h', 'wt') as outfile_h:
|
||||
output_h = template_symboltable_h.format(**output_strings)
|
||||
outfile_h.write(output_h)
|
||||
if not essl_only:
|
||||
with open(symboltable_header_filename, 'wt') as outfile_h:
|
||||
output_h = template_symboltable_header.format(**output_strings)
|
||||
outfile_h.write(output_h)
|
||||
|
||||
|
||||
def main():
|
||||
random.seed(0)
|
||||
set_working_dir()
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
'--dump-intermediate-json',
|
||||
help='Dump parsed function data as a JSON file builtin_functions.json',
|
||||
action="store_true")
|
||||
parser.add_argument('auto_script_command', nargs='?', default='')
|
||||
args = parser.parse_args()
|
||||
|
||||
test_filename = '../../tests/compiler_tests/ImmutableString_test_autogen.cpp'
|
||||
essl_test_filename = '../../tests/compiler_tests/ImmutableString_test_ESSL_autogen.cpp'
|
||||
variables_json_filename = 'builtin_variables.json'
|
||||
functions_txt_filename = 'builtin_function_declarations.txt'
|
||||
|
||||
# auto_script parameters.
|
||||
if args.auto_script_command != '':
|
||||
inputs = [
|
||||
functions_txt_filename,
|
||||
variables_json_filename,
|
||||
]
|
||||
outputs = [
|
||||
'ImmutableString_autogen.cpp',
|
||||
'ParseContext_complete_autogen.h',
|
||||
'SymbolTable_autogen.cpp',
|
||||
'SymbolTable_autogen.h',
|
||||
'tree_util/BuiltIn_complete_autogen.h',
|
||||
test_filename,
|
||||
'ImmutableString_ESSL_autogen.cpp',
|
||||
'ParseContext_ESSL_autogen.h',
|
||||
'SymbolTable_ESSL_autogen.cpp',
|
||||
'tree_util/BuiltIn_ESSL_autogen.h',
|
||||
essl_test_filename,
|
||||
]
|
||||
|
||||
if args.auto_script_command == 'inputs':
|
||||
print ','.join(inputs)
|
||||
elif args.auto_script_command == 'outputs':
|
||||
print ','.join(outputs)
|
||||
else:
|
||||
print('Invalid script parameters')
|
||||
return 1
|
||||
return 0
|
||||
|
||||
# Generate files based on GLSL + ESSL symbols
|
||||
generate_files(False, args, functions_txt_filename, variables_json_filename,
|
||||
'ImmutableString_autogen.cpp', test_filename,
|
||||
'tree_util/BuiltIn_complete_autogen.h', 'SymbolTable_autogen.cpp',
|
||||
'ParseContext_complete_autogen.h', 'SymbolTable_autogen.h')
|
||||
|
||||
# Generate files based on only ESSL symbols
|
||||
# Symbol table with GLSL + ESSL symbols is too large for Android
|
||||
generate_files(True, args, functions_txt_filename, variables_json_filename,
|
||||
'ImmutableString_ESSL_autogen.cpp', essl_test_filename,
|
||||
'tree_util/BuiltIn_ESSL_autogen.h', 'SymbolTable_ESSL_autogen.cpp',
|
||||
'ParseContext_ESSL_autogen.h', 'SymbolTable_autogen.h')
|
||||
|
||||
return 0
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ template_emulated_builtin_functions_hlsl = """// GENERATED FILE - DO NOT EDIT.
|
|||
// HLSL code for emulating GLSL builtin functions not present in HLSL.
|
||||
|
||||
#include "compiler/translator/BuiltInFunctionEmulator.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn_autogen.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn.h"
|
||||
|
||||
namespace sh
|
||||
{{
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include "compiler/translator/ImmutableString.h"
|
||||
#include "compiler/translator/SymbolTable.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn_autogen.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn.h"
|
||||
#include "compiler/translator/tree_util/FindSymbolNode.h"
|
||||
#include "compiler/translator/tree_util/IntermNode_util.h"
|
||||
#include "compiler/translator/tree_util/RunAtTheEndOfShader.h"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "compiler/translator/tree_ops/ClampPointSize.h"
|
||||
|
||||
#include "compiler/translator/SymbolTable.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn_autogen.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn.h"
|
||||
#include "compiler/translator/tree_util/FindSymbolNode.h"
|
||||
#include "compiler/translator/tree_util/IntermNode_util.h"
|
||||
#include "compiler/translator/tree_util/RunAtTheEndOfShader.h"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "compiler/translator/StaticType.h"
|
||||
#include "compiler/translator/SymbolTable.h"
|
||||
#include "compiler/translator/tree_ops/InitializeVariables.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn_autogen.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn.h"
|
||||
#include "compiler/translator/tree_util/FindMain.h"
|
||||
#include "compiler/translator/tree_util/IntermNode_util.h"
|
||||
#include "compiler/translator/tree_util/IntermTraverse.h"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "compiler/translator/StaticType.h"
|
||||
#include "compiler/translator/Symbol.h"
|
||||
#include "compiler/translator/SymbolTable.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn_autogen.h"
|
||||
#include "compiler/translator/tree_util/BuiltIn.h"
|
||||
#include "compiler/translator/tree_util/IntermTraverse.h"
|
||||
#include "compiler/translator/tree_util/ReplaceVariable.h"
|
||||
#include "compiler/translator/util.h"
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// BuiltIn.h:
|
||||
// Chooses BuiltIn_complete_autogen.h or BuiltIn_ESSL_autogen.h
|
||||
// depending on whether platform is android
|
||||
|
||||
#ifndef COMPILER_TRANSLATOR_TREEUTIL_BUILTIN_H_
|
||||
#define COMPILER_TRANSLATOR_TREEUTIL_BUILTIN_H_
|
||||
|
||||
#if defined(ANDROID)
|
||||
# include "BuiltIn_ESSL_autogen.h"
|
||||
#else
|
||||
# include "BuiltIn_complete_autogen.h"
|
||||
#endif
|
||||
|
||||
#endif // COMPILER_TRANSLATOR_TREEUTIL_BUILTIN_H_
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -6,7 +6,7 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// BuiltIn_autogen.h:
|
||||
// BuiltIn_complete_autogen.h:
|
||||
// Compile-time initialized built-ins.
|
||||
|
||||
#ifndef COMPILER_TRANSLATOR_TREEUTIL_BUILTIN_AUTOGEN_H_
|
|
@ -63,7 +63,7 @@ TIntermSymbol *ReferenceGlobalVariable(const ImmutableString &name,
|
|||
const TSymbolTable &symbolTable);
|
||||
|
||||
// Note: this can't access desktop GLSL built-ins. Those can only be accessed directly through
|
||||
// BuiltIn_autogen.h.
|
||||
// BuiltIn.h.
|
||||
TIntermSymbol *ReferenceBuiltInVariable(const ImmutableString &name,
|
||||
const TSymbolTable &symbolTable,
|
||||
int shaderVersion);
|
||||
|
|
|
@ -72,7 +72,6 @@ angle_unittests_sources = [
|
|||
"../tests/compiler_tests/GlFragDataNotModified_test.cpp",
|
||||
"../tests/compiler_tests/GeometryShader_test.cpp",
|
||||
"../tests/compiler_tests/ImmutableString_test.cpp",
|
||||
"../tests/compiler_tests/ImmutableString_test_autogen.cpp",
|
||||
"../tests/compiler_tests/InitOutputVariables_test.cpp",
|
||||
"../tests/compiler_tests/IntermNode_test.cpp",
|
||||
"../tests/compiler_tests/NV_draw_buffers_test.cpp",
|
||||
|
@ -143,3 +142,11 @@ angle_unittests_helper_sources = [
|
|||
"../common/system_utils_unittest_helper.cpp",
|
||||
"../common/system_utils_unittest_helper.h",
|
||||
]
|
||||
|
||||
if (is_android) {
|
||||
angle_unittests_sources +=
|
||||
[ "../tests/compiler_tests/ImmutableString_test_ESSL_autogen.cpp" ]
|
||||
} else {
|
||||
angle_unittests_sources +=
|
||||
[ "../tests/compiler_tests/ImmutableString_test_autogen.cpp" ]
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// GENERATED FILE - DO NOT EDIT.
|
||||
// Generated by gen_builtin_symbols_essl_only.py using data from builtin_function_declarations.txt.
|
||||
// Generated by gen_builtin_symbols.py using data from builtin_function_declarations.txt.
|
||||
//
|
||||
// Copyright 2019 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_test_autogen.cpp:
|
||||
// ImmutableString_test_ESSL_autogen.cpp:
|
||||
// Tests for matching script-generated hashes with runtime computed hashes.
|
||||
|
||||
#include "compiler/translator/ImmutableString.h"
|
||||
|
|
Загрузка…
Ссылка в новой задаче