From: Mikko Rasa Date: Wed, 26 Oct 2016 18:33:21 +0000 (+0300) Subject: Be smarter about detecting backport extensions X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=3297703b932007051decb2f1353b93a1a2d4157c;p=libs%2Fgl.git Be smarter about detecting backport extensions Sometimes a more recent and completely unrelated extension reuses some tokens with their core names, causing them to seem like backport extensions to the script. --- diff --git a/extensions/arb_texture_cube_map.glext b/extensions/arb_texture_cube_map.glext index 88745307..3dd14981 100644 --- a/extensions/arb_texture_cube_map.glext +++ b/extensions/arb_texture_cube_map.glext @@ -1,2 +1,3 @@ extension ARB_texture_cube_map core_version gl 1.3 +backport none diff --git a/extensions/arb_texture_float.glext b/extensions/arb_texture_float.glext index 24f42c2f..55aa32d1 100644 --- a/extensions/arb_texture_float.glext +++ b/extensions/arb_texture_float.glext @@ -1,2 +1,3 @@ extension ARB_texture_float core_version gl 3.0 +backport none diff --git a/extensions/arb_vertex_buffer_object.glext b/extensions/arb_vertex_buffer_object.glext index 0eadd25f..e8962591 100644 --- a/extensions/arb_vertex_buffer_object.glext +++ b/extensions/arb_vertex_buffer_object.glext @@ -1 +1,2 @@ extension ARB_vertex_buffer_object +backport none diff --git a/extensions/arb_vertex_shader.glext b/extensions/arb_vertex_shader.glext index 73d559b4..951fbaae 100644 --- a/extensions/arb_vertex_shader.glext +++ b/extensions/arb_vertex_shader.glext @@ -1,2 +1,3 @@ extension ARB_vertex_shader secondary ARB_vertex_program +backport none diff --git a/extensions/ext_bgra.glext b/extensions/ext_bgra.glext index 2ba56750..d8522175 100644 --- a/extensions/ext_bgra.glext +++ b/extensions/ext_bgra.glext @@ -1,2 +1,3 @@ extension EXT_bgra core_version gl 1.2 +backport none diff --git a/extensions/ext_blend_minmax.glext b/extensions/ext_blend_minmax.glext index 5b2174d5..62606988 100644 --- a/extensions/ext_blend_minmax.glext +++ b/extensions/ext_blend_minmax.glext @@ -1 +1,2 @@ extension EXT_blend_minmax +backport none diff --git a/extensions/ext_blend_subtract.glext b/extensions/ext_blend_subtract.glext index 0e89f4d2..cbd8b416 100644 --- a/extensions/ext_blend_subtract.glext +++ b/extensions/ext_blend_subtract.glext @@ -1,2 +1,3 @@ extension EXT_blend_subtract core_version gl 1.2 +backport none diff --git a/extensions/ext_framebuffer_blit.glext b/extensions/ext_framebuffer_blit.glext index 4c78ba51..cdc1801b 100644 --- a/extensions/ext_framebuffer_blit.glext +++ b/extensions/ext_framebuffer_blit.glext @@ -1 +1,2 @@ extension EXT_framebuffer_blit +backport ARB_framebuffer_object diff --git a/extensions/ext_framebuffer_multisample.glext b/extensions/ext_framebuffer_multisample.glext index 91f26a7f..272ca3ae 100644 --- a/extensions/ext_framebuffer_multisample.glext +++ b/extensions/ext_framebuffer_multisample.glext @@ -1 +1,2 @@ extension EXT_framebuffer_multisample +backport ARB_framebuffer_object diff --git a/extensions/ext_geometry_shader4.glext b/extensions/ext_geometry_shader4.glext index 0bc0f85d..210b9bdb 100644 --- a/extensions/ext_geometry_shader4.glext +++ b/extensions/ext_geometry_shader4.glext @@ -1 +1,2 @@ extension EXT_geometry_shader4 +backport none diff --git a/extensions/ext_texture3d.glext b/extensions/ext_texture3d.glext index e9bc90bb..c1516184 100644 --- a/extensions/ext_texture3d.glext +++ b/extensions/ext_texture3d.glext @@ -1 +1,2 @@ extension EXT_texture3D +backport none diff --git a/extensions/ext_texture_filter_anisotropic.glext b/extensions/ext_texture_filter_anisotropic.glext index 6d7c6c11..0f611bf4 100644 --- a/extensions/ext_texture_filter_anisotropic.glext +++ b/extensions/ext_texture_filter_anisotropic.glext @@ -1 +1,2 @@ extension EXT_texture_filter_anisotropic +backport none diff --git a/scripts/extgen.py b/scripts/extgen.py index ec57e2ef..7083e13a 100755 --- a/scripts/extgen.py +++ b/scripts/extgen.py @@ -31,6 +31,7 @@ if sys.argv[i].startswith("gl"): i += 1 target_ext = sys.argv[i] +backport_ext = None out_base = None if target_ext.endswith(".glext"): fn = target_ext @@ -46,6 +47,8 @@ if target_ext.endswith(".glext"): core_version = parts[2] elif parts[0]=="secondary": secondary.append(parts[1]) + elif parts[0]=="backport": + backport_ext = parts[1] if i+11: + print "Warning: multiple backport extension candidates: %s"%(" ".join(e.name for e in backport_ext_candidates)) + + for e in backport_ext_candidates: + if e.base_name==target_ext.base_name: + backport_ext = e + + if not backport_ext and len(backport_ext_candidates)==1: + print "Warning: potential backport extension has mismatched name: %s"%backport_ext_candidates[0].name for f in funcs: f.typedef = "FPtr_%s"%f.name