Commit f12e7927 authored by Yaroslav Halchenko's avatar Yaroslav Halchenko

Imported Upstream version 1.5.4

parent 0616a842
...@@ -71,28 +71,42 @@ sub parse_ext($) ...@@ -71,28 +71,42 @@ sub parse_ext($)
my %tokens = (); my %tokens = ();
my %types = (); my %types = ();
my @exacts = (); my @exacts = ();
my $extname = ""; my $extname = ""; # Full extension name GL_FOO_extension
my $exturl = ""; my $exturl = ""; # Info URL
my $extstring = ""; # Relevant extension string
open EXT, "<$filename" or return; open EXT, "<$filename" or return;
# As of GLEW 1.5.3 the first three lines _must_ be
# the extension name, the URL and the GL extension
# string (which might be different to the name)
#
# For example GL_NV_geometry_program4 is available
# iff GL_NV_gpu_program4 appears in the extension
# string.
#
# For core OpenGL versions, the third line should
# be blank.
#
# If the URL is unknown, the second line should be
# blank.
$extname = readline(*EXT);
$exturl = readline(*EXT);
$extstring = readline(*EXT);
chomp($extname);
chomp($exturl);
chomp($extstring);
while(<EXT>) while(<EXT>)
{ {
chomp; chomp;
if (/$regex{extname}/) if (s/^\s+//)
{
$extname = $_;
next;
}
elsif (/$regex{exturl}/)
{
$exturl = $_;
}
elsif (s/^\s+//)
{ {
if (/$regex{exact}/) if (/$regex{exact}/)
{ {
push @exacts, $_; push @exacts, $_;
} }
elsif (/$regex{type}/) elsif (/$regex{type}/)
{ {
...@@ -119,7 +133,7 @@ sub parse_ext($) ...@@ -119,7 +133,7 @@ sub parse_ext($)
close EXT; close EXT;
return ($extname, $exturl, \%types, \%tokens, \%functions, \@exacts); return ($extname, $exturl, $extstring, \%types, \%tokens, \%functions, \@exacts);
} }
sub output_tokens($$) sub output_tokens($$)
......
...@@ -29,7 +29,7 @@ if (@ARGV) ...@@ -29,7 +29,7 @@ if (@ARGV)
foreach my $ext (sort @extlist) foreach my $ext (sort @extlist)
{ {
my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
output_decls($functions, \&make_pfn_decl); output_decls($functions, \&make_pfn_decl);
} }
} }
...@@ -23,7 +23,7 @@ if (@ARGV) ...@@ -23,7 +23,7 @@ if (@ARGV)
foreach my $ext (sort @extlist) foreach my $ext (sort @extlist)
{ {
my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
my $extvar = $extname; my $extvar = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/; $extvar =~ s/GL(X*)_/GL$1EW_/;
print "GLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n"; print "GLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n";
......
...@@ -52,7 +52,7 @@ if (@ARGV) ...@@ -52,7 +52,7 @@ if (@ARGV)
foreach my $ext (sort @extlist) foreach my $ext (sort @extlist)
{ {
my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
make_separator($extname); make_separator($extname);
print "#ifndef $extname\n#define $extname 1\n"; print "#ifndef $extname\n#define $extname 1\n";
......
...@@ -26,7 +26,7 @@ if (@ARGV) ...@@ -26,7 +26,7 @@ if (@ARGV)
print "<table border=\"0\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" align=\"center\">\n"; print "<table border=\"0\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" align=\"center\">\n";
foreach my $ext (sort @extlist) foreach my $ext (sort @extlist)
{ {
my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
$cur_group = $extname; $cur_group = $extname;
$cur_group =~ s/^(?:W?)GL(?:X?)_([A-Z0-9]+?)_.*$/$1/; $cur_group =~ s/^(?:W?)GL(?:X?)_([A-Z0-9]+?)_.*$/$1/;
$extname =~ s/^(?:W?)GL(?:X?)_(.*)$/$1/; $extname =~ s/^(?:W?)GL(?:X?)_(.*)$/$1/;
......
...@@ -32,7 +32,7 @@ if (@ARGV) ...@@ -32,7 +32,7 @@ if (@ARGV)
foreach my $ext (sort @extlist) foreach my $ext (sort @extlist)
{ {
my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
my $extvar = $extname; my $extvar = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/; $extvar =~ s/GL(X*)_/GL$1EW_/;
my $extpre = $extname; my $extpre = $extname;
...@@ -50,7 +50,7 @@ if (@ARGV) ...@@ -50,7 +50,7 @@ if (@ARGV)
{ {
print " glewPrintExt(\"$extname\", $extvar, $extpre" . print " glewPrintExt(\"$extname\", $extvar, $extpre" .
"ewIsSupported(\"$extname\"), $extpre" . "ewIsSupported(\"$extname\"), $extpre" .
"ewGetExtension(\"$extname\"));\n"; "ewGetExtension(\"$extstring\"));\n";
} }
output_decls($functions, \&make_pfn_info); output_decls($functions, \&make_pfn_info);
print "}\n\n"; print "}\n\n";
......
...@@ -38,7 +38,7 @@ if (@ARGV) ...@@ -38,7 +38,7 @@ if (@ARGV)
foreach my $ext (sort @extlist) foreach my $ext (sort @extlist)
{ {
my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
print "#ifdef $extname\n"; print "#ifdef $extname\n";
print " _glewInfo_$extname();\n"; print " _glewInfo_$extname();\n";
......
...@@ -34,7 +34,7 @@ if (@ARGV) ...@@ -34,7 +34,7 @@ if (@ARGV)
foreach my $ext (sort @extlist) foreach my $ext (sort @extlist)
{ {
my ($extname, $exturl, $types, $tokens, $functions, $exacts) = my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) =
parse_ext($ext); parse_ext($ext);
#make_separator($extname); #make_separator($extname);
......
...@@ -32,7 +32,7 @@ if (@ARGV) ...@@ -32,7 +32,7 @@ if (@ARGV)
foreach my $ext (sort @extlist) foreach my $ext (sort @extlist)
{ {
my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
my $extvar = $extname; my $extvar = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/; $extvar =~ s/GL(X*)_/GL$1EW_/;
...@@ -43,7 +43,12 @@ if (@ARGV) ...@@ -43,7 +43,12 @@ if (@ARGV)
#my $pextvar = prefix_varname($extvar); #my $pextvar = prefix_varname($extvar);
print "#ifdef $extname\n"; print "#ifdef $extname\n";
print " CONST_CAST(" . $extvar . ") = " . $extpre . "GetExtension(\"$extname\");\n";
if (length($extstring))
{
print " CONST_CAST(" . $extvar . ") = " . $extpre . "GetExtension(\"$extstring\");\n";
}
if (keys %$functions) if (keys %$functions)
{ {
if ($extname =~ /WGL_.*/) if ($extname =~ /WGL_.*/)
......
...@@ -22,7 +22,7 @@ if (@ARGV) ...@@ -22,7 +22,7 @@ if (@ARGV)
my $curexttype = ""; my $curexttype = "";
foreach my $ext (sort @extlist) foreach my $ext (sort @extlist)
{ {
my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
my $exttype = $extname; my $exttype = $extname;
$exttype =~ s/(W*?)GL(X*?)_(.*?_)(.*)/$3/; $exttype =~ s/(W*?)GL(X*?)_(.*?_)(.*)/$3/;
my $extrem = $extname; my $extrem = $extname;
......
...@@ -30,7 +30,7 @@ if (@ARGV) ...@@ -30,7 +30,7 @@ if (@ARGV)
foreach my $ext (sort @extlist) foreach my $ext (sort @extlist)
{ {
my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
output_decls($functions, \&make_pfn_decl); output_decls($functions, \&make_pfn_decl);
} }
} }
...@@ -23,7 +23,7 @@ if (@ARGV) ...@@ -23,7 +23,7 @@ if (@ARGV)
foreach my $ext (sort @extlist) foreach my $ext (sort @extlist)
{ {
my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
my $extvar = $extname; my $extvar = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/; $extvar =~ s/GL(X*)_/GL$1EW_/;
print $export . " GLboolean " . prefix_varname($extvar) . ";\n"; print $export . " GLboolean " . prefix_varname($extvar) . ";\n";
......
...@@ -125,6 +125,7 @@ my %fnc_ignore_list = ( ...@@ -125,6 +125,7 @@ my %fnc_ignore_list = (
my %regex = ( my %regex = (
eofnc => qr/(?:\);?$|^$)/, # )$ | );$ | ^$ eofnc => qr/(?:\);?$|^$)/, # )$ | );$ | ^$
extname => qr/^[A-Z][A-Za-z0-9_]+$/, extname => qr/^[A-Z][A-Za-z0-9_]+$/,
none => qr/^\(none\)$/,
function => qr/^(.+) ([a-z][a-z0-9_]*) \((.+)\)$/i, function => qr/^(.+) ([a-z][a-z0-9_]*) \((.+)\)$/i,
prefix => qr/^(?:[aw]?gl|glX)/, # gl | agl | wgl | glX prefix => qr/^(?:[aw]?gl|glX)/, # gl | agl | wgl | glX
tprefix => qr/^(?:[AW]?GL|GLX)_/, # GL_ | AGL_ | WGL_ | GLX_ tprefix => qr/^(?:[AW]?GL|GLX)_/, # GL_ | AGL_ | WGL_ | GLX_
...@@ -181,7 +182,13 @@ sub parse_spec($) ...@@ -181,7 +182,13 @@ sub parse_spec($)
"Name Strings" => sub { "Name Strings" => sub {
# Add extension name to extension list # Add extension name to extension list
# Does this look even plausible?
# Initially use $extname if (none) specified
if (/$regex{none}/)
{
$_ = $extname;
}
if (/$regex{extname}/) if (/$regex{extname}/)
{ {
# prefix with "GL_" if prefix not present # prefix with "GL_" if prefix not present
...@@ -301,10 +308,11 @@ foreach my $spec (sort @speclist) ...@@ -301,10 +308,11 @@ foreach my $spec (sort @speclist)
{ {
my $info = "$ext_dir/" . $ext; my $info = "$ext_dir/" . $ext;
open EXT, ">$info"; open EXT, ">$info";
print EXT $ext . "\n"; print EXT $ext . "\n"; # Extension name
my $specname = $spec; my $specname = $spec;
$specname =~ s/registry\///; $specname =~ s/registry\///;
print EXT $reg_http . $specname . "\n"; print EXT $reg_http . $specname . "\n"; # Extension info URL
print EXT $ext . "\n"; # Extension string
my $prefix = $ext; my $prefix = $ext;
$prefix =~ s/^(.+?)(_.+)$/$1/; $prefix =~ s/^(.+?)(_.+)$/$1/;
......
...@@ -234,15 +234,24 @@ EOT ...@@ -234,15 +234,24 @@ EOT
GL_MAX_SAMPLES_EXT 0x8D57 GL_MAX_SAMPLES_EXT 0x8D57
EOT EOT
# fix const correctness in GL_ARB_shader_objects # Filter out GL_NV_gpu_program_fp64 enums and functions
# perl -e 's/(.+glUniform.*(fv|iv).+)(GLfloat\*.+|GLint\*.+)/\1const \3/;' -pi $1/GL_ARB_shader_objects head -n3 $1/GL_NV_gpu_program_fp64 > tmp
mv tmp $1/GL_NV_gpu_program_fp64
# Filter glGetUniformui64vNV from GL_NV_shader_buffer_load
grep -v "glGetUniformui64vNV" $1/GL_NV_shader_buffer_load > tmp
mv tmp $1/GL_NV_shader_buffer_load
# Filter out GL_ARB_gpu_shader_fp64 enums and functions
head -n3 $1/GL_ARB_gpu_shader_fp64 > tmp
mv tmp $1/GL_ARB_gpu_shader_fp64
# Filter out profile enumerations from GLX_ARB_create_context # Filter out profile enumerations from GLX_ARB_create_context
grep -v "_PROFILE_" $1/GLX_ARB_create_context > tmp grep -v "_PROFILE_" $1/GLX_ARB_create_context > tmp
mv tmp $1/GLX_ARB_create_context mv tmp $1/GLX_ARB_create_context
# Filter only profile related enumerations for GLX_ARB_create_context_profile # Filter only profile related enumerations for GLX_ARB_create_context_profile
head -n2 $1/GLX_ARB_create_context_profile > tmp head -n3 $1/GLX_ARB_create_context_profile > tmp
grep "_PROFILE_" $1/GLX_ARB_create_context_profile >> tmp grep "_PROFILE_" $1/GLX_ARB_create_context_profile >> tmp
mv tmp $1/GLX_ARB_create_context_profile mv tmp $1/GLX_ARB_create_context_profile
...@@ -251,7 +260,7 @@ EOT ...@@ -251,7 +260,7 @@ EOT
mv tmp $1/WGL_ARB_create_context mv tmp $1/WGL_ARB_create_context
# Filter only profile related enumerations for WGL_ARB_create_context_profile # Filter only profile related enumerations for WGL_ARB_create_context_profile
head -n2 $1/WGL_ARB_create_context_profile > tmp head -n3 $1/WGL_ARB_create_context_profile > tmp
grep "_PROFILE_" $1/WGL_ARB_create_context_profile >> tmp grep "_PROFILE_" $1/WGL_ARB_create_context_profile >> tmp
mv tmp $1/WGL_ARB_create_context_profile mv tmp $1/WGL_ARB_create_context_profile
......
GLX_ARB_get_proc_address GLX_ARB_get_proc_address
http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.txt http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.txt
GLX_ARB_get_proc_address
extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void);
GLX_ATI_pixel_format_float
GLX_ATI_pixel_format_float GLX_ATI_pixel_format_float
GLX_RGBA_FLOAT_ATI_BIT 0x00000100 GLX_RGBA_FLOAT_ATI_BIT 0x00000100
GLX_ATI_render_texture
GLX_ATI_render_texture GLX_ATI_render_texture
GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800
GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801
......
GLX_EXT_fbconfig_packed_float GLX_EXT_fbconfig_packed_float
http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt
GLX_EXT_fbconfig_packed_float
GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
GLX_EXT_framebuffer_sRGB GLX_EXT_framebuffer_sRGB
http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt
GLX_EXT_framebuffer_sRGB
GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
GLX_NV_float_buffer GLX_NV_float_buffer
http://cvs1.nvidia.com/inc/GL/glxtokens.h http://cvs1.nvidia.com/inc/GL/glxtokens.h
GLX_NV_float_buffer
GLX_FLOAT_COMPONENTS_NV 0x20B0 GLX_FLOAT_COMPONENTS_NV 0x20B0
GLX_NV_vertex_array_range GLX_NV_vertex_array_range
http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt
GLX_NV_vertex_array_range
void * glXAllocateMemoryNV (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority) void * glXAllocateMemoryNV (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority)
void glXFreeMemoryNV (void *pointer) void glXFreeMemoryNV (void *pointer)
GLX_SGIS_shared_multisample
GLX_SGIS_shared_multisample GLX_SGIS_shared_multisample
GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
GLX_SGIX_hyperpipe GLX_SGIX_hyperpipe
http://oss.sgi.com/projects/ogl-sample/registry/SGIX/hyperpipe_group.txt http://oss.sgi.com/projects/ogl-sample/registry/SGIX/hyperpipe_group.txt
GLX_SGIX_hyperpipe
GLX_HYPERPIPE_ID_SGIX 0x8030 GLX_HYPERPIPE_ID_SGIX 0x8030
GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
......
GLX_SGIX_swap_barrier GLX_SGIX_swap_barrier
http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_barrier.txt http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_barrier.txt
GLX_SGIX_swap_barrier