Commit 7e990ef4 by Jamie Madill Committed by Commit Bot

Clean ups to generate_entry_points.

Switches to Python 3 support. Made a change to run_code_generation to support this. Affects several generators. Also updates the generator to make a few other small cleanups. Bug: angleproject:5653 Change-Id: I045173c9ca85947c4eac22285701032c09f4c8d0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2699187 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 51c5137a
{ {
"scripts/gen_vk_gl_cts_build.py": "scripts/gen_vk_gl_cts_build.py":
"51d73f5dda6cd0afac2b241bf95805dd", "f634925ccbb1bd66a42b051b5e19a832",
"src/tests/deqp_support/BUILD.gn": "src/tests/deqp_support/BUILD.gn":
"860cc9b728dc35454b0d527651cc47de", "860cc9b728dc35454b0d527651cc47de",
"src/tests/deqp_support/deqp_data_autogen.gni": "src/tests/deqp_support/deqp_data_autogen.gni":
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
"scripts/egl_angle_ext.xml": "scripts/egl_angle_ext.xml":
"5bcc01462b355d933cf3ada15198fb68", "5bcc01462b355d933cf3ada15198fb68",
"scripts/generate_loader.py": "scripts/generate_loader.py":
"407b69ec2eaddef2af55fbbca4b8d684", "04e2173ddae9cb885f32edee8fbdb966",
"scripts/gl.xml": "scripts/gl.xml":
"f66967f3f3d696b5d8306fd80bbd49a8", "f66967f3f3d696b5d8306fd80bbd49a8",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d", "0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"cec95eb2eebe1e74da800ea7678cae14", "c85875a215dcf74e2ed363684f18c26c",
"scripts/wgl.xml": "scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db", "c36001431919e1c435f1215a85f7e1db",
"src/libEGL/egl_loader_autogen.cpp": "src/libEGL/egl_loader_autogen.cpp":
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"4f7b43863a5e61991bba4010db463679", "4f7b43863a5e61991bba4010db463679",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
"ce3d9b9e53142d7da8fcf85073157d53", "195ba6eaeb6dcf6596720976f73755a5",
"scripts/gl.xml": "scripts/gl.xml":
"f66967f3f3d696b5d8306fd80bbd49a8", "f66967f3f3d696b5d8306fd80bbd49a8",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d", "0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"cec95eb2eebe1e74da800ea7678cae14", "c85875a215dcf74e2ed363684f18c26c",
"scripts/wgl.xml": "scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db", "c36001431919e1c435f1215a85f7e1db",
"src/common/entry_points_enum_autogen.cpp": "src/common/entry_points_enum_autogen.cpp":
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
"src/libANGLE/Context_gles_3_2_autogen.h": "src/libANGLE/Context_gles_3_2_autogen.h":
"48567dca16fd881dfe6d61fee0e3106f", "48567dca16fd881dfe6d61fee0e3106f",
"src/libANGLE/Context_gles_ext_autogen.h": "src/libANGLE/Context_gles_ext_autogen.h":
"300f7b2c136df50e3409276d34f1a4b3", "d6b07fcd1713e3eddf6156e9cf477ec9",
"src/libANGLE/capture/capture_gles_1_0_autogen.cpp": "src/libANGLE/capture/capture_gles_1_0_autogen.cpp":
"7ec7ef8f779b809a45d74b97502c419b", "7ec7ef8f779b809a45d74b97502c419b",
"src/libANGLE/capture/capture_gles_1_0_autogen.h": "src/libANGLE/capture/capture_gles_1_0_autogen.h":
......
{ {
"scripts/gen_gl_enum_utils.py": "scripts/gen_gl_enum_utils.py":
"0874af093409ee1de1ed8ab5ed7e3d2e", "eb1c6edbf709e4d93025c42054bbb0be",
"scripts/gl.xml": "scripts/gl.xml":
"f66967f3f3d696b5d8306fd80bbd49a8", "f66967f3f3d696b5d8306fd80bbd49a8",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d", "0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"cec95eb2eebe1e74da800ea7678cae14", "c85875a215dcf74e2ed363684f18c26c",
"src/libANGLE/capture/gl_enum_utils_autogen.cpp": "src/libANGLE/capture/gl_enum_utils_autogen.cpp":
"ab1a59ecc7d292db6cc2840280f86a59", "ab1a59ecc7d292db6cc2840280f86a59",
"src/libANGLE/capture/gl_enum_utils_autogen.h": "src/libANGLE/capture/gl_enum_utils_autogen.h":
......
{ {
"src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py": "src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py":
"c3ac018b3dcf98ab8b31a93ebe91f7be", "e5078d45eab00d6fcf5b2abfe4b2a099",
"src/libANGLE/renderer/vulkan/shaders/gen/BlitResolve.frag.00000000.inc": "src/libANGLE/renderer/vulkan/shaders/gen/BlitResolve.frag.00000000.inc":
"84c08f27df06e8db012f98cbed188be5", "84c08f27df06e8db012f98cbed188be5",
"src/libANGLE/renderer/vulkan/shaders/gen/BlitResolve.frag.00000001.inc": "src/libANGLE/renderer/vulkan/shaders/gen/BlitResolve.frag.00000001.inc":
...@@ -212,55 +212,55 @@ ...@@ -212,55 +212,55 @@
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000000.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000000.inc":
"661d2bca29e5a0e9cd81ae25b9666654", "661d2bca29e5a0e9cd81ae25b9666654",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000001.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000001.inc":
"ef877e4172e985a741a86ae1aa067b3d", "c7750f1e1431686dff1870204c45c8f0",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000002.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000002.inc":
"4645a0d812bc8e891f94b5282338a4fd", "ed3f7cab24c639a0b37f0fa305abdb8a",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000004.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000004.inc":
"e7692cf2a0d6d24ab71b7c193b4e9d24", "e7692cf2a0d6d24ab71b7c193b4e9d24",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000005.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000005.inc":
"a20ff55fbbada579679922ddd805050a", "710d2756b9cca5c6c3e16bcaf7badbb7",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000006.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000006.inc":
"03936ea0139b1d9a55c0b9b4d702ff4a", "64f419cd22ac2ae037ace162f1b9b13b",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000008.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000008.inc":
"6243151810556635ebefc4dfae2a5ccd", "6243151810556635ebefc4dfae2a5ccd",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000009.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000009.inc":
"4009e1d436fa34784782b7c476d56e6a", "5f890e608a06e1d14a9c8b33fe5b747d",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.0000000A.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.0000000A.inc":
"df463def9161379ed1f5f83f24b39e6b", "a44c6bbd58909c6e5b136bebeb477e55",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000010.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000010.inc":
"4d584faed9fd4cf7e2054e483cda30d9", "7f6d94b503626ccf1eff1f53d42ac380",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000011.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000011.inc":
"ab78d37472e5b59bfb201e0f06454d30", "ab78d37472e5b59bfb201e0f06454d30",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000012.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000012.inc":
"f7d4d4f8975401c571421bb361bcffc9", "9edfa51d2b0e31a571639eb34ab02649",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000014.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000014.inc":
"968aa31277095494511bba01ddcfe317", "07d3f2a9a6da8903caccf05a91a2f321",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000015.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000015.inc":
"32134da22061e57d6251831c85d3a9e5", "32134da22061e57d6251831c85d3a9e5",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000016.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000016.inc":
"f063048b35a99028375e95960a897db0", "4ea672de036cd0a0ae8e2bd0b45529ed",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000018.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000018.inc":
"45c46c3fe7ab7eb0be1e9f7aca21ae82", "8b0386b4ab41122a35f0f95cff682156",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000019.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000019.inc":
"b5da66fccb0478345a2683be9c571c58", "b5da66fccb0478345a2683be9c571c58",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.0000001A.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.0000001A.inc":
"a1d36eb7134bb723b8a5c864e0e35fe5", "c1aee99f510457512ed1ef0a845408c1",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000020.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000020.inc":
"50bc42b7a831081fa766e89683f7e3fe", "3e8917bbde7181be81b5a0c7cc322c36",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000021.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000021.inc":
"bdb4f8ead266749a50d7f8df50c26b74", "a3abb49f8f21656285e3f8de1a5a659d",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000022.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000022.inc":
"0517dcabde65b6b667e39c3f3b296c03", "0517dcabde65b6b667e39c3f3b296c03",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000024.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000024.inc":
"35049dad28558aa59f09250704f07abd", "62abf2e3feb55b7594c8ee783c2aefea",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000025.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000025.inc":
"6330387b7b25a14ed97939d5a08ce319", "fdff32adf2b047685207d439cd4aa241",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000026.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000026.inc":
"1af610f1e7eba4646c0b321f9ac746b6", "1af610f1e7eba4646c0b321f9ac746b6",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000028.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000028.inc":
"8fb2f7c5776023bf2225b11ea3b9a548", "b3bdac3bf2ec050b6a07d8ad12c26992",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000029.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000029.inc":
"ddf0ac9e36d34aa089caa924c353f29b", "1a45cc4ada2adb18eb39078ffd12efc5",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.0000002A.inc": "src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.0000002A.inc":
"0d31cc06739b23006828893a5a95c12a", "0d31cc06739b23006828893a5a95c12a",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000000.inc": "src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000000.inc":
...@@ -328,7 +328,7 @@ ...@@ -328,7 +328,7 @@
"src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp": "src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp":
"9f38e56baeb597e87a814e1140bb59f6", "9f38e56baeb597e87a814e1140bb59f6",
"src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h": "src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h":
"14742d05dd0aff523ad51c215b1144d7", "6ae7a2ff0433c5ba52b3d33b4da696fa",
"tools/glslang/glslang_validator.exe.sha1": "tools/glslang/glslang_validator.exe.sha1":
"17e862cc6f462fecbf50b24ed6544a27", "17e862cc6f462fecbf50b24ed6544a27",
"tools/glslang/glslang_validator.sha1": "tools/glslang/glslang_validator.sha1":
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"src/libANGLE/renderer/angle_format.py": "src/libANGLE/renderer/angle_format.py":
"32ba71942c0fd00e6807104f1bb80a3c", "32ba71942c0fd00e6807104f1bb80a3c",
"src/libANGLE/renderer/vulkan/gen_vk_mandatory_format_support_table.py": "src/libANGLE/renderer/vulkan/gen_vk_mandatory_format_support_table.py":
"0d798546ff1b4932164a64b9404396bb", "3e2b8cd80373275e862bb7c8ba20a745",
"src/libANGLE/renderer/vulkan/vk_format_map.json": "src/libANGLE/renderer/vulkan/vk_format_map.json":
"d7bb44b9fa6f6e4038c2a415fe1711a1", "d7bb44b9fa6f6e4038c2a415fe1711a1",
"src/libANGLE/renderer/vulkan/vk_mandatory_format_support_data.json": "src/libANGLE/renderer/vulkan/vk_mandatory_format_support_data.json":
......
{ {
"src/libANGLE/Overlay_font_autogen.cpp": "src/libANGLE/Overlay_font_autogen.cpp":
"ff9bf191978e8c9cff6de3e31f3664f2", "7eb7c021a7e93bbc9fb95b838718f175",
"src/libANGLE/Overlay_font_autogen.h": "src/libANGLE/Overlay_font_autogen.h":
"2eae247cebb716c4f591de8a251b4a8e", "00ad15958345b833bfa001bde96f4d4e",
"src/libANGLE/gen_overlay_fonts.py": "src/libANGLE/gen_overlay_fonts.py":
"0f218173d179248f6f16f9be7c9d9ec3" "0f218173d179248f6f16f9be7c9d9ec3"
} }
\ No newline at end of file
{ {
"src/libANGLE/Overlay_autogen.cpp": "src/libANGLE/Overlay_autogen.cpp":
"849f447a220cb0ce00a41f99db179a6b", "e7748db7bd86a4aa9e87a8ea7af07390",
"src/libANGLE/Overlay_autogen.h": "src/libANGLE/Overlay_autogen.h":
"4f29dd0e9c2030b98b396fdf03eaeb29", "cedb9e7ea45b8ffb30718b7e04ee0ead",
"src/libANGLE/gen_overlay_widgets.py": "src/libANGLE/gen_overlay_widgets.py":
"f4395481db010c82af2e2981353e8592", "f4395481db010c82af2e2981353e8592",
"src/libANGLE/overlay_widgets.json": "src/libANGLE/overlay_widgets.json":
......
{ {
"src/common/PackedEGLEnums_autogen.cpp": "src/common/PackedEGLEnums_autogen.cpp":
"753fb10ca255cac022558379a82d0236", "b081332c2e0f8ace0277d18f1bc773d8",
"src/common/PackedEGLEnums_autogen.h": "src/common/PackedEGLEnums_autogen.h":
"085d82d2003f02345abc4986523127d4", "51f71a1fb276fc5556a0074e682f3f17",
"src/common/PackedGLEnums_autogen.cpp": "src/common/PackedGLEnums_autogen.cpp":
"d466b72e054f7a4b15dc033b0a10d3a0", "bd8065284b09626f7b9b36b9b9a60fd5",
"src/common/PackedGLEnums_autogen.h": "src/common/PackedGLEnums_autogen.h":
"432cef0647efc392813438f486991f1f", "52c2996dd7f059ae0292dc117d60c35c",
"src/common/gen_packed_gl_enums.py": "src/common/gen_packed_gl_enums.py":
"b3e96ea44f52ec23ee893bd843dfd2cb", "51b94d352fb90b11d69872b83abd5e86",
"src/common/packed_egl_enums.json": "src/common/packed_egl_enums.json":
"76e1b814421e121164d60a0d89cb16c1", "76e1b814421e121164d60a0d89cb16c1",
"src/common/packed_gl_enums.json": "src/common/packed_gl_enums.json":
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
"scripts/egl_angle_ext.xml": "scripts/egl_angle_ext.xml":
"5bcc01462b355d933cf3ada15198fb68", "5bcc01462b355d933cf3ada15198fb68",
"scripts/gen_proc_table.py": "scripts/gen_proc_table.py":
"812d52162301bef358b2d8d38265c375", "ce255f78eeaf4b82662729b775a9514d",
"scripts/gl.xml": "scripts/gl.xml":
"f66967f3f3d696b5d8306fd80bbd49a8", "f66967f3f3d696b5d8306fd80bbd49a8",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d", "0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"cec95eb2eebe1e74da800ea7678cae14", "c85875a215dcf74e2ed363684f18c26c",
"scripts/wgl.xml": "scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db", "c36001431919e1c435f1215a85f7e1db",
"src/libGL/proc_table_wgl_autogen.cpp": "src/libGL/proc_table_wgl_autogen.cpp":
......
#!/usr/bin/python #!/usr/bin/python3
# #
# Copyright 2019 The ANGLE Project Authors. All rights reserved. # Copyright 2019 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
...@@ -98,9 +98,8 @@ exclude_gl_enum_groups = {'SpecialNumbers'} ...@@ -98,9 +98,8 @@ exclude_gl_enum_groups = {'SpecialNumbers'}
def dump_value_to_string_mapping(gl_enum_in_groups, exporting_enums): def dump_value_to_string_mapping(gl_enum_in_groups, exporting_enums):
exporting_groups = list() exporting_groups = list()
for group_name, inner_mapping in gl_enum_in_groups.iteritems(): for group_name, inner_mapping in gl_enum_in_groups.items():
string_value_pairs = list( string_value_pairs = list(filter(lambda x: x[0] in exporting_enums, inner_mapping.items()))
filter(lambda x: x[0] in exporting_enums, inner_mapping.iteritems()))
if not string_value_pairs: if not string_value_pairs:
continue continue
...@@ -191,7 +190,7 @@ def main(header_output_path, source_output_path): ...@@ -191,7 +190,7 @@ def main(header_output_path, source_output_path):
script_name=os.path.basename(sys.argv[0]), script_name=os.path.basename(sys.argv[0]),
data_source_name="gl.xml and gl_angle_ext.xml", data_source_name="gl.xml and gl_angle_ext.xml",
year=date.today().year, year=date.today().year,
gl_enum_groups=',\n'.join(sorted(gl_enum_in_groups.iterkeys()))) gl_enum_groups=',\n'.join(sorted(gl_enum_in_groups.keys())))
header_output_path = registry_xml.script_relative(header_output_path) header_output_path = registry_xml.script_relative(header_output_path)
with open(header_output_path, 'w') as f: with open(header_output_path, 'w') as f:
...@@ -229,9 +228,9 @@ if __name__ == '__main__': ...@@ -229,9 +228,9 @@ if __name__ == '__main__':
if len(sys.argv) > 1: if len(sys.argv) > 1:
if sys.argv[1] == 'inputs': if sys.argv[1] == 'inputs':
print ','.join(inputs) print(','.join(inputs))
elif sys.argv[1] == 'outputs': elif sys.argv[1] == 'outputs':
print ','.join(outputs) print(','.join(outputs))
else: else:
sys.exit( sys.exit(
main( main(
......
#!python #!/usr/bin/python3
# Copyright 2017 The ANGLE Project Authors. All rights reserved. # Copyright 2017 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -83,9 +83,9 @@ def main(): ...@@ -83,9 +83,9 @@ def main():
inputs = [source for source in registry_xml.xml_inputs] inputs = [source for source in registry_xml.xml_inputs]
outputs = [out_file_name_gles, out_file_name_gl] outputs = [out_file_name_gles, out_file_name_gl]
if sys.argv[1] == 'inputs': if sys.argv[1] == 'inputs':
print ','.join(inputs) print(','.join(inputs))
elif sys.argv[1] == 'outputs': elif sys.argv[1] == 'outputs':
print ','.join(outputs) print(','.join(outputs))
else: else:
print('Invalid script parameters') print('Invalid script parameters')
return 1 return 1
...@@ -104,7 +104,7 @@ def main(): ...@@ -104,7 +104,7 @@ def main():
# Also don't add GLES extension commands to libGL proc table # Also don't add GLES extension commands to libGL proc table
extension_commands = [] extension_commands = []
for extension_name, ext_cmd_names in sorted(glesxml.ext_data.iteritems()): for extension_name, ext_cmd_names in sorted(glesxml.ext_data.items()):
extension_commands.extend(glesxml.ext_data[extension_name]) extension_commands.extend(glesxml.ext_data[extension_name])
for name in extension_commands: for name in extension_commands:
name_no_suffix = name name_no_suffix = name
...@@ -142,7 +142,7 @@ def main(): ...@@ -142,7 +142,7 @@ def main():
all_functions[function] = function all_functions[function] = function
proc_data = [(' {"%s", P(%s)}' % (func, angle_func)) proc_data = [(' {"%s", P(%s)}' % (func, angle_func))
for func, angle_func in sorted(all_functions.iteritems())] for func, angle_func in sorted(all_functions.items())]
with open(out_file_name_gles, 'w') as out_file: with open(out_file_name_gles, 'w') as out_file:
output_cpp = template_cpp.format( output_cpp = template_cpp.format(
...@@ -186,7 +186,7 @@ def main(): ...@@ -186,7 +186,7 @@ def main():
all_functions[function] = function all_functions[function] = function
proc_data = [(' {"%s", P(%s)}' % (func, angle_func)) proc_data = [(' {"%s", P(%s)}' % (func, angle_func))
for func, angle_func in sorted(all_functions.iteritems())] for func, angle_func in sorted(all_functions.items())]
with open(out_file_name_gl, 'w') as out_file: with open(out_file_name_gl, 'w') as out_file:
output_cpp = template_cpp.format( output_cpp = template_cpp.format(
......
#!/usr/bin/python2
# Copyright 2019 The ANGLE Project Authors. All rights reserved. # Copyright 2019 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
#!/usr/bin/python2 #!/usr/bin/python3
# #
# Copyright 2018 The ANGLE Project Authors. All rights reserved. # Copyright 2018 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
...@@ -293,9 +293,9 @@ def main(): ...@@ -293,9 +293,9 @@ def main():
] ]
if sys.argv[1] == 'inputs': if sys.argv[1] == 'inputs':
print ','.join(inputs) print(','.join(inputs))
elif sys.argv[1] == 'outputs': elif sys.argv[1] == 'outputs':
print ','.join(outputs) print(','.join(outputs))
else: else:
print('Invalid script parameters') print('Invalid script parameters')
return 1 return 1
......
#!/usr/bin/python2 #!/usr/bin/python3
# #
# Copyright 2018 The ANGLE Project Authors. All rights reserved. # Copyright 2018 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
...@@ -10,10 +10,12 @@ ...@@ -10,10 +10,12 @@
# List of supported extensions. Add to this list to enable new extensions # List of supported extensions. Add to this list to enable new extensions
# available in gl.xml. # available in gl.xml.
import sys
import os import os
import sys
import xml.etree.ElementTree as etree import xml.etree.ElementTree as etree
from enum import Enum
xml_inputs = [ xml_inputs = [
'gl.xml', 'gl.xml',
'gl_angle_ext.xml', 'gl_angle_ext.xml',
...@@ -220,6 +222,14 @@ EGL_VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5)] ...@@ -220,6 +222,14 @@ EGL_VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5)]
WGL_VERSIONS = [(1, 0)] WGL_VERSIONS = [(1, 0)]
# API types
class apis:
GL = 'GL'
GLES = 'GLES'
WGL = 'WGL'
EGL = 'EGL'
def script_relative(path): def script_relative(path):
return os.path.join(os.path.dirname(sys.argv[0]), path) return os.path.join(os.path.dirname(sys.argv[0]), path)
...@@ -228,7 +238,7 @@ def path_to(folder, file): ...@@ -228,7 +238,7 @@ def path_to(folder, file):
return os.path.join(script_relative(".."), "src", folder, file) return os.path.join(script_relative(".."), "src", folder, file)
class GLCommandNames: class CommandNames:
def __init__(self): def __init__(self):
self.command_names = {} self.command_names = {}
...@@ -239,7 +249,7 @@ class GLCommandNames: ...@@ -239,7 +249,7 @@ class GLCommandNames:
def get_all_commands(self): def get_all_commands(self):
cmd_names = [] cmd_names = []
# Combine all the version lists into a single list # Combine all the version lists into a single list
for version, version_cmd_names in sorted(self.command_names.iteritems()): for version, version_cmd_names in sorted(self.command_names.items()):
cmd_names += version_cmd_names cmd_names += version_cmd_names
return cmd_names return cmd_names
...@@ -260,7 +270,7 @@ class RegistryXML: ...@@ -260,7 +270,7 @@ class RegistryXML:
if (ext_file): if (ext_file):
self._AppendANGLEExts(ext_file) self._AppendANGLEExts(ext_file)
self.all_commands = self.root.findall('commands/command') self.all_commands = self.root.findall('commands/command')
self.all_cmd_names = GLCommandNames() self.all_cmd_names = CommandNames()
self.commands = {} self.commands = {}
def _AppendANGLEExts(self, ext_file): def _AppendANGLEExts(self, ext_file):
...@@ -337,7 +347,7 @@ class RegistryXML: ...@@ -337,7 +347,7 @@ class RegistryXML:
self.ext_data[extension_name] = sorted(ext_cmd_names) self.ext_data[extension_name] = sorted(ext_cmd_names)
for extension_name, ext_cmd_names in sorted(self.ext_data.iteritems()): for extension_name, ext_cmd_names in sorted(self.ext_data.items()):
# Detect and filter duplicate extensions. # Detect and filter duplicate extensions.
dupes = [] dupes = []
...@@ -351,3 +361,10 @@ class RegistryXML: ...@@ -351,3 +361,10 @@ class RegistryXML:
self.ext_data[extension_name] = sorted(ext_cmd_names) self.ext_data[extension_name] = sorted(ext_cmd_names)
self.ext_dupes[extension_name] = dupes self.ext_dupes[extension_name] = dupes
self.all_cmd_names.add_commands(ext_annotations[extension_name], ext_cmd_names) self.all_cmd_names.add_commands(ext_annotations[extension_name], ext_cmd_names)
class EntryPoints:
def __init__(self, api, xml):
for command in xml.all_commands:
pass
...@@ -40,15 +40,25 @@ def rebase_script_path(script_path, relative_path): ...@@ -40,15 +40,25 @@ def rebase_script_path(script_path, relative_path):
# Check if we need a module from vpython # Check if we need a module from vpython
def get_executable_name(first_line): def get_executable_name(first_line):
if 'vpython' in first_line: binary = os.path.basename(first_line.strip().replace(' ', '/'))
return 'vpython.bat' if platform.system() == 'Windows' else 'vpython' if platform.system() == 'Windows':
return 'python' if binary == 'python2':
return 'python.bat'
else:
return binary + '.bat'
else:
return binary
def grab_from_script(script, param): def grab_from_script(script, param):
res = '' res = ''
f = open(os.path.basename(script), "r") f = open(os.path.basename(script), 'r')
res = subprocess.check_output([get_executable_name(f.readline()), script, param]).strip() exe = get_executable_name(f.readline())
try:
res = subprocess.check_output([exe, script, param]).strip()
except Exception:
print('Error grabbing script output: %s, executable %s' % (script, exe))
raise
f.close() f.close()
if res == '': if res == '':
return [] return []
...@@ -123,10 +133,10 @@ generators = { ...@@ -123,10 +133,10 @@ generators = {
'src/common/gen_uniform_type_table.py', 'src/common/gen_uniform_type_table.py',
'Vulkan format': 'Vulkan format':
'src/libANGLE/renderer/vulkan/gen_vk_format_table.py', 'src/libANGLE/renderer/vulkan/gen_vk_format_table.py',
'Vulkan mandatory format support table':
'src/libANGLE/renderer/vulkan/gen_vk_mandatory_format_support_table.py',
'Vulkan internal shader programs': 'Vulkan internal shader programs':
'src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py', 'src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py',
'Vulkan mandatory format support table':
'src/libANGLE/renderer/vulkan/gen_vk_mandatory_format_support_table.py',
} }
...@@ -213,11 +223,11 @@ def main(): ...@@ -213,11 +223,11 @@ def main():
any_dirty = True any_dirty = True
if not verify_only: if not verify_only:
print('Running ' + name + ' code generator')
# Set the CWD to the script directory. # Set the CWD to the script directory.
os.chdir(get_child_script_dirname(script)) os.chdir(get_child_script_dirname(script))
print('Running ' + name + ' code generator')
f = open(os.path.basename(script), "r") f = open(os.path.basename(script), "r")
if subprocess.call([get_executable_name(f.readline()), if subprocess.call([get_executable_name(f.readline()),
os.path.basename(script)]) != 0: os.path.basename(script)]) != 0:
......
// GENERATED FILE - DO NOT EDIT. // GENERATED FILE - DO NOT EDIT.
// Generated by gen_packed_gl_enums.py using data from packed_egl_enums.json. // Generated by gen_packed_gl_enums.py using data from packed_egl_enums.json.
// //
// Copyright 2020 The ANGLE Project Authors. All rights reserved. // Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
......
// GENERATED FILE - DO NOT EDIT. // GENERATED FILE - DO NOT EDIT.
// Generated by gen_packed_gl_enums.py using data from packed_egl_enums.json. // Generated by gen_packed_gl_enums.py using data from packed_egl_enums.json.
// //
// Copyright 2020 The ANGLE Project Authors. All rights reserved. // Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
......
// GENERATED FILE - DO NOT EDIT. // GENERATED FILE - DO NOT EDIT.
// Generated by gen_packed_gl_enums.py using data from packed_gl_enums.json. // Generated by gen_packed_gl_enums.py using data from packed_gl_enums.json.
// //
// Copyright 2020 The ANGLE Project Authors. All rights reserved. // Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
......
// GENERATED FILE - DO NOT EDIT. // GENERATED FILE - DO NOT EDIT.
// Generated by gen_packed_gl_enums.py using data from packed_gl_enums.json. // Generated by gen_packed_gl_enums.py using data from packed_gl_enums.json.
// //
// Copyright 2020 The ANGLE Project Authors. All rights reserved. // Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
......
#!/usr/bin/python2
# Copyright 2018 The ANGLE Project Authors. All rights reserved. # Copyright 2018 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
// GENERATED FILE - DO NOT EDIT. // GENERATED FILE - DO NOT EDIT.
// Generated by gen_overlay_widgets.py using data from overlay_widgets.json. // Generated by gen_overlay_widgets.py using data from overlay_widgets.json.
// //
// Copyright 2020 The ANGLE Project Authors. All rights reserved. // Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
......
// GENERATED FILE - DO NOT EDIT. // GENERATED FILE - DO NOT EDIT.
// Generated by gen_overlay_widgets.py using data from overlay_widgets.json. // Generated by gen_overlay_widgets.py using data from overlay_widgets.json.
// //
// Copyright 2020 The ANGLE Project Authors. All rights reserved. // Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
......
// GENERATED FILE - DO NOT EDIT. // GENERATED FILE - DO NOT EDIT.
// Generated by gen_overlay_fonts.py using images from overlay/DejaVuSansMono-Bold.ttf. // Generated by gen_overlay_fonts.py using images from overlay/DejaVuSansMono-Bold.ttf.
// //
// Copyright 2019 The ANGLE Project Authors. All rights reserved. // Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
......
// GENERATED FILE - DO NOT EDIT. // GENERATED FILE - DO NOT EDIT.
// Generated by gen_overlay_fonts.py using overlay/DejaVuSansMono-Bold.ttf. // Generated by gen_overlay_fonts.py using overlay/DejaVuSansMono-Bold.ttf.
// //
// Copyright 2019 The ANGLE Project Authors. All rights reserved. // Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
# Because this script can be slow direct invocation is supported. But before # Because this script can be slow direct invocation is supported. But before
# code upload please run scripts/run_code_generation.py. # code upload please run scripts/run_code_generation.py.
from datetime import date
import io import io
import json import json
import multiprocessing import multiprocessing
...@@ -31,7 +30,7 @@ is_linux = platform.system() == 'Linux' ...@@ -31,7 +30,7 @@ is_linux = platform.system() == 'Linux'
template_shader_library_cpp = u"""// GENERATED FILE - DO NOT EDIT. template_shader_library_cpp = u"""// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {input_file_name} // Generated by {script_name} using data from {input_file_name}
// //
// Copyright {copyright_year} The ANGLE Project Authors. All rights reserved. // Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -120,7 +119,7 @@ void ShaderLibrary::destroy(VkDevice device) ...@@ -120,7 +119,7 @@ void ShaderLibrary::destroy(VkDevice device)
template_shader_library_h = u"""// GENERATED FILE - DO NOT EDIT. template_shader_library_h = u"""// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {input_file_name} // Generated by {script_name} using data from {input_file_name}
// //
// Copyright {copyright_year} The ANGLE Project Authors. All rights reserved. // Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -163,7 +162,7 @@ class ShaderLibrary final : angle::NonCopyable ...@@ -163,7 +162,7 @@ class ShaderLibrary final : angle::NonCopyable
template_shader_includes_gni = u"""# GENERATED FILE - DO NOT EDIT. template_shader_includes_gni = u"""# GENERATED FILE - DO NOT EDIT.
# Generated by {script_name} using data from {input_file_name} # Generated by {script_name} using data from {input_file_name}
# #
# Copyright {copyright_year} The ANGLE Project Authors. All rights reserved. # Copyright 2020 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
# #
...@@ -178,7 +177,7 @@ angle_vulkan_internal_shaders = [ ...@@ -178,7 +177,7 @@ angle_vulkan_internal_shaders = [
template_spirv_blob_inc = u"""// GENERATED FILE - DO NOT EDIT. template_spirv_blob_inc = u"""// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name}. // Generated by {script_name}.
// //
// Copyright {copyright_year} The ANGLE Project Authors. All rights reserved. // Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -267,7 +266,7 @@ def get_shader_variations(shader): ...@@ -267,7 +266,7 @@ def get_shader_variations(shader):
flags = {} flags = {}
enums = [] enums = []
for key, value in variations.iteritems(): for key, value in variations.items():
if key == "Description": if key == "Description":
continue continue
elif key == "Flags": elif key == "Flags":
...@@ -324,18 +323,17 @@ def read_and_compress_spirv_blob(blob_path): ...@@ -324,18 +323,17 @@ def read_and_compress_spirv_blob(blob_path):
def write_compressed_spirv_blob_as_c_array(output_path, variable_name, compressed_blob, def write_compressed_spirv_blob_as_c_array(output_path, variable_name, compressed_blob,
preprocessed_source): preprocessed_source):
hex_array = ['0x{:02x}'.format(ord(byte)) for byte in compressed_blob] hex_array = ['0x{:02x}'.format(byte) for byte in compressed_blob]
blob = ',\n '.join(','.join(hex_array[i:i + 16]) for i in range(0, len(hex_array), 16)) blob = ',\n '.join(','.join(hex_array[i:i + 16]) for i in range(0, len(hex_array), 16))
text = template_spirv_blob_inc.format(
script_name=__file__,
out_file_name=output_path.replace('\\', '/'),
variable_name=variable_name,
blob=blob,
preprocessed_source=preprocessed_source)
with open(output_path, 'wb') as incfile: with open(output_path, 'wb') as incfile:
incfile.write( incfile.write(str.encode(text))
template_spirv_blob_inc.format(
script_name=__file__,
copyright_year=date.today().year,
out_file_name=output_path,
variable_name=variable_name,
blob=blob,
preprocessed_source=preprocessed_source))
class CompileQueue: class CompileQueue:
...@@ -345,7 +343,7 @@ class CompileQueue: ...@@ -345,7 +343,7 @@ class CompileQueue:
def __init__(self, shader_file, preprocessor_args, output_path, variable_name): def __init__(self, shader_file, preprocessor_args, output_path, variable_name):
# Asynchronously launch the preprocessor job. # Asynchronously launch the preprocessor job.
self.process = subprocess.Popen( self.process = subprocess.Popen(
preprocessor_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) preprocessor_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
# Store the file name for output to be appended to. # Store the file name for output to be appended to.
self.output_path = output_path self.output_path = output_path
self.variable_name = variable_name self.variable_name = variable_name
...@@ -357,6 +355,8 @@ class CompileQueue: ...@@ -357,6 +355,8 @@ class CompileQueue:
if self.process.returncode == 0: if self.process.returncode == 0:
# Use unix line endings. # Use unix line endings.
out = out.replace('\r\n', '\n') out = out.replace('\r\n', '\n')
# Use Linux-style slashes in #line directives.
out = out.replace('shaders\\src\\', 'shaders/src/')
# Clean up excessive empty lines. # Clean up excessive empty lines.
out = cleanup_preprocessed_shader(out) out = cleanup_preprocessed_shader(out)
# Comment it out! # Comment it out!
...@@ -380,7 +380,7 @@ class CompileQueue: ...@@ -380,7 +380,7 @@ class CompileQueue:
compile_args, preprocessor_args, variable_name): compile_args, preprocessor_args, variable_name):
# Asynchronously launch the compile job. # Asynchronously launch the compile job.
self.process = subprocess.Popen( self.process = subprocess.Popen(
compile_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) compile_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
# Store info for launching the preprocessor. # Store info for launching the preprocessor.
self.preprocessor_args = preprocessor_args self.preprocessor_args = preprocessor_args
self.output_path = output_path self.output_path = output_path
...@@ -468,11 +468,11 @@ class CompileQueue: ...@@ -468,11 +468,11 @@ class CompileQueue:
# [ name, arg1, ..., argN ]. In that case, name is option[0] and option[1:] are extra arguments # [ name, arg1, ..., argN ]. In that case, name is option[0] and option[1:] are extra arguments
# that need to be passed to glslang_validator for this variation. # that need to be passed to glslang_validator for this variation.
def get_variation_name(option): def get_variation_name(option):
return option if isinstance(option, unicode) else option[0] return option if isinstance(option, str) else option[0]
def get_variation_args(option): def get_variation_args(option):
return [] if isinstance(option, unicode) else option[1:] return [] if isinstance(option, str) else option[1:]
def compile_variation(glslang_path, compile_queue, shader_file, shader_basename, flags, enums, def compile_variation(glslang_path, compile_queue, shader_file, shader_basename, flags, enums,
...@@ -769,8 +769,7 @@ def main(): ...@@ -769,8 +769,7 @@ def main():
outcode = template_shader_library_cpp.format( outcode = template_shader_library_cpp.format(
script_name=__file__, script_name=__file__,
copyright_year=date.today().year, out_file_name=out_file_cpp.replace('\\', '/'),
out_file_name=out_file_cpp,
input_file_name='shaders/src/*', input_file_name='shaders/src/*',
internal_shader_includes=includes, internal_shader_includes=includes,
shader_tables_cpp=shader_tables_cpp, shader_tables_cpp=shader_tables_cpp,
...@@ -787,8 +786,7 @@ def main(): ...@@ -787,8 +786,7 @@ def main():
shader_tables_h = '\n'.join([get_shader_table_h(s) for s in input_shaders_and_variations]) shader_tables_h = '\n'.join([get_shader_table_h(s) for s in input_shaders_and_variations])
outcode = template_shader_library_h.format( outcode = template_shader_library_h.format(
script_name=__file__, script_name=__file__,
copyright_year=date.today().year, out_file_name=out_file_h.replace('\\', '/'),
out_file_name=out_file_h,
input_file_name='shaders/src/*', input_file_name='shaders/src/*',
shader_variation_definitions=shader_variation_definitions, shader_variation_definitions=shader_variation_definitions,
shader_get_functions_h=shader_get_functions_h, shader_get_functions_h=shader_get_functions_h,
...@@ -800,8 +798,7 @@ def main(): ...@@ -800,8 +798,7 @@ def main():
with io.open(out_file_gni, 'w', newline='\n') as outfile: with io.open(out_file_gni, 'w', newline='\n') as outfile:
outcode = template_shader_includes_gni.format( outcode = template_shader_includes_gni.format(
script_name=__file__, script_name=__file__,
copyright_year=date.today().year, out_file_name=out_file_gni.replace('\\', '/'),
out_file_name=out_file_gni,
input_file_name='shaders/src/*', input_file_name='shaders/src/*',
shaders_list=',\n'.join([shader_path(shader) for shader in output_shaders])) shaders_list=',\n'.join([shader_path(shader) for shader in output_shaders]))
outfile.write(outcode) outfile.write(outcode)
......
#!/usr/bin/python #!/usr/bin/python2
# Copyright 2018 The ANGLE Project Authors. All rights reserved. # Copyright 2018 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
# Code generation for mandatory formats supported by Vulkan. # Code generation for mandatory formats supported by Vulkan.
# NOTE: don't run this script directly. Run scripts/run_code_generation.py. # NOTE: don't run this script directly. Run scripts/run_code_generation.py.
from datetime import date
import sys import sys
sys.path.append('..') sys.path.append('..')
......
...@@ -142,11 +142,11 @@ constexpr size_t kArrayLen = 0x00000030; ...@@ -142,11 +142,11 @@ constexpr size_t kArrayLen = 0x00000030;
namespace ImageCopy_frag namespace ImageCopy_frag
{ {
enum DestFormat enum SrcType
{ {
kDestIsFloat = 0x00000000, kSrcIs2D = 0x00000000,
kDestIsSint = 0x00000001, kSrcIs2DArray = 0x00000001,
kDestIsUint = 0x00000002, kSrcIs3D = 0x00000002,
}; };
enum SrcFormat enum SrcFormat
{ {
...@@ -154,11 +154,11 @@ enum SrcFormat ...@@ -154,11 +154,11 @@ enum SrcFormat
kSrcIsSint = 0x00000004, kSrcIsSint = 0x00000004,
kSrcIsUint = 0x00000008, kSrcIsUint = 0x00000008,
}; };
enum SrcType enum DestFormat
{ {
kSrcIs2D = 0x00000000, kDestIsFloat = 0x00000000,
kSrcIs2DArray = 0x00000010, kDestIsSint = 0x00000010,
kSrcIs3D = 0x00000020, kDestIsUint = 0x00000020,
}; };
constexpr size_t kArrayLen = 0x0000002B; constexpr size_t kArrayLen = 0x0000002B;
} // namespace ImageCopy_frag } // namespace ImageCopy_frag
......
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