Statically allocate built-in function symbols
A script gen_builtin_symbols.py now generates code for initializing
built-in function symbols. The TFunction objects are initialized at
C++ compile time.
The source file used for the functions is in a format that's similar
to how functions are given out in the GLSL spec, so it is easy to
maintain.
The function symbols are still inserted to the symbol table levels
same as before. Getting rid of inserting the symbols at runtime is
intended to be done as follow-up.
This speeds up angle_unittests on Linux in release mode by a bit less
than half, and in debug mode by more than half.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I11c9de98c74d28e7e8cdf024516e2f6ee30ca33e
Reviewed-on: https://chromium-review.googlesource.com/924155
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/scripts/run_code_generation.py b/scripts/run_code_generation.py
index ac7887b..2ea66ce 100755
--- a/scripts/run_code_generation.py
+++ b/scripts/run_code_generation.py
@@ -147,6 +147,15 @@
],
'script': 'src/libANGLE/renderer/vulkan/gen_vk_mandatory_format_support_table.py',
},
+ 'ESSL static builtins': {
+ 'inputs': [
+ 'src/compiler/translator/builtin_function_declarations.txt',
+ ],
+ 'outputs': [
+ 'src/compiler/translator/SymbolTable_autogen.cpp',
+ ],
+ 'script': 'src/compiler/translator/gen_builtin_symbols.py',
+ },
}
root_dir = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))