Translator: Remove GLSL rules from the ESSL-only symbol table

Shaves ~36KB off of ANGLE's binary size on Android.

Bug: chromium:1084580
Change-Id: I4711c6bd28437a43b7dc63be4cfcdaed7ae11ba2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3052686
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
Shahbaz Youssefi 2021-07-26 01:02:11 -04:00 коммит произвёл Angle LUCI CQ
Родитель 63fa70809c
Коммит acfd63a4cc
5 изменённых файлов: 2638 добавлений и 3592 удалений

Просмотреть файл

@ -6,9 +6,9 @@
"src/compiler/translator/Operator_autogen.h": "src/compiler/translator/Operator_autogen.h":
"340c7966d65f4f46858cc228e103cd86", "340c7966d65f4f46858cc228e103cd86",
"src/compiler/translator/SymbolTable_ESSL_autogen.cpp": "src/compiler/translator/SymbolTable_ESSL_autogen.cpp":
"1deb234886356c7d5e95a4e4f41b0972", "b247c30ea9977437456ad5df90177a1d",
"src/compiler/translator/SymbolTable_autogen.cpp": "src/compiler/translator/SymbolTable_autogen.cpp":
"e2ec1e914789ee68fff7c2773a0e513b", "12e50c9441a6d6180d261cd751f4c8c5",
"src/compiler/translator/SymbolTable_autogen.h": "src/compiler/translator/SymbolTable_autogen.h":
"d43593050c4d1b31b0be9cdd3a2d0ea5", "d43593050c4d1b31b0be9cdd3a2d0ea5",
"src/compiler/translator/builtin_function_declarations.txt": "src/compiler/translator/builtin_function_declarations.txt":
@ -16,7 +16,7 @@
"src/compiler/translator/builtin_variables.json": "src/compiler/translator/builtin_variables.json":
"1fc6aefb15d2bae17cd20bf4fc2a7702", "1fc6aefb15d2bae17cd20bf4fc2a7702",
"src/compiler/translator/gen_builtin_symbols.py": "src/compiler/translator/gen_builtin_symbols.py":
"abdd4a38b43a7306862a2cc6d2b8e9d9", "e77c4c743c26d8515661a9d9c4d3c96b",
"src/compiler/translator/tree_util/BuiltIn_ESSL_autogen.h": "src/compiler/translator/tree_util/BuiltIn_ESSL_autogen.h":
"8c556b91d261b6002d9569bd68323b15", "8c556b91d261b6002d9569bd68323b15",
"src/compiler/translator/tree_util/BuiltIn_complete_autogen.h": "src/compiler/translator/tree_util/BuiltIn_complete_autogen.h":

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -855,7 +855,7 @@ class GroupedList:
def get_offsets(self): def get_offsets(self):
return self.offsets return self.offsets
def update_arrays(self): def update_arrays(self, essl_only):
def add_rule(rules, spec, level, shaders, extension, symbol): def add_rule(rules, spec, level, shaders, extension, symbol):
var = ("&TableBase::%s" % symbol) if symbol.startswith("m_gl") else None var = ("&TableBase::%s" % symbol) if symbol.startswith("m_gl") else None
@ -897,7 +897,7 @@ class GroupedList:
add_rule(rules, "ESSL", data['essl_level'], data['shader_type'], None, add_rule(rules, "ESSL", data['essl_level'], data['shader_type'], None,
data["symbol"]) data["symbol"])
if "symbol" in data and "glsl_level" in data: if "symbol" in data and "glsl_level" in data and not essl_only:
add_rule(rules, "GLSL", data['glsl_level'], data['shader_type'], None, add_rule(rules, "GLSL", data['glsl_level'], data['shader_type'], None,
data["symbol"]) data["symbol"])
@ -905,7 +905,7 @@ class GroupedList:
add_rule(rules, "ESSL", data['essl_level2'], data['shader_type2'], None, add_rule(rules, "ESSL", data['essl_level2'], data['shader_type2'], None,
data["symbol2"]) data["symbol2"])
if "symbol2" in data and "glsl_level2" in data: if "symbol2" in data and "glsl_level2" in data and not essl_only:
add_rule(rules, "GLSL", data['glsl_level2'], data['shader_type2'], None, add_rule(rules, "GLSL", data['glsl_level2'], data['shader_type2'], None,
data["symbol2"]) data["symbol2"])
@ -913,7 +913,7 @@ class GroupedList:
add_rule(rules, "ESSL", data['essl_level3'], data['shader_type3'], None, add_rule(rules, "ESSL", data['essl_level3'], data['shader_type3'], None,
data["symbol3"]) data["symbol3"])
if "symbol3" in data and "glsl_level3" in data: if "symbol3" in data and "glsl_level3" in data and not essl_only:
add_rule(rules, "GLSL", data['glsl_level3'], data['shader_type3'], None, add_rule(rules, "GLSL", data['glsl_level3'], data['shader_type3'], None,
data["symbol3"]) data["symbol3"])
@ -921,7 +921,7 @@ class GroupedList:
add_rule(rules, "ESSL", data['essl_level4'], data['shader_type4'], None, add_rule(rules, "ESSL", data['essl_level4'], data['shader_type4'], None,
data["symbol4"]) data["symbol4"])
if "symbol4" in data and "glsl_level4" in data: if "symbol4" in data and "glsl_level4" in data and not essl_only:
add_rule(rules, "GLSL", data['glsl_level4'], data['shader_type4'], None, add_rule(rules, "GLSL", data['glsl_level4'], data['shader_type4'], None,
data["symbol4"]) data["symbol4"])
@ -929,7 +929,7 @@ class GroupedList:
add_rule(rules, "ESSL", data["essl_ext_level"], data["essl_ext_shader_type"], add_rule(rules, "ESSL", data["essl_ext_level"], data["essl_ext_shader_type"],
data["essl_extension"], data["essl_ext_symbol"]) data["essl_extension"], data["essl_ext_symbol"])
if "glsl_ext_symbol" in data: if "glsl_ext_symbol" in data and not essl_only:
add_rule(rules, "GLSL", data["glsl_ext_level"], data["glsl_ext_shader_type"], add_rule(rules, "GLSL", data["glsl_ext_level"], data["glsl_ext_shader_type"],
data["glsl_extension"], data["glsl_ext_symbol"]) data["glsl_extension"], data["glsl_ext_symbol"])
@ -2119,7 +2119,7 @@ def generate_files(essl_only, args, functions_txt_filename, variables_json_filen
for group_name, group in parsed_variables.items(): for group_name, group in parsed_variables.items():
process_variable_group('NONE', group_name, group, symbols, variables, mangled_builtins) process_variable_group('NONE', group_name, group, symbols, variables, mangled_builtins)
mangled_builtins.update_arrays() mangled_builtins.update_arrays(essl_only)
output_strings = { output_strings = {
'script_name': 'script_name':

Просмотреть файл

@ -227,6 +227,9 @@ TEST_F(ShCompileTest, DecimalSepLocale)
} }
} }
// Desktop GLSL support is not enabled on Android
#if !defined(ANGLE_PLATFORM_ANDROID)
// For testing Desktop GL Shaders // For testing Desktop GL Shaders
class ShCompileDesktopGLTest : public ShCompileTest class ShCompileDesktopGLTest : public ShCompileTest
{ {
@ -364,3 +367,5 @@ TEST_F(ShCompileDesktopGLTest, ImplicitConversionFunction)
testCompile(shaderStrings, 1, true); testCompile(shaderStrings, 1, true);
} }
#endif // !defined(ANGLE_PLATFORM_ANDROID)