Commit 6edaf098 by Jamie Madill Committed by Commit Bot

Entry Points: Clean up versions lists.

This reduces code duplication in a few generator scripts. The version lists are now located in registry_xml. Bug: angleproject:2621 Change-Id: Ia1470f2863753d78d8def1132a20e81d3f8ec4a3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2566591Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 0c47015b
......@@ -10,7 +10,7 @@
"scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py":
"dd461cd58c29c1d65c21bad98783cfde",
"08b0f52b02191c335f752ea38be47729",
"scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db",
"src/libEGL/egl_loader_autogen.cpp":
......
......@@ -8,13 +8,13 @@
"scripts/entry_point_packed_gl_enums.json":
"846be5dc8cb36076207699b025633fcc",
"scripts/generate_entry_points.py":
"95fc7635243122e679e82e1757816ab3",
"7661672a3ebfe1f07064f07d26a8f012",
"scripts/gl.xml":
"f66967f3f3d696b5d8306fd80bbd49a8",
"scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py":
"dd461cd58c29c1d65c21bad98783cfde",
"08b0f52b02191c335f752ea38be47729",
"scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db",
"src/common/entry_points_enum_autogen.cpp":
......
......@@ -6,7 +6,7 @@
"scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py":
"dd461cd58c29c1d65c21bad98783cfde",
"08b0f52b02191c335f752ea38be47729",
"src/libANGLE/gl_enum_utils_autogen.cpp":
"30ac2050cdc2b7fa0a42acc457e57059",
"src/libANGLE/gl_enum_utils_autogen.h":
......
......@@ -4,13 +4,13 @@
"scripts/egl_angle_ext.xml":
"91f7718effe50d444f8d81ce285721db",
"scripts/gen_proc_table.py":
"2f59a2df6a96808de9c4b49e3510140a",
"53602641995526e7fc0afec1d3715269",
"scripts/gl.xml":
"f66967f3f3d696b5d8306fd80bbd49a8",
"scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py":
"dd461cd58c29c1d65c21bad98783cfde",
"08b0f52b02191c335f752ea38be47729",
"scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db",
"src/libGL/proc_table_wgl_autogen.cpp":
......
......@@ -87,6 +87,10 @@ sys.path.append('../src/libANGLE/renderer')
import angle_format
def _get_annotations(versions):
return ["%d_%d" % version for version in versions]
def main():
# auto_script parameters.
......@@ -104,8 +108,7 @@ def main():
glesxml = registry_xml.RegistryXML('gl.xml', 'gl_angle_ext.xml')
for annotation in ["2_0", "3_0", "3_1", "3_2", "1_0"]:
for annotation in _get_annotations(registry_xml.GLES_VERSIONS):
name_prefix = "GL_ES_VERSION_"
if annotation[0] == '1':
name_prefix = "GL_VERSION_ES_CM_"
......@@ -128,8 +131,7 @@ def main():
eglxml = registry_xml.RegistryXML('egl.xml', 'egl_angle_ext.xml')
for annotation in ["1_0", "1_1", "1_2", "1_3", "1_4", "1_5"]:
for annotation in _get_annotations(registry_xml.EGL_VERSIONS):
name_prefix = "EGL_VERSION_"
feature_name = "{}{}".format(name_prefix, annotation)
eglxml.AddCommands(feature_name, annotation)
......@@ -173,11 +175,7 @@ def main():
# libGL proc table
glxml = registry_xml.RegistryXML('gl.xml')
for annotation in [
"1_0", "1_1", "1_2", "1_3", "1_4", "1_5", "2_0", "2_1", "3_0", "3_1", "3_2", "3_3",
"4_0", "4_1", "4_2", "4_3", "4_4", "4_5", "4_6"
]:
for annotation in _get_annotations(registry_xml.DESKTOP_GL_VERSIONS):
name_prefix = "GL_VERSION_"
feature_name = "{}{}".format(name_prefix, annotation)
glxml.AddCommands(feature_name, annotation)
......@@ -186,8 +184,7 @@ def main():
wglxml = registry_xml.RegistryXML('wgl.xml')
for annotation in ["1_0"]:
for annotation in _get_annotations(registry_xml.WGL_VERSIONS):
name_prefix = "WGL_VERSION_"
feature_name = "{}{}".format(name_prefix, annotation)
wglxml.AddCommands(feature_name, annotation)
......
......@@ -2024,7 +2024,7 @@ def get_egl_exports():
capser = lambda fn: "EGL_" + fn[3:]
for major, minor in [[1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [1, 5]]:
for major, minor in registry_xml.EGL_VERSIONS:
annotation = "{}_{}".format(major, minor)
name_prefix = "EGL_VERSION_"
......@@ -2307,7 +2307,7 @@ def main():
glesdecls = {}
glesdecls['core'] = {}
glesdecls['exts'] = {}
for ver in [(1, 0), (2, 0), (3, 0), (3, 1), (3, 2)]:
for ver in registry_xml.GLES_VERSIONS:
glesdecls['core'][ver] = []
for ver in ['GLES1 Extensions', 'GLES2+ Extensions', 'ANGLE Extensions']:
glesdecls['exts'][ver] = {}
......@@ -2324,8 +2324,7 @@ def main():
# First run through the main GLES entry points. Since ES2+ is the primary use
# case, we go through those first and then add ES1-only APIs at the end.
versions = [[2, 0], [3, 0], [3, 1], [3, 2], [1, 0]]
for major_version, minor_version in versions:
for major_version, minor_version in registry_xml.GLES_VERSIONS:
version = "{}_{}".format(major_version, minor_version)
annotation = "GLES_{}".format(version)
name_prefix = "GL_ES_VERSION_"
......@@ -2475,7 +2474,7 @@ def main():
libgles_ep_exports += get_exports(cmds, lambda x: "%sContextANGLE" % x)
# Generate .inc files for extension function pointers and declarations
for major, minor in versions:
for major, minor in registry_xml.GLES_VERSIONS:
annotation = "{}_{}".format(major, minor)
major_if_not_one = major if major != 1 else ""
......@@ -2506,8 +2505,7 @@ def main():
# Now we generate entry points for the desktop implementation
gldecls = {}
gldecls['core'] = {}
for ver in [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 0), (2, 1), (3, 0), (3, 1),
(3, 2), (3, 3), (4, 0), (4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6)]:
for ver in registry_xml.DESKTOP_GL_VERSIONS:
gldecls['core'][ver] = []
libgl_ep_defs = []
......@@ -2515,9 +2513,7 @@ def main():
glxml = registry_xml.RegistryXML('gl.xml')
for major_version, minor_version in [[1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [2, 0],
[2, 1], [3, 0], [3, 1], [3, 2], [3, 3], [4, 0], [4, 1],
[4, 2], [4, 3], [4, 4], [4, 5], [4, 6]]:
for major_version, minor_version in registry_xml.DESKTOP_GL_VERSIONS:
version = "{}_{}".format(major_version, minor_version)
annotation = "GL_{}".format(version)
name_prefix = "GL_VERSION_"
......@@ -2592,7 +2588,7 @@ def main():
egl_ep_to_object = get_egl_object_category_map()
egl_commands = []
for major_version, minor_version in [[1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [1, 5]]:
for major_version, minor_version in registry_xml.EGL_VERSIONS:
version = "%d_%d" % (major_version, minor_version)
annotation = "EGL_%s" % version
name_prefix = "EGL_VERSION_"
......
......@@ -205,6 +205,14 @@ unsupported_enum_group_names = {
'ClampColorModeARB',
}
# Versions (major, minor). Note that GLES intentionally places 1.0 last.
DESKTOP_GL_VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 0), (2, 1), (3, 0),
(3, 1), (3, 2), (3, 3), (4, 0), (4, 1), (4, 2), (4, 3), (4, 4), (4, 5),
(4, 6)]
GLES_VERSIONS = [(2, 0), (3, 0), (3, 1), (3, 2), (1, 0)]
EGL_VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5)]
WGL_VERSIONS = [(1, 0)]
def script_relative(path):
return os.path.join(os.path.dirname(sys.argv[0]), path)
......
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