Commit f12e7927 authored by Yaroslav Halchenko's avatar Yaroslav Halchenko

Imported Upstream version 1.5.4

parent 0616a842
......@@ -71,24 +71,38 @@ sub parse_ext($)
my %tokens = ();
my %types = ();
my @exacts = ();
my $extname = "";
my $exturl = "";
my $extname = ""; # Full extension name GL_FOO_extension
my $exturl = ""; # Info URL
my $extstring = ""; # Relevant extension string
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>)
{
chomp;
if (/$regex{extname}/)
{
$extname = $_;
next;
}
elsif (/$regex{exturl}/)
{
$exturl = $_;
}
elsif (s/^\s+//)
if (s/^\s+//)
{
if (/$regex{exact}/)
{
......@@ -119,7 +133,7 @@ sub parse_ext($)
close EXT;
return ($extname, $exturl, \%types, \%tokens, \%functions, \@exacts);
return ($extname, $exturl, $extstring, \%types, \%tokens, \%functions, \@exacts);
}
sub output_tokens($$)
......
......@@ -29,7 +29,7 @@ if (@ARGV)
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);
}
}
......@@ -23,7 +23,7 @@ if (@ARGV)
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;
$extvar =~ s/GL(X*)_/GL$1EW_/;
print "GLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n";
......
......@@ -52,7 +52,7 @@ if (@ARGV)
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);
print "#ifndef $extname\n#define $extname 1\n";
......
......@@ -26,7 +26,7 @@ if (@ARGV)
print "<table border=\"0\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" align=\"center\">\n";
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 =~ s/^(?:W?)GL(?:X?)_([A-Z0-9]+?)_.*$/$1/;
$extname =~ s/^(?:W?)GL(?:X?)_(.*)$/$1/;
......
......@@ -32,7 +32,7 @@ if (@ARGV)
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;
$extvar =~ s/GL(X*)_/GL$1EW_/;
my $extpre = $extname;
......@@ -50,7 +50,7 @@ if (@ARGV)
{
print " glewPrintExt(\"$extname\", $extvar, $extpre" .
"ewIsSupported(\"$extname\"), $extpre" .
"ewGetExtension(\"$extname\"));\n";
"ewGetExtension(\"$extstring\"));\n";
}
output_decls($functions, \&make_pfn_info);
print "}\n\n";
......
......@@ -38,7 +38,7 @@ if (@ARGV)
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 " _glewInfo_$extname();\n";
......
......@@ -34,7 +34,7 @@ if (@ARGV)
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $types, $tokens, $functions, $exacts) =
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) =
parse_ext($ext);
#make_separator($extname);
......
......@@ -32,7 +32,7 @@ if (@ARGV)
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;
$extvar =~ s/GL(X*)_/GL$1EW_/;
......@@ -43,7 +43,12 @@ if (@ARGV)
#my $pextvar = prefix_varname($extvar);
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 ($extname =~ /WGL_.*/)
......
......@@ -22,7 +22,7 @@ if (@ARGV)
my $curexttype = "";
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;
$exttype =~ s/(W*?)GL(X*?)_(.*?_)(.*)/$3/;
my $extrem = $extname;
......
......@@ -30,7 +30,7 @@ if (@ARGV)
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);
}
}
......@@ -23,7 +23,7 @@ if (@ARGV)
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;
$extvar =~ s/GL(X*)_/GL$1EW_/;
print $export . " GLboolean " . prefix_varname($extvar) . ";\n";
......
......@@ -125,6 +125,7 @@ my %fnc_ignore_list = (
my %regex = (
eofnc => qr/(?:\);?$|^$)/, # )$ | );$ | ^$
extname => qr/^[A-Z][A-Za-z0-9_]+$/,
none => qr/^\(none\)$/,
function => qr/^(.+) ([a-z][a-z0-9_]*) \((.+)\)$/i,
prefix => qr/^(?:[aw]?gl|glX)/, # gl | agl | wgl | glX
tprefix => qr/^(?:[AW]?GL|GLX)_/, # GL_ | AGL_ | WGL_ | GLX_
......@@ -181,7 +182,13 @@ sub parse_spec($)
"Name Strings" => sub {
# Add extension name to extension list
# Does this look even plausible?
# Initially use $extname if (none) specified
if (/$regex{none}/)
{
$_ = $extname;
}
if (/$regex{extname}/)
{
# prefix with "GL_" if prefix not present
......@@ -301,10 +308,11 @@ foreach my $spec (sort @speclist)
{
my $info = "$ext_dir/" . $ext;
open EXT, ">$info";
print EXT $ext . "\n";
print EXT $ext . "\n"; # Extension name
my $specname = $spec;
$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;
$prefix =~ s/^(.+?)(_.+)$/$1/;
......
......@@ -234,15 +234,24 @@ EOT
GL_MAX_SAMPLES_EXT 0x8D57
EOT
# fix const correctness in GL_ARB_shader_objects
# perl -e 's/(.+glUniform.*(fv|iv).+)(GLfloat\*.+|GLint\*.+)/\1const \3/;' -pi $1/GL_ARB_shader_objects
# Filter out GL_NV_gpu_program_fp64 enums and functions
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
grep -v "_PROFILE_" $1/GLX_ARB_create_context > tmp
mv tmp $1/GLX_ARB_create_context
# 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
mv tmp $1/GLX_ARB_create_context_profile
......@@ -251,7 +260,7 @@ EOT
mv tmp $1/WGL_ARB_create_context
# 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
mv tmp $1/WGL_ARB_create_context_profile
......
GLX_ARB_get_proc_address
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);
GLX_ATI_pixel_format_float
GLX_ATI_pixel_format_float
GLX_RGBA_FLOAT_ATI_BIT 0x00000100
GLX_ATI_render_texture
GLX_ATI_render_texture
GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800
GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801
......
GLX_EXT_fbconfig_packed_float
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_BIT_EXT 0x00000008
GLX_EXT_framebuffer_sRGB
http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt
GLX_EXT_framebuffer_sRGB
GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
GLX_NV_float_buffer
http://cvs1.nvidia.com/inc/GL/glxtokens.h
GLX_NV_float_buffer
GLX_FLOAT_COMPONENTS_NV 0x20B0
GLX_NV_vertex_array_range
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 glXFreeMemoryNV (void *pointer)
GLX_SGIS_shared_multisample
GLX_SGIS_shared_multisample
GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
GLX_SGIX_hyperpipe
http://oss.sgi.com/projects/ogl-sample/registry/SGIX/hyperpipe_group.txt
GLX_SGIX_hyperpipe
GLX_HYPERPIPE_ID_SGIX 0x8030
GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
......
GLX_SGIX_swap_barrier
http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_barrier.txt
GLX_SGIX_swap_barrier
void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier)
Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max)
GLX_SGIX_swap_group
http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_group.txt
GLX_SGIX_swap_group
void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member)
GLX_SUN_video_resize
http://wwws.sun.com/software/graphics/opengl/extensions/glx_sun_video_resize.txt
GLX_SUN_video_resize
GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD
GLX_VIDEO_RESIZE_SUN 0x8171
int glXVideoResizeSUN (Display* display, GLXDrawable window, float factor)
......
GLX_VERSION_1_2
http://www.opengl.org/documentation/specs/glx/glx1.2.ps
GLX_VERSION_1_2
Display* glXGetCurrentDisplay (void)
GLX_VERSION_1_3
http://www.opengl.org/documentation/specs/glx/glx1.3.pdf
GLX_VERSION_1_3
GLX_WINDOW_BIT 0x00000001
GLX_PIXMAP_BIT 0x00000002
......
GLX_VERSION_1_4
http://www.opengl.org/documentation/specs/glx/glx1.4.pdf
GLX_VERSION_1_4
GLX_SAMPLE_BUFFERS 100000
GLX_SAMPLES 100001
......
GL_APPLE_float_pixels
http://developer.apple.com/opengl/extensions/apple_float_pixels.html
GL_APPLE_float_pixels
GL_HALF_APPLE 0x140B
GL_COLOR_FLOAT_APPLE 0x8A0F
GL_RGBA_FLOAT32_APPLE 0x8814
......
GL_APPLE_pixel_buffer
GL_APPLE_pixel_buffer
GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10
GL_APPLE_texture_range
http://developer.apple.com/opengl/extensions/apple_texture_range.html
GL_APPLE_texture_range
GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC
GL_STORAGE_PRIVATE_APPLE 0x85BD
GL_STORAGE_CACHED_APPLE 0x85BE
......
GL_ARB_imaging
GL_ARB_imaging
GL_CONSTANT_COLOR 0x8001
GL_ONE_MINUS_CONSTANT_COLOR 0x8002
......
GL_ARB_matrix_palette
http://oss.sgi.com/projects/ogl-sample/registry/ARB/matrix_palette.txt
GL_ARB_matrix_palette
GL_MATRIX_PALETTE_ARB 0x8840
GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
GL_MAX_PALETTE_MATRICES_ARB 0x8842
......
GL_ARB_multitexture
http://oss.sgi.com/projects/ogl-sample/registry/ARB/multitexture.txt
GL_ARB_multitexture
GL_TEXTURE0_ARB 0x84C0
GL_TEXTURE1_ARB 0x84C1
GL_TEXTURE2_ARB 0x84C2
......
GL_ARB_vertex_blend
http://oss.sgi.com/projects/ogl-sample/registry/ARB/vertex_blend.txt
GL_ARB_vertex_blend
GL_MAX_VERTEX_UNITS_ARB 0x86A4
GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
GL_WEIGHT_SUM_UNITY_ARB 0x86A6
......
GL_ATIX_point_sprites
http://www.ati.com/developer/atiopengl.pdf
GL_ATIX_point_sprites
GL_TEXTURE_POINT_MODE_ATIX 0x60B0
GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1
GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2
......
GL_ATIX_texture_env_combine3
http://www.ati.com/developer/atiopengl.pdf
GL_ATIX_texture_env_combine3
GL_MODULATE_ADD_ATIX 0x8744
GL_MODULATE_SIGNED_ADD_ATIX 0x8745
GL_MODULATE_SUBTRACT_ATIX 0x8746
GL_ATIX_texture_env_route
http://www.ati.com/developer/sdk/RadeonSDK/Html/Info/ATIX_texture_env_route.txt
GL_ATIX_texture_env_route
GL_SECONDARY_COLOR_ATIX 0x8747
GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748
GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749
GL_ATIX_vertex_shader_output_point_size
http://www.ati.com/developer/atiopengl.pdf
GL_ATIX_vertex_shader_output_point_size
GL_OUTPUT_POINT_SIZE_ATIX 0x610E
GL_ATI_envmap_bumpmap
http://oss.sgi.com/projects/ogl-sample/registry/ATI/envmap_bumpmap.txt
GL_ATI_envmap_bumpmap
GL_BUMP_ROT_MATRIX_ATI 0x8775
GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
......
GL_ATI_map_object_buffer
http://www.ati.com/developer/sdk/RADEONSDK/Html/Info/ATI_map_object_buffer.txt
GL_ATI_map_object_buffer
void* glMapObjectBufferATI (GLuint buffer)
void glUnmapObjectBufferATI (GLuint buffer)
GL_ATI_pn_triangles
http://www.ati.com/developer/sdk/RADEONSDK/Html/Info/ati_pn_triangles.txt
GL_ATI_pn_triangles
GL_PN_TRIANGLES_ATI 0x87F0
GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
......
GL_ATI_separate_stencil
http://www.ati.com/developer/sdk/RadeonSDK/Html/Info/ATI_separate_stencil.txt
GL_ATI_separate_stencil
GL_STENCIL_BACK_FUNC_ATI 0x8800
GL_STENCIL_BACK_FAIL_ATI 0x8801
GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
......