diff --git a/auto/bin/filter_gl_ext.sh b/auto/bin/filter_gl_ext.sh index c121cec..97030fb 100755 --- a/auto/bin/filter_gl_ext.sh +++ b/auto/bin/filter_gl_ext.sh @@ -467,8 +467,8 @@ EOT # Fixup REGAL and ANGLE urls - for i in $1/GL_REGAL_*; do perl -e 's#http://www.opengl.org/registry/specs/gl/REGAL/.*#https://github.com/p3/regal/tree/master/doc/extensions#g' -pi $i; done - for i in $1/GL_ANGLE_*; do perl -e 's#http://www.opengl.org/registry/specs/gl/ANGLE/.*#https://code.google.com/p/angleproject/source/browse/\#git%2Fextensions#g' -pi $i; done + for i in $1/GL_REGAL_*; do perl -e 's#http://www.opengl.org/registry/specs/REGAL/.*#https://github.com/p3/regal/tree/master/doc/extensions#g' -pi $i; done + for i in $1/GL_ANGLE_*; do perl -e 's#http://www.opengl.org/registry/specs/ANGLE/.*#https://code.google.com/p/angleproject/source/browse/\#git%2Fextensions#g' -pi $i; done # Filter out GL_NV_blend_equation_advanced_coherent enums and functions head -n3 $1/GL_NV_blend_equation_advanced_coherent > tmp diff --git a/auto/bin/filter_spec.py b/auto/bin/filter_spec.py new file mode 100755 index 0000000..7fc334b --- /dev/null +++ b/auto/bin/filter_spec.py @@ -0,0 +1,32 @@ +#!/usr/bin/python + +import re + +section = re.compile('^(Name|Name Strings?|Number|Dependencies|New Procedures and Functions|New Tokens|Additions to .*|Changes to .*|Modifications to .*|Add new Section .*)\s*$') +token = re.compile('^\s+(([A-Z0-9][A-Z0-9_x]*):?\s+((?:0x)?[0-9A-F]+)([^\?]*))?\s*$') + +if __name__ == '__main__': + + from optparse import OptionParser + import os + + parser = OptionParser('usage: %prog [options] [SOURCES...]') + (options, args) = parser.parse_args() + + for i in args: + lines = open(i).readlines() + f = open(i,'w') + current = '' + for j in lines: + m = section.match(j) + if m: + current = m.group(1).strip() + if current in [ 'Name', 'Name String', 'Name Strings', 'Number', 'Dependencies', 'New Procedures and Functions', 'New Tokens']: + print >>f, j, + continue + if current=='New Tokens': + if token.match(j): + print >>f, j, + elif current in [ 'Name', 'Name String', 'Name Strings', 'Number', 'Dependencies', 'New Procedures and Functions']: + print >>f, j, + diff --git a/auto/bin/make.pl b/auto/bin/make.pl index f382263..83bb774 100755 --- a/auto/bin/make.pl +++ b/auto/bin/make.pl @@ -142,7 +142,25 @@ sub output_tokens($$) { local $, = "\n"; print "\n"; - print map { &{$fnc}($_, $tbl->{$_}) } sort { hex ${$tbl}{$a} <=> hex ${$tbl}{$b} } keys %{$tbl}; + print map { &{$fnc}($_, $tbl->{$_}) } sort { + if (${$tbl}{$a} eq ${$tbl}{$b}) { + $a cmp $b + } else { + if (${$tbl}{$a} =~ /_/) { + if (${$tbl}{$b} =~ /_/) { + $a cmp $b + } else { + -1 + } + } else { + if (${$tbl}{$b} =~ /_/) { + 1 + } else { + hex ${$tbl}{$a} <=> hex ${$tbl}{$b} + } + } + } + } keys %{$tbl}; print "\n"; } else { print STDERR "no keys in table!\n"; diff --git a/auto/bin/parse_spec.pl b/auto/bin/parse_spec.pl index 7e64ddb..8824af6 100755 --- a/auto/bin/parse_spec.pl +++ b/auto/bin/parse_spec.pl @@ -309,7 +309,7 @@ my @speclist = (); my %extensions = (); my $ext_dir = shift; -my $reg_http = "http://www.opengl.org/registry/specs/gl/"; +my $reg_http = "http://www.opengl.org/registry/specs/"; # Take command line arguments or read list from file if (@ARGV) @@ -336,8 +336,26 @@ foreach my $spec (sort @speclist) my $prefix = $ext; $prefix =~ s/^(.+?)(_.+)$/$1/; - foreach my $token (sort { hex ${$tokens}{$a} <=> hex ${$tokens}{$b} } keys %{$tokens}) - { + foreach my $token (sort { + if (${$tokens}{$a} eq ${$tokens}{$b}) { + $a cmp $b + } else { + if (${$tokens}{$a} =~ /_/) { + if (${$tokens}{$b} =~ /_/) { + $a cmp $b + } else { + -1 + } + } else { + if (${$tokens}{$b} =~ /_/) { + 1 + } else { + hex ${$tokens}{$a} <=> hex ${$tokens}{$b} + } + } + } + } keys %{$tokens}) + { if ($token =~ /^$prefix\_.*/i) { print EXT "\t" . $token . " " . ${\%{$tokens}}{$token} . "\n"; diff --git a/auto/doc/index.html b/auto/doc/index.html index 349bb0b..8d8b1c7 100644 --- a/auto/doc/index.html +++ b/auto/doc/index.html @@ -60,9 +60,9 @@ An up-to-date copy is also available using git Unsupported snapshots are also available: